Skip to content
Get Started

Mint a temporary API token

POST/v3/auth/tokens

Creates a short-lived bearer token for the authenticated account. This endpoint must be called with live account API keys; temporary bearer tokens and test API keys cannot mint additional tokens.

When phone_number or phone_numbers is supplied, the token is scoped to those Sendblue phone numbers. When no phone selector is supplied, the token is an account-scoped temporary token.

The plaintext token is returned only once.

Body ParametersJSONExpand Collapse
expires_in_seconds: optional number

Token lifetime in seconds. Defaults to 900 seconds when omitted.

minimum60
maximum3600
phone_number: optional string

Single Sendblue phone number to scope the token to. Cannot be combined with phone_numbers.

phone_numbers: optional array of string

Sendblue phone numbers to scope the token to. Cannot be combined with phone_number.

ReturnsExpand Collapse
token: string

Plaintext temporary bearer token. Store it securely; it is returned only once.

expires_at: string

ISO timestamp when the token expires.

formatdate-time
phone_numbers: array of string

Phone-number scope for this token. Empty means the token is account-scoped.

token_id: string

Token identifier used for revocation.

formatuuid
token_type: "Bearer"

Mint a temporary API token

curl https://api.sendblue.co/v3/auth/tokens \
    -X POST \
    -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \
    -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET"
{
  "token": "sb_tmp_v1.11111111-1111-4111-8111-111111111111.abcdefghijklmnopqrstuvwxyzABCDEFGHI",
  "expires_at": "2026-08-14T20:15:00.000Z",
  "phone_numbers": [
    "+12125550101"
  ],
  "token_id": "11111111-1111-4111-8111-111111111111",
  "token_type": "Bearer"
}
Returns Examples
{
  "token": "sb_tmp_v1.11111111-1111-4111-8111-111111111111.abcdefghijklmnopqrstuvwxyzABCDEFGHI",
  "expires_at": "2026-08-14T20:15:00.000Z",
  "phone_numbers": [
    "+12125550101"
  ],
  "token_id": "11111111-1111-4111-8111-111111111111",
  "token_type": "Bearer"
}