Skip to content

Calendars API

Calendars contain events and generate iCal feed URLs. They can be org-level (shared) or owned by a specific agent.

The API normalizes a name before it stores it: invisible format characters (zero-width spaces, word joiners, bidi controls, soft hyphens) are removed, while zero-width joiners and non-joiners are kept because emoji sequences, Persian and Indic scripts need them, then Unicode NFC is applied, every run of whitespace (spaces, tabs, newlines, non-breaking spaces) is replaced by one space, and the ends are trimmed. " Front\u00A0office\n" is stored as "Front office". The length limit applies to the normalized name. A name with no visible character (whitespace only, only zero-width joiners, or only blank characters such as the braille blank), or one that contains a control character, returns 400 validation_error. Names stored before this rule are returned as they were stored.

Create an org-level calendar or an agent-owned calendar:

POST /v1/calendars
POST /v1/agents/:agent_id/calendars
FieldTypeRequiredDefaultDescription
namestringYes—1–255 characters, after normalizing (see Names)
timezonestringYes—IANA timezone (e.g., America/New_York). It must be a time zone name the API accepts (an IANA name such as America/New_York, or a UTC offset like +05:00); anything else (America/New York, GMT+5) returns 400 validation_error
agent_statusstringNoidleidle, working, waiting, or error. See Agent status.
default_remindersinteger[] | nullNo—Minutes before start_time that events in this calendar inherit when they don’t set their own reminders. Max 5 entries, each 1–40320 (28 days). See Reminder defaults.
prevent_overlapsbooleanNofalsetrue: the calendar refuses any event that would overlap an active event on it. See Double-booking guarantee.
metadataobjectNo—Key-value pairs, max 16KB JSON
Terminal window
curl -X POST https://api.chronary.ai/v1/agents/agt_a1b2c3d4/calendars \
-H "Authorization: Bearer chr_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Sales Meetings",
"timezone": "America/New_York",
"agent_status": "idle"
}'
{
"id": "cal_01H9X4M2P5R8T6V0",
"orgId": "org_01H9X4M2P5R8T6V0",
"agentId": "agt_01H9X4M2P5R8T6V0",
"name": "Sales Meetings",
"timezone": "America/New_York",
"metadata": {},
"externalId": null,
"provider": null,
"deletedAt": null,
"createdAt": "2026-04-04T12:00:00Z",
"updatedAt": "2026-04-04T12:00:00Z",
"agent_status": "idle",
"default_reminders": null,
"prevent_overlaps": false,
"ical_url": "https://api.chronary.ai/ical/abc123def456.ics"
}
StatusTypeCause
400validation_errortimezone is not a time zone name the API accepts
404not_foundAgent not found (POST /v1/agents/:agent_id/calendars)
409agent_inactiveThe agent is decommissioned. Restore it before adding calendars
429quota_exceededCalendar limit reached on your plan

Your calendar count for the plan limit includes org-level calendars and the calendars of active or paused agents. Calendars of a decommissioned agent are kept but don’t count; they count again if you restore the agent.


GET /v1/calendars
GET /v1/agents/:agent_id/calendars
ParameterTypeDefaultDescription
includestring—Set to all to include agent-owned calendars (org-level endpoint only)
qstring—Search: a case-insensitive substring of the calendar name, or an exact calendar ID (1–100 characters). Normalized like a stored name before matching, so a double space, a non-breaking space or an invisible character in q still finds the name
cursorstring—The next_cursor from the previous page. Cannot be combined with a non-zero offset
limitinteger501–200
offsetinteger0Pagination offset, at most 10,000

GET /v1/calendars and GET /v1/agents/:agent_id/calendars return calendars newest first and include next_cursor in the response; pass it as cursor to fetch the next page. total always counts every match. An Agent key lists only its own agent’s calendars. GET /v1/agents/:agent_id/calendars returns 404 not_found when the agent doesn’t exist or belongs to another organization; an agent with no calendars returns an empty list.

Terminal window
# List all org calendars including agent-owned
curl "https://api.chronary.ai/v1/calendars?include=all" \
-H "Authorization: Bearer chr_sk_your_key_here"
# List calendars for a specific agent
curl "https://api.chronary.ai/v1/agents/agt_a1b2c3d4/calendars" \
-H "Authorization: Bearer chr_sk_your_key_here"
{
"data": [
{
"id": "cal_x1y2z3",
"name": "Sales Meetings",
"timezone": "America/New_York",
"ical_url": "https://api.chronary.ai/ical/abc123def456.ics",
...
}
],
"total": 5,
"limit": 50,
"offset": 0,
"next_cursor": null
}

GET /v1/calendars/:id
Terminal window
curl https://api.chronary.ai/v1/calendars/cal_x1y2z3 \
-H "Authorization: Bearer chr_sk_your_key_here"
StatusTypeCause
404not_foundCalendar not found

POST /v1/calendars/:id/ical-token/rotate

Replaces the secret token in the calendar’s iCal subscribe URL and returns the calendar with its new ical_url. Use it when a subscribe URL has been shared too widely. The old URL stops working at once, although copies of the feed cached in other locations can still be served from it for up to 5 minutes. Calendar apps subscribed to the old URL must be re-subscribed with the new one.

Requires an Organization key or a console session. In the console you are asked to confirm your password first if you signed in more than 5 minutes ago. No webhook event is sent; the action is recorded in the audit log.

Terminal window
curl -X POST https://api.chronary.ai/v1/calendars/cal_x1y2z3/ical-token/rotate \
-H "Authorization: Bearer chr_sk_your_key_here"
StatusTypeCause
401reauth_requiredConsole session older than 5 minutes; re-authenticate and retry
403forbiddenAgent keys cannot regenerate subscribe URLs
404not_foundCalendar not found

GET /v1/calendars/:id/context

Returns a “what’s happening now” snapshot for a calendar: the currently active event, the next upcoming event, recently ended events, and everything starting in the next 24 hours. Designed for agents that want a single cheap call to orient themselves before planning or responding.

Recurring series are expanded into their occurrences, the same way expand=true lists them: each occurrence carries recurringEventId and originalStartTime, and shares its series’ id. Occurrences that ended in the last 30 days can appear in recent_events, and a series’ next occurrence is looked for up to 366 days ahead (a series that next recurs later than that, such as one every two years, shows no next_event from that series). When events overlap, current_event is the one that started most recently, for example a meeting inside a longer working-hours block.

  • An agent starting a turn reads context to decide whether it’s free, in a meeting, or about to start one.
  • A status dashboard or MCP client surfaces a compact “right now” summary without paginating events.
  • A planner looks at upcoming (next 24h) to decide whether to schedule new work immediately or defer it.
Terminal window
curl https://api.chronary.ai/v1/calendars/cal_01H9X4M2P5R8T6V0/context \
-H "Authorization: Bearer chr_sk_your_key_here"
FieldTypeDescription
calendar_idstringThe calendar this snapshot is for
nowstring (datetime)Server-side timestamp the snapshot was computed at
agent_statusstringThe calendar’s current agent_status (see below)
current_eventobject | nullThe event whose window contains now, or null if none
next_eventobject | nullThe next event starting strictly after now, or null
recent_eventsarrayUp to 3 most recently ended events, newest first
upcomingarrayUp to 5 events starting within the next 24 hours, earliest first

Cancelled and soft-deleted events are excluded from all four event lists.

{
"calendar_id": "cal_01H9X4M2P5R8T6V0",
"now": "2026-04-16T14:05:00.000Z",
"agent_status": "working",
"current_event": {
"id": "evt_01H9X4M2P5R8T6V0",
"calendarId": "cal_01H9X4M2P5R8T6V0",
"title": "Strategy sync with Acme Corp",
"startTime": "2026-04-16T14:00:00.000Z",
"endTime": "2026-04-16T14:30:00.000Z",
"status": "confirmed",
"source": "internal",
"metadata": {},
"createdAt": "2026-04-10T12:00:00.000Z",
"updatedAt": "2026-04-10T12:00:00.000Z"
},
"next_event": { "...": "..." },
"recent_events": [ { "...": "..." } ],
"upcoming": [ { "...": "..." } ]
}
StatusTypeCause
404not_foundCalendar not found

PATCH /v1/calendars/:id
FieldTypeDescription
namestring1–255 characters, after normalizing (see Names)
timezonestringA time zone name the API accepts (an IANA name such as America/New_York, or a UTC offset like +05:00); anything else returns 400 validation_error
agent_statusstringidle, working, waiting, or error. See Agent status.
default_remindersinteger[] | nullReplaces the calendar’s reminder defaults. Set to null to clear. See Reminder defaults.
prevent_overlapsbooleantrue turns the double-booking guarantee on, false turns it off. Turning it on is refused while the calendar holds overlapping active events that have not ended yet, or a running recurring series
metadataobjectReplaces existing metadata

At least one field must be provided.

Terminal window
curl -X PATCH https://api.chronary.ai/v1/calendars/cal_x1y2z3 \
-H "Authorization: Bearer chr_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "name": "Sales Meetings (Q2)" }'
StatusTypeCause
404not_foundCalendar not found
409conflict (code: calendar_has_overlaps)prevent_overlaps: true was refused: active events on the calendar that have not ended yet overlap. They are listed in conflicting_event_ids (up to 50)
409conflict (code: calendar_has_recurring_series)prevent_overlaps: true was refused: the calendar has a running recurring series, listed in conflicting_event_ids (up to 25)
409agent_inactiveThe calendar belongs to a decommissioned agent and is read-only

DELETE /v1/calendars/:id

Returns 204 No Content. Deleting a calendar removes all its events and its booking pages: their public links answer 404, they leave GET /v1/booking-pages, and they no longer count toward your plan’s booking-page limit. This works on a decommissioned agent’s read-only calendar too.

Terminal window
curl -X DELETE https://api.chronary.ai/v1/calendars/cal_x1y2z3 \
-H "Authorization: Bearer chr_sk_your_key_here"
StatusTypeCause
404not_foundCalendar not found

Every calendar carries an agent_status field that lets an agent advertise its current operational state to anyone reading the calendar (other agents, dashboards, humans subscribed to the iCal feed). It defaults to idle on create and can be changed at any time via PATCH /v1/calendars/:id. It is also surfaced on GET /v1/calendars/:id/context so callers can read state and upcoming work in one request.

ValueMeaning
idleThe agent is running but has no active work. Available to take on new tasks.
workingThe agent is actively processing a task — e.g. running a tool, making API calls, or writing to a calendar.
waitingThe agent is blocked on external input — awaiting a human reply, a webhook, or a dependent job.
errorThe agent has hit an unrecoverable failure and is not making progress. Operators should intervene.

The field is free-form on the server — no transitions are enforced — so agents pick whichever value best describes their state. See the Advertising agent state pattern for a full example.


default_reminders is an array of integers — minutes before an event’s start_time — that every event in the calendar inherits when it doesn’t set its own reminders. For example, [10, 1440] reminds 10 minutes and 1 day before. Up to 5 entries, each 1–40320 (28 days).

Resolution for any given event is: the event’s own reminders → the calendar’s default_reminders → the system default of [10]. A null value at either level means “inherit”; an empty array [] means “explicitly no reminders”. See Reminders on events for the full precedence rules and delivery behavior.


A calendar with prevent_overlaps: true refuses any write that would leave two active events overlapping on it. Active means status confirmed, tentative or hold; a hold past its hold_expires_at never blocks. Times are half-open, so back-to-back events are allowed. The check covers creating an event, moving one, setting a cancelled event back to confirmed or tentative, and confirming a hold, and it holds when many requests race for the same slot: exactly one succeeds.

A refused write returns 409 with type: "conflict", code: "event_conflict" and up to 10 conflicting_event_ids; a new hold that collides only with live holds of equal or higher priority gets the usual hold answer (409 conflict, no code). A recurring series cannot be created on such a calendar (code: "recurring_on_protected_calendar"). Imported iCal events and connected-calendar busy time are not covered, and the guarantee is per calendar. It is off by default and available on every plan. See the guide for the full list of what is and isn’t guaranteed.