Skip to content

Calendars

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

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

POST /v1/calendars
POST /v1/agents/:agent_id/calendars
FieldTypeRequiredDefaultDescription
namestringYes1–255 characters
timezonestringYesIANA timezone (e.g., America/New_York)
agent_statusstringNoidleidle, working, waiting, or error. See Agent status.
default_remindersinteger[] | nullNoMinutes 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.
metadataobjectNoKey-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,
"ical_url": "https://api.chronary.ai/ical/abc123def456.ics"
}
StatusTypeCause
429quota_exceededCalendar limit reached on your plan

GET /v1/calendars
GET /v1/agents/:agent_id/calendars
ParameterTypeDefaultDescription
includestringSet to all to include agent-owned calendars (org-level endpoint only)
limitinteger501–200
offsetinteger0Pagination offset
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
}

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

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.

  • 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
timezonestringIANA timezone identifier
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.
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

DELETE /v1/calendars/:id

Returns 204 No Content. Deleting a calendar removes all its events.

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.