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.
Create an Agent key
Section titled “Create an Agent key”POST /v1/keysRequest body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | Target agent ID (agt_*) |
label | string | No | Optional label, 1-100 characters |
expires_in | string | No | When the key stops working, from now: 30d, 60d, 90d, 180d or 365d. Omit for a key that never expires. |
Example
Section titled “Example”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" }'chronary keys create \ --agent agt_a1b2c3d4 \ --label "Sales agent key" \ --expires-in 90dResponse 201 Created
Section titled “Response 201 Created”{ "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.
Errors
Section titled “Errors”| Status | Type | Cause |
|---|---|---|
400 | validation_error | Invalid request body |
403 | forbidden | Agent keys cannot manage Organization keys |
403 | use_console_route | Called from a signed-in console session |
403 | plan_required | Your plan doesn’t include Agent keys (feature: "scoped_keys") |
404 | not_found | Agent not found |
409 | scoped_keys_cap | The plan’s Agent key limit is reached. Carries metric, limit, docs_url, and upgrade_url or contact_url |
409 | agent_inactive | The agent has been deleted. Create keys only for active or paused agents |
409 | idempotency_conflict | An earlier request with this Idempotency-Key created the key and is still running or never finished. The message names the key |
409 | idempotency_key_mismatch | This 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.
Key expiry
Section titled “Key expiry”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.
List Agent keys
Section titled “List Agent keys”GET /v1/keysNo query parameters are required.
Example
Section titled “Example”curl https://api.chronary.ai/v1/keys \ -H "Authorization: Bearer chr_sk_your_org_key"chronary keys listResponse 200 OK
Section titled “Response 200 OK”{ "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.
| Field | Description |
|---|---|
last_used_at | When the key last authenticated a request. Approximate: updated at most every 5 minutes. null if the key has never been used. |
last_used_user_agent | The User-Agent of that request (first 256 characters), or null. |
created_via | Where 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_prefix | The prefix of the Organization key that created the key, for api and mcp. Otherwise null. |
note | A free-text note about the key, set in the console. null if none. |
expires_at | When 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. |
Errors
Section titled “Errors”| Status | Type | Cause |
|---|---|---|
403 | forbidden | Agent keys cannot manage Organization keys |
Revoke an Agent key
Section titled “Revoke an Agent key”DELETE /v1/keys/:idRevokes the key immediately and returns 204 No Content.
Example
Section titled “Example”curl -X DELETE https://api.chronary.ai/v1/keys/key_abc123 \ -H "Authorization: Bearer chr_sk_your_org_key"chronary keys delete key_abc123 --yesErrors
Section titled “Errors”| Status | Type | Cause |
|---|---|---|
403 | forbidden | Agent keys cannot manage Organization keys |
403 | use_console_route | Called from a signed-in console session |
404 | not_found | Scoped 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.