ThunderPhone v3 is live.Self-serve, from 2¢/min.Read the announcement

Developer

API Keys

Create, list, rotate, and revoke the sk_live_ secret keys your server-side integrations use to call the ThunderPhone REST API on behalf of your organization.

API keys (sk_live_...) are the primary credential for the ThunderPhone REST API. They are secret — treat them like a password. Each key is bound to exactly one organization; when an API call authenticates with a key, we look up the bound org automatically, which is why the rest of this reference never asks for an org id in the URL path.

This page documents the endpoints for creating, listing, renaming and revoking keys — the same operations the app exposes under Integrations → API keys (in the organization menu). You can create your first key in the app without ever using this API.

Endpoints

MethodPathRequired roleDescription
GET/v1/whoamiany authenticated roleValidate a connection and identify its organization
GET/v1/developer/api-keysadmin+List API keys
POST/v1/developer/api-keysadmin+Create a new API key
PATCH/v1/developer/api-keys/{key_id}admin+Rename an API key
DELETE/v1/developer/api-keys/{key_id}admin+Revoke an API key

API key object

{
  "id": "b1c2d3e4-...",
  "name": "production",
  "key_prefix": "sk_live_abcde12",
  "is_active": true,
  "created_at": "2026-04-20T18:24:10.113Z",
  "created_by_name": "Dana Reyes",
  "last_used_at": "2026-04-20T18:25:06.201Z",
  "revoked_at": null,
  "include_held_out_calls": false
}
FieldTypeDescription
idUUIDPublic id used by the revoke endpoint
namestringDisplay label
key_prefixstringFirst 15 chars of the raw key for UI display (always sk_live_ + 7 hex chars). The full key is NOT returned after creation
is_activebooleanfalse once the key is revoked
created_attimestamp
created_by_namestring | nullWho made the key: their name, or their email when they have no name. null when unknown or the person was removed
last_used_attimestamp | nullUpdated best-effort on every successful request
revoked_attimestamp | nullIf set, the key is revoked and will no longer authenticate
include_held_out_callsbooleanDefault false. Only for organizations with the agent iteration toolkit: whether this key sees held-out calls in full. Other keys get a held-out call as its call_id, start time and held_out only. Only a signed-in person can change it (PATCH with a session token); an API key, OAuth token or legacy token gets 403 dashboard_session_required

Validate a connection

GET /v1/whoami is a cheap credential check for integration setup. It accepts an organization API key, a human session token with X-ThunderPhone-Org, or an OAuth access token. OAuth tokens do not need an additional product scope for this endpoint.

curl https://api.thunderphone.com/v1/whoami \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
Response
{
  "organization": {"id": 42, "name": "Example Co"},
  "credential_kind": "api_key",
  "key_label": "Zapier production",
  "key_prefix": "sk_live_abcde12",
  "oauth_client_id": null,
  "scopes": [],
  "role": "owner"
}

Only safe identifiers are returned. Raw keys and tokens are never included. For OAuth, oauth_client_id and the access token's scopes are populated; for human sessions, the key and OAuth fields are null.


List API keys

cURL
curl https://api.thunderphone.com/v1/developer/api-keys \
  -H "Authorization: Token YOUR_SESSION_TOKEN" \
  -H "X-ThunderPhone-Org: 42"

Returns an array of API key objects — both active and revoked keys, sorted by created_at descending.


Create an API key

cURL
curl -X POST https://api.thunderphone.com/v1/developer/api-keys \
  -H "Authorization: Token YOUR_SESSION_TOKEN" \
  -H "X-ThunderPhone-Org: 42" \
  -H "Content-Type: application/json" \
  -d '{"name": "production"}'
Python
result = requests.post(
    "https://api.thunderphone.com/v1/developer/api-keys",
    headers={"Authorization": "Token YOUR_SESSION_TOKEN", "X-ThunderPhone-Org": "42"},
    json={"name": "production"},
).json()
new_key = result["key"]
FieldTypeRequiredDescription
namestringnoDisplay label, 1–120 chars. Defaults to "Default key"

Returns 201 Created with the API key object plus an extra top-level key field containing the raw sk_live_ value:

{
  "id": "b1c2d3e4-...",
  "name": "production",
  "key_prefix": "sk_live_abcde12",
  "is_active": true,
  "created_at": "2026-04-20T18:24:10.113Z",
  "created_by_name": "Dana Reyes",
  "last_used_at": null,
  "revoked_at": null,
  "include_held_out_calls": false,
  "key": "sk_live_abcdef1234567890abcdef1234567890abcdef123456"
}

Rename an API key

cURL
curl -X PATCH https://api.thunderphone.com/v1/developer/api-keys/b1c2d3e4-... \
  -H "Authorization: Token YOUR_SESSION_TOKEN" \
  -H "X-ThunderPhone-Org: 42" \
  -H "Content-Type: application/json" \
  -d '{"name": "Zapier production"}'
FieldTypeRequiredDescription
namestringnoThe new label, 1–120 chars after trimming spaces
include_held_out_callsbooleannoLet the key see held-out calls in full. Signed-in session only

Returns 200 with the API key object. The key itself doesn't change, keeps working, and is never returned.


Revoke an API key

cURL
curl -X DELETE https://api.thunderphone.com/v1/developer/api-keys/b1c2d3e4-... \
  -H "Authorization: Token YOUR_SESSION_TOKEN" \
  -H "X-ThunderPhone-Org: 42"

Returns 204 No Content. Revoked keys are permanently invalidated — all future requests using the key return 401 Unauthorized. You cannot un-revoke; create a new key instead.