Create an API key
POST
/api-keys
const url = 'https://mail.teamander.com/v1/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Production server","scopes":["email:send","email:read"],"rate_limit":120}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
string
scopes
Array<string>
rate_limit
integer
Example
{ "name": "Production server", "scopes": [ "email:send", "email:read" ], "rate_limit": 120}Responses
Section titled “Responses”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
Example
{ "error": "Validation failed", "details": {}}Missing or invalid API key
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "Invalid API key"}