API Keys

Generate, list, and revoke API keys for developer access.

POST
/v1/keys/generate
Create a new API key
GET
/v1/keys
List your API keys
POST
/v1/keys/revoke
Revoke an API key

Generate a Key

Body Parameters

ParameterTypeRequiredDescription
namestringNoDisplay name (default: "Default Key")
expires_in_daysintegerNoAuto-expire after N days

Request

bash
1
2
3
4
"docs-token-command">curl -X "docs-token-keyword">POST https://theconflux.com/v1/keys/generate \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name": "Production Key", "expires_in_days": "docs-token-number">90}'

Response

json
1
2
3
4
5
6
7
8
9
10
{
  "id": "key_abc123",
  "api_key": "cf_live_x7k9m2p4q8r1s5t6",
  "key_prefix": "cf_live_x7k9m2",
  "name": "Production Key",
  "is_active": true,
  "created_at": "2026-03-29T14:00:00Z",
  "expires_at": "2026-06-27T14:00:00Z",
  "warning": "Save this key now. It cannot be retrieved later."
}

List Keys

json
1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "data": [
    {
      "id": "key_abc123",
      "key_prefix": "cf_live_x7k9m2",
      "name": "Production Key",
      "is_active": true,
      "last_used_at": "2026-03-29T15:00:00Z",
      "created_at": "2026-03-29T14:00:00Z",
      "expires_at": "2026-06-27T14:00:00Z"
    }
  ]
}

Revoke a Key

Request

bash
1
2
3
4
"docs-token-command">curl -X "docs-token-keyword">POST https://theconflux.com/v1/keys/revoke \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"key_id": "key_abc123"}'

Response

json
1
2
3
{
  "revoked": true
}

Full API keys are only returned once at generation. Store them securely. We only store hashed versions.