Skip to content
Sendtier Docs
API reference

Create an API key

Source: OpenAPI (openapi/openapi.yaml).

curl -X POST "https://api.sendtier.example/api-keys" \  -H "Authorization: Bearer st_live_REPLACE_ME" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "mode": "live",    "scope": "full"  }'
{  "id": "string",  "name": "string",  "mode": "live",  "scope": "full",  "prefix": "string",  "created_at": "2019-08-24T14:15:22Z",  "last_used_at": "2019-08-24T14:15:22Z",  "key": "string"}
POST
/api-keys

Requires a full-scope key. A test key may create only test keys. The full secret is returned only by this operation and is never stored. Idempotency-Key is not supported. Retrying creates a second key; the first can be revoked.

Authorization

headerAuthorizationBearer <token>

API key: st_live_... or st_test_...

Request Body

application/json
  1. body
name*string

Names with control characters are rejected. Surrounding whitespace is trimmed; the trimmed name must be nonblank.

Length1 <= length <= 64
mode*string
Value in"live""test"
scope*string
Value in"full""sending""read_only"

Response Body

API key created. Save the secret now.

application/json
  1. response
id*string
name*string
mode*string
Value in"live""test"
scope*string
Value in"full""sending""domain""read_only"
prefix*string

Stored lookup prefix, not the full secret.

created_at*string
Formatdate-time
last_used_at?string
Formatdate-time
key*string

Full secret, returned only in the create response and never stored.