You can manage keys in the dashboard (Connect → API) or through the API, for example to rotate keys from a deploy pipeline. Every endpoint here takes the usual Authorization: Bearer <key> header.
Rules
A key can never give itself, or another key, more access than it has:
Live key (pk_…) | Test key (pk_test_…) | |
|---|---|---|
| List | Live and test keys | Test keys only |
| Create | Live or test keys | Test keys only |
| Revoke, roll | Live and test keys | Test keys only |
- Keys only see keys of their own organization. A key ID from another organization returns
404 api_key_not_found. - A test key that tries to create, revoke or roll a live key gets
403 insufficient_privilege. - The secret is returned once, when a key is created or rolled. Pogton stores only a hash. These endpoints don't accept an
Idempotency-Key, because the stored response would contain the secret. - A key can revoke or roll itself, for example right after it leaked.
- An organization can have up to 50 active keys (
409 api_key_limit_reached).
List keys
curl https://pogton.com/api/v1/api-keys \
-H "Authorization: Bearer pk_3f9a..."
{
"data": [
{
"id": "kd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e",
"name": "Production backend",
"mode": "live",
"prefix": "pk_3f9a1c2",
"status": "active",
"current": true,
"created_at": "2026-09-01T08:00:00.000Z",
"last_used_at": "2026-10-21T09:00:00.000Z",
"expires_at": null,
"revoked_at": null,
"created_via": "dashboard",
"replaced_by": null
}
]
}
current marks the key that made the request. Add ?include_revoked=true to include revoked keys.
Create a key
curl -X POST https://pogton.com/api/v1/api-keys \
-H "Authorization: Bearer pk_3f9a..." \
-H "Content-Type: application/json" \
-d '{ "name": "CI tests", "mode": "test" }'
The response is the key as listed above plus key, the secret. Store it now. mode defaults to the mode of the key making the request.
Roll a key
Rolling creates a new key with the same name and mode and retires the old one. Give expires_in (seconds, up to 604800 = 7 days) to keep the old key working while you deploy the new one:
curl -X POST https://pogton.com/api/v1/api-keys/kd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e/roll \
-H "Authorization: Bearer pk_3f9a..." \
-H "Content-Type: application/json" \
-d '{ "expires_in": 3600 }'
{
"id": "km1n2p3q4r5s6t7v8w9x0y1z2a3b4c5d",
"name": "Production backend",
"mode": "live",
"key": "pk_8e2d…",
"replaces": { "id": "kd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e", "expires_at": "2026-10-21T10:00:00.000Z" },
"message": "Store the key now; it is not shown again."
}
Until expires_at the old key has status: "expiring". Without expires_in it stops working immediately. A key can be rolled once; roll its replacement next time.
Revoke a key
curl -X DELETE https://pogton.com/api/v1/api-keys/kd7b2c9e0f1a3b4c5d6e7f8a9b0c1d2e \
-H "Authorization: Bearer pk_3f9a..."
The key stops working immediately. Connect links and headless connect URLs signed with it stop working too, so roll with a grace period when links may still be open.
The MCP server has the same operations as list_api_keys, create_api_key, revoke_api_key and roll_api_key, with the same rules.
