Account and API keys
Read your account's profile and credit balance, change the profile, and see which API key is calling. This page is generated from the OpenAPI document of release main-6976024, the one the API serves, so it lists only what the API has.
How to authenticate, where errors are explained, and the other resources are in the API reference.
The account's profile
GET /v1/account/profile
Its API key needs account:read.
Answers
- 200: The profile
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing)
- Account closed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
sends (required) | one of newsletters, app_mail or both, or null. What the account sends: newsletters (newsletters and announcements), app_mail (receipts, password resets, and other app mail), or both. Null until someone says. |
industry (required) | one of faith, nonprofit, club, school, sports, arts, events, winery_brewery_distillery, restaurant, food_maker, local_shop, online_store, publishing, software, health_fitness, professional or other, or null. The kind of organization: church or faith community (faith); charity or nonprofit (nonprofit); club, association, or membership group (club); school, camp, or youth program (school); sports team or league (sports); arts, music, or theater group (arts); events or venue (events); winery, brewery, or distillery (winery_brewery_distillery); restaurant, café, or bar (restaurant); farm, bakery, or food maker (food_maker); local shop or boutique (local_shop); online store (online_store); newsletter, blog, or podcast (publishing); software, app, or AI project (software); health, fitness, or wellness (health_fitness); coach, consultant, or other professional (professional); or other, in the account's own words (industry_other). Null until someone says. |
industry_other (required) | text, or null. The account's own words for other, or null. |
time_zone (required) | text. An IANA time zone: the account's days for scheduling and reports. UTC until someone sets it. |
contact_daily_limit (required) | true or false. One email a day per person: at most one marketing email per person per day, the limit a campaign send will take by default. On by default. Not the account’s own daily sending limit, which isn’t a setting. |
set_at (required) | a date and time (RFC 3339), or null. When the profile was first saved, by anyone; null until then. The app asks its welcome questions only while it’s null. |
Change the account's profile (owners and admins; keys need account:write, live only)
PATCH /v1/account/profile
Changes the fields the body names and leaves the rest. Sending values the profile already has changes nothing, so a retry is safe, except that the first save records set_at.
Its API key needs account:write.
Request body
A application/json body.
| Field | What it is |
|---|---|
sends | one of newsletters, app_mail or both, or null. What the account sends: newsletters (newsletters and announcements), app_mail (receipts, password resets, and other app mail), or both. |
industry | one of faith, nonprofit, club, school, sports, arts, events, winery_brewery_distillery, restaurant, food_maker, local_shop, online_store, publishing, software, health_fitness, professional or other, or null. The kind of organization: church or faith community (faith); charity or nonprofit (nonprofit); club, association, or membership group (club); school, camp, or youth program (school); sports team or league (sports); arts, music, or theater group (arts); events or venue (events); winery, brewery, or distillery (winery_brewery_distillery); restaurant, café, or bar (restaurant); farm, bakery, or food maker (food_maker); local shop or boutique (local_shop); online store (online_store); newsletter, blog, or podcast (publishing); software, app, or AI project (software); health, fitness, or wellness (health_fitness); coach, consultant, or other professional (professional); or other, in the account's own words (industry_other). Any value but other clears industry_other, and so does null. |
industry_other | text, up to 100 characters, or null. Only with industry: other in the same request. |
time_zone | text, up to 64 characters. An IANA time zone. |
contact_daily_limit | true or false. |
Answers
- 200: The profile as it now is
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
sends (required) | one of newsletters, app_mail or both, or null. What the account sends: newsletters (newsletters and announcements), app_mail (receipts, password resets, and other app mail), or both. Null until someone says. |
industry (required) | one of faith, nonprofit, club, school, sports, arts, events, winery_brewery_distillery, restaurant, food_maker, local_shop, online_store, publishing, software, health_fitness, professional or other, or null. The kind of organization: church or faith community (faith); charity or nonprofit (nonprofit); club, association, or membership group (club); school, camp, or youth program (school); sports team or league (sports); arts, music, or theater group (arts); events or venue (events); winery, brewery, or distillery (winery_brewery_distillery); restaurant, café, or bar (restaurant); farm, bakery, or food maker (food_maker); local shop or boutique (local_shop); online store (online_store); newsletter, blog, or podcast (publishing); software, app, or AI project (software); health, fitness, or wellness (health_fitness); coach, consultant, or other professional (professional); or other, in the account's own words (industry_other). Null until someone says. |
industry_other (required) | text, or null. The account's own words for other, or null. |
time_zone (required) | text. An IANA time zone: the account's days for scheduling and reports. UTC until someone sets it. |
contact_daily_limit (required) | true or false. One email a day per person: at most one marketing email per person per day, the limit a campaign send will take by default. On by default. Not the account’s own daily sending limit, which isn’t a setting. |
set_at (required) | a date and time (RFC 3339), or null. When the profile was first saved, by anyone; null until then. The app asks its welcome questions only while it’s null. |
The API key making this request
GET /v1/api-keys/current
Which account the key acts in, whether it is a live or test key, and what it may do. It needs no scope, so any working key can check itself before it is used for anything else.
Any working API key: it needs no scope.
Answers
- 200: The key
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed)
- Account closed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
id (required) | text. |
name (required) | text. |
mode (required) | one of live or test. test keys run everything but never send real mail. |
last4 (required) | text. The key's last four characters, to tell keys apart. |
scopes (required) | a list, each text. |
restrictions (required) | an object. |
restrictions.domains | a list, each text. The only sending domains the key may send from. Absent: any of the account's. |
created_at (required) | a date and time (RFC 3339). |
last_used_at (required) | a date and time (RFC 3339), or null. When the key was last used, to within five minutes. |
expires_at (required) | a date and time (RFC 3339), or null. When the key stops working. Null: it never expires. |
revoked_at (required) | a date and time (RFC 3339), or null. When the key was revoked. A revocation is final. |
account_id (required) | text. |
The key's account's credit balance
GET /v1/account/balance
What the account can spend now, so an agent or a script can check before it sends. A fan_test_ key reads the same balance: test sends are free, and never use it.
Its API key needs billing:read.
Answers
- 200: The balance
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing)
- Account closed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
available (required) | an object. What the account can spend now: credit in, less usage, less what sends in flight hold. |
available.amount_minor (required) | text. A whole number of minor units (cents for USD), as a string. |
available.currency (required) | text. ISO 4217. |
available_decimal (required) | text. available in the currency's major unit, exactly, for display. |
updated_at (required) | a date and time (RFC 3339), or null. When the balance last moved. |