# Auth # Tokens ## 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 Parameters - `expires_in_seconds: optional number` Token lifetime in seconds. Defaults to 900 seconds when omitted. - `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`. ### Returns - `token: string` Plaintext temporary bearer token. Store it securely; it is returned only once. - `expires_at: string` ISO timestamp when the token expires. - `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. - `token_type: "Bearer"` - `"Bearer"` ### Example ```http 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" ``` #### Response ```json { "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" } ``` ## Revoke a temporary API token **delete** `/v3/auth/tokens/{token_id}` Revokes a temporary bearer token owned by the authenticated account. This endpoint must be called with live account API keys; temporary bearer tokens and test API keys cannot revoke tokens. ### Path Parameters - `token_id: string` ### Example ```http curl https://api.sendblue.co/v3/auth/tokens/$TOKEN_ID \ -X DELETE \ -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \ -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET" ``` ## Domain Types ### Token Create Response - `TokenCreateResponse object { token, expires_at, phone_numbers, 2 more }` - `token: string` Plaintext temporary bearer token. Store it securely; it is returned only once. - `expires_at: string` ISO timestamp when the token expires. - `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. - `token_type: "Bearer"` - `"Bearer"`