API keys are managed in the dashboard only. The platform API can’t create, rotate or revoke keys,
so a leaked key can never create another.
Create a key
1
Open the create panel
Go to Developers > API Keys and select Create API Key.
2
Name the key
Enter a Key Name (up to 255 characters) that says where the key will live, such as
Production backend. Add a Description (optional) if it helps your team.3
Choose an expiration
Pick Never, 30 days, 90 days, 6 months or 1 year. After that date the key
stops working.
4
Set permissions
For each group under Permissions, choose No access, read-only access, or
Full access. Full access grants both the read and the write scope for that group. You
need at least one.
5
Restrict IP addresses (optional)
In IP Allowlist (optional), enter the IP addresses allowed to use the key, separated by
commas. Leave it empty to allow any address.
6
Create and copy the secret
Select Create. The panel shows the Key ID and the Secret Key. Copy the secret key
now: it’s shown only once. The key ID isn’t secret. Use it to find the key in logs and in the
dashboard.
Scopes
There are 18 scopes: a read scope and a write scope for each of nine groups. The dashboard shows the group names and the read-access labels below.
How a scope is chosen for a request:
GETrequests need the group’s read scope.POST,PATCH,PUTandDELETErequests need the write scope. That includes action endpoints that only read, such as previewing a campaign or a contact import.
403. The response names the missing scope and lists
the ones the key has:
Older keys may hold
email:send and email:read. These are the previous names of
messages:send and messages:read, and they still work. See the
changelog.The Send Messages permission
A key with Send Messages also works on the email send API, where it can send from any sending domain your organization owns. You can remove the permission from a key later. You can’t add it to an existing key: create a new key instead.Rate limits
Each key has its own limits, so one busy integration can’t use up another’s budget.
A request over either limit fails with
429. See Rate limits for the
headers and how to retry.
Manage a key
Select a key in Developers > API Keys to open it. It has three tabs:
To change the name, description or IP allowlist, select Edit on Key Information. To change
scopes, select Edit on Permissions. To change the expiry, use Expiration on the
Settings tab.
Rotate a key
- On the Overview tab, select the regenerate icon next to the masked key.
- Confirm with Regenerate.
- Copy the new secret. It’s shown once.
Revoke a key
On the Settings tab, under Danger Zone, select Revoke Key and confirm. Every request using the key fails from then on, including sends through the email send API. You can’t undo this.Request logs
The Usage tab lists every request made with the key, newest first. Each entry has the Method, Endpoint, Status, Time, IP Address and Timestamp. Filter by method or by status code to find failures. Only requests that authenticated with the key are logged. A request rejected asUnauthorized access never matched the key, so it won’t appear here.
Key statuses
“This API key is missing the … scope required by this endpoint”
“This API key is missing the … scope required by this endpoint”
Why: The key doesn’t have the scope in
requiredScope.Fix: Select Edit on the key’s Permissions and add it. For messages:send, create
a new key instead.“The "messages:send" scope cannot be added to an existing API key”
“The "messages:send" scope cannot be added to an existing API key”
Why: The send API can only receive a key when it’s created or regenerated.Fix: Create a new key with Messages set to Full access.
“This endpoint cannot be accessed with an API key”
“This endpoint cannot be accessed with an API key”
Why: Key management, billing, the wallet and a few other areas are dashboard-only.Fix: Do this in the dashboard.
Related
Authentication
How to send the key, and which credential works where.
Sending keys
The separate credential the email send API needs.
Rate limits
Per-key limits, headers and retries.
Errors
Error codes and what to do.