Skip to main content
Mint a new key. The full secret is returned once, in this response only — store it immediately. Afterwards only its prefix and last four characters are visible. POST /v1/api-keys Keys are account (tenant) resources. By default a key is account-wide; pass senderId to lock it to a single project. The wire form of the secret is <keyPrefix>_<secret> — send it whole as the bearer token.

Body parameters

string
required
A label to recognize the key by, shown in the dashboard.
string
Scope the key to one project. Must be a project in your account. Omit for an account-wide key (callers then name the project per-request with the X-Drin-Product header).
string[]
Permission scopes to grant (e.g. emails:send). Omit for a key with the account’s default permissions.

Request

Response

Returns 201 Created. The secret field is present only here; every other endpoint returns the key without it. Persist secret before discarding the response.
201 Created
The secret is shown once. If you lose it, you can’t recover it — there is no endpoint that re-reveals a secret. Revoke the key and create a new one.
Foreign project. A senderId that doesn’t belong to your account returns 422 validation_error.