Waitlist open: get early access

API reference: Keys

4 endpoints of the Keys group.

List API keys

GET/v1/keys

Prefix, environment and scope; the key itself is shown once, when it is created.

Parameters

NameInTypeDescription
limitqueryintegerPage size. The default and the maximum depend on the endpoint (emails 50 up to 500, received mail 50 up to 200, audit up to 200, the others 100 up to 500 or 1000). Default: 100
cursorquerystringThe next_cursor of the previous page. Opaque; pass it unchanged to the same endpoint with the same filters.

Example

curl "https://api.sendtide.ch/v1/keys" \
  -H "Authorization: Bearer sk_test_…"

Responses

StatusDescription
200 Keys
Response fields
dataarray<ApiKey>
data[].idstring
data[].namestring
data[].prefixstring
data[].envenum: live | test
data[].scopeenum: admin | full | send | read
data[].allowed_ipsarray<string>CIDRs, IPv4 or IPv6; empty: from anywhere
data[].allowed_domainsarray<string>From domain must be one of these or a subdomain; empty: any verified domain
data[].allowed_streamsarray<string>Streams the key may send through; empty: all
data[].api_versionstringAPI version the key was created with Example: 2026-11-29
data[].keystringOnly in the answer to POST
data[].expires_atstring | null (date-time)The key is refused from then on; null: never
data[].rotated_fromstring | nullId of the key this one replaced
data[].last_used_atstring | null (date-time)
data[].created_atstring (date-time)
next_cursorstring | null

Create an API key

POST/v1/keys

Needs scope full or admin (or a dashboard role of developer or higher). The new key gets the requested scope at most as high as the caller's own; the admin scope is only created by owners and admins in the dashboard (403 otherwise). Default scope: full. With expires_at (at most a year ahead) the key stops working at that time.

Request body application/json

FieldTypeDescription
namestring
env *enum: live | test
scopeenum: admin | full | send | readDefault: "full"
allowed_ipsarray<string>
allowed_domainsarray<string>
allowed_streamsarray<string>
expires_atstring (date-time)

Example

curl -X POST "https://api.sendtide.ch/v1/keys" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Server","env":"live","scope":"send","allowed_ips":["203.0.113.0/24"]}'

Responses

StatusDescription
201 Created; the key is in the answer ApiKey
Response fields
idstring
namestring
prefixstring
envenum: live | test
scopeenum: admin | full | send | read
allowed_ipsarray<string>CIDRs, IPv4 or IPv6; empty: from anywhere
allowed_domainsarray<string>From domain must be one of these or a subdomain; empty: any verified domain
allowed_streamsarray<string>Streams the key may send through; empty: all
api_versionstringAPI version the key was created with Example: 2026-11-29
keystringOnly in the answer to POST
expires_atstring | null (date-time)The key is refused from then on; null: never
rotated_fromstring | nullId of the key this one replaced
last_used_atstring | null (date-time)
created_atstring (date-time)
403 Error in the usual format, errors and limits

Revoke an API key

DELETE/v1/keys/{id}

Revoking an admin key needs an admin.

Parameters

NameInTypeDescription
id *pathstring

Example

curl -X DELETE "https://api.sendtide.ch/v1/keys/key_3f9a" \
  -H "Authorization: Bearer sk_test_…"

Responses

StatusDescription
204 Revoked

Rotate an API key

POST/v1/keys/{id}/rotate

Creates a new key with the name, environment, scope, restrictions and API version of the old one; the new key is in the answer, only this once. The old key keeps working for the chosen time (expires_in, or expires_at at most 90 days ahead) and is refused afterwards; now revokes it at once. Rotating a key that already expires only ever moves its expiry earlier. The same rules as for creating and revoking keys apply: rotating an admin key needs an owner or admin in the dashboard. Owners and admins get a reminder 7 days and 1 day before a key expires.

Parameters

NameInTypeDescription
id *pathstring

Request body application/json

FieldTypeDescription
expires_inenum: now | 1h | 24h | 7d | 30dHow long the old key keeps working
expires_atstring (date-time)Instead of expires_in; at most 90 days ahead

Example

curl -X POST "https://api.sendtide.ch/v1/keys/key_3f9a/rotate" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{}'

Responses

StatusDescription
201 Rotated; the new key is in the answer, only this once
403 Error in the usual format, errors and limits
404 Error in the usual format, errors and limits
422 Error in the usual format, errors and limits