Create a key
Auth: Bearer key with no domain scope.
The secret is in this response and nowhere else. A test-mode key can only create test-mode keys, and a key limited to domains can't manage keys at all.
bearerAuthorizationBearer <token>An API key in the Authorization header.
application/json- body
name*stringName for the key. Letters, digits and hyphens, unique among the organization's live keys.
^[a-zA-Z0-9-]+$1 <= length <= 64mode?stringlive sends real mail; test routes every send to the mock provider. A test key can only create test keys.
"live""live""test"domain_ids?array<>Domains this key may send from. Empty means every domain in the organization.
[]rate_limit?integerRequests a minute this key is allowed, 1-10000. The install's default for new keys when absent: 3000 unless an admin changed it.
1 <= value <= 10000The created key, with its secret.
application/json- response
id?stringOpaque id, prefixed key_.
name?stringName the key was created with.
mode?stringtest routes every send to the mock provider.
"live""test"secret_prefix?stringLeading characters of the secret, enough to tell two keys apart. Never the secret.
domain_ids?array<string>Domains the key may send from. Empty means every domain in the organization.
rate_limit?integerRequests a minute this key is allowed.
last_used_at?|ISO 8601 timestamp of the last request that authenticated with it, over HTTP or SMTP, written at most once a minute. Null until the key's first request.
revoked_at?|ISO 8601 timestamp, or null while the key works.
created_at?stringISO 8601 timestamp.
secret?stringThe full key. Returned by this call only — it's stored as a hash and can't be read back.
curl -X POST 'https://pouch.example.com/v1/keys' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'{ "id": "string", "name": "string", "mode": "live", "secret_prefix": "string", "domain_ids": [ "string" ], "rate_limit": 0, "last_used_at": "string", "revoked_at": "string", "created_at": "string", "secret": "string"}