Skip to content

API keys

Agent keys (chr_ak_*) let you limit access to a single agent’s calendars, events, availability, and iCal subscriptions. Creating them requires Developer or Pro; listing and revoking work on every plan.

POST /v1/keys
FieldTypeRequiredDescription
agent_idstringYesTarget agent ID (agt_*)
labelstringNoOptional label, 1-100 characters
expires_instringNoWhen the key stops working, from now: 30d, 60d, 90d, 180d or 365d. Omit for a key that never expires.
Terminal window
curl -X POST https://api.chronary.ai/v1/keys \
-H "Authorization: Bearer chr_sk_your_org_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_a1b2c3d4",
"label": "Sales agent key",
"expires_in": "90d"
}'
{
"id": "key_abc123",
"key": "chr_ak_0123456789ABCDEF",
"key_prefix": "chr_ak_0A1B2C3D",
"agent_id": "agt_a1b2c3d4",
"label": "Sales agent key",
"created_at": "2026-04-17T16:20:00.000Z",
"last_used_at": null,
"last_used_user_agent": null,
"created_via": "api",
"created_by_key_prefix": "chr_sk_0A1B2C3D4E5F6",
"note": null,
"expires_at": "2026-07-16T16:20:00.000Z"
}

The raw key is returned only once. Store it immediately.

A retry with the same Idempotency-Key returns the stored 201 response, key included, once the first request has finished. A retry that arrives while the first request is still running, or after it failed partway, gets 409 idempotency_conflict: the message names the key that request created. Retry with the same key a moment later, or revoke that key and create a new one with a new Idempotency-Key.

StatusTypeCause
400validation_errorInvalid request body
403forbiddenAgent keys cannot manage Organization keys
403use_console_routeCalled from a signed-in console session
403plan_requiredYour plan doesn’t include Agent keys (feature: "scoped_keys")
404not_foundAgent not found
409scoped_keys_capThe plan’s Agent key limit is reached. Carries metric, limit, docs_url, and upgrade_url or contact_url
409agent_inactiveThe agent has been deleted. Create keys only for active or paused agents
409idempotency_conflictAn earlier request with this Idempotency-Key created the key and is still running or never finished. The message names the key
409idempotency_key_mismatchThis Idempotency-Key already created a key for another agent, or was used for a different request. Use a new Idempotency-Key

Console sessions manage keys in the Chronary console; use an organization API key for this endpoint. A console session gets 403 use_console_route.


A key created with expires_in stops working at its expires_at. After that, every request made with it returns 401 with the error type key_expired:

{
"error": {
"type": "key_expired",
"message": "This API key expired on 2026-07-16T16:20:00Z. Roll it or create a new key in the Chronary console.",
"request_id": "req_01H9X4M2P5R8T6V0"
}
}

Seven days before a key expires, Chronary emails the organization owner once. You can turn this email off under Settings → Notifications (key_expiry). An expiry can’t be changed after the key is created: create a new key and revoke the old one, or, for an Organization key, roll it in the console. A rolled key keeps its lifetime, so a 90-day key rolls into a new 90-day key.


GET /v1/keys

No query parameters are required.

Terminal window
curl https://api.chronary.ai/v1/keys \
-H "Authorization: Bearer chr_sk_your_org_key"
{
"keys": [
{
"id": "key_abc123",
"key_prefix": "chr_ak_0A1B2C3D",
"agent_id": "agt_a1b2c3d4",
"label": "Sales agent key",
"created_at": "2026-04-17T16:20:00.000Z",
"last_used_at": "2026-04-17T16:25:00.000Z",
"last_used_user_agent": "chronary-node/1.4.0",
"created_via": "api",
"created_by_key_prefix": "chr_sk_0A1B2C3D4E5F6",
"note": null,
"expires_at": "2026-07-16T16:20:00.000Z"
}
]
}

The raw secret value is not returned from list responses.

FieldDescription
last_used_atWhen the key last authenticated a request. Approximate: updated at most every 5 minutes. null if the key has never been used.
last_used_user_agentThe User-Agent of that request (first 256 characters), or null.
created_viaWhere the key was created: console, api (REST with an Organization key), mcp (the create_scoped_key tool), signup, or unknown for keys created before this was recorded.
created_by_key_prefixThe prefix of the Organization key that created the key, for api and mcp. Otherwise null.
noteA free-text note about the key, set in the console. null if none.
expires_atWhen the key stops working, set with expires_in at creation. null if the key never expires. An expired key stays in the list until you revoke it.
StatusTypeCause
403forbiddenAgent keys cannot manage Organization keys

DELETE /v1/keys/:id

Revokes the key immediately and returns 204 No Content.

Terminal window
curl -X DELETE https://api.chronary.ai/v1/keys/key_abc123 \
-H "Authorization: Bearer chr_sk_your_org_key"
StatusTypeCause
403forbiddenAgent keys cannot manage Organization keys
403use_console_routeCalled from a signed-in console session
404not_foundScoped key not found

Console sessions manage keys in the Chronary console; use an organization API key for this endpoint. A console session gets 403 use_console_route.