Skip to content

Create an API key

POST
/api-keys
curl --request POST \
--url https://mail.teamander.com/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Production server", "scopes": [ "email:send", "email:read" ], "rate_limit": 120 }'

Mints a new key and returns the raw value once — store it immediately. Requested scopes are clamped to the caller’s own. Valid scopes: email:send, email:read, template:read, template:manage, domain:read, domain:write, smtp:read, smtp:write, suppression:read, suppression:write, webhook:read, webhook:write, apikey:manage.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 255 characters
scopes
Array<string>
Allowed values: email:send email:read template:read template:manage domain:read domain:write smtp:read smtp:write suppression:read suppression:write webhook:read webhook:write apikey:manage
rate_limit
integer
>= 1 <= 10000
Example
{
"name": "Production server",
"scopes": [
"email:send",
"email:read"
],
"rate_limit": 120
}

Key created (raw key shown once)

Media typeapplication/json
object
key
required
string
prefix
required
string
name
required
string
warning
required
string
Example
{
"key": "tmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"prefix": "tmk_xxxxxxx...",
"name": "Production server",
"warning": "Save this key now. It will not be shown again."
}

Validation failed

Media typeapplication/json
object
error
required
string
details
object
key
additional properties
nullable
Example
{
"error": "Validation failed",
"details": {}
}

Missing or invalid API key

Media typeapplication/json
object
error
required
string
message
string
Example
{
"error": "Invalid API key"
}