Create API Key

POSThttps://sandbox-api.truthlocks.com/v1/api-keysAuth required

Creates a new API key for the authenticated organization. The secret is returned ONCE and cannot be retrieved again. Store it securely.

Body Parameters

namestringrequired

Human-readable name for the key

Defaults to Production API Key

scopesarray

Permission scopes (e.g., attestations:mint). Defaults to wildcard.

Defaults to ["attestations:mint", "attestations:read"]

Responses

{
  "id": "880e8400-e29b-41d4-a716-446655440000",
  "name": "Production API Key",
  "secret": "tl_live_abc123xyz789abcdef1234567890abcdef",
  "scopes": [
    "attestations:mint",
    "attestations:read"
  ],
  "created_at": "2026-01-13T12:00:00Z"
}
POST/v1/api-keys
Language
CredentialsHEADER
Authorization
cURL Request
Examples ▾
curl --request POST \
  --url https://sandbox-api.truthlocks.com/v1/api-keys \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{
  "name": "Production API Key",
  "scopes": "[\"attestations:mint\", \"attestations:read\"]"
}'
Response

Click Try It! to send a real request, or view sample responses: