Skip to main content
POST
/
v1
/
api-keys
Create API Key
curl --request POST \
  --url https://api.truthlocks.com/v1/api-keys \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "Production API Key",
  "scopes": [
    "attestations:mint",
    "attestations:read"
  ]
}
'
{
  "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"
}
Creates a new API key for the authenticated organization. The secret is returned ONCE and cannot be retrieved again. Store it securely.

Parameters

name
string
required
Human-readable name for the key
scopes
array
Permission scopes (e.g., attestations:mint). Defaults to wildcard.

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"
}

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Body

application/json
name
string
required

Human-readable name for the key

scopes
string[]

Permission scopes (default is wildcard)

Response

201 - application/json

API key created

id
string<uuid>
name
string
secret
string

Full API key (shown once)