Skip to content

Calendars

Calendars are the core container for events in Chronary. There are two kinds:

  • Agent-owned calendars belong to a specific agent (e.g., “Dr. Chen’s Patient Appointments”).
  • Org-level calendars are shared across your organization (e.g., “Conference Room B” or “Company Holidays”).

By the end of this guide you will be able to create both types of calendars, list and retrieve them, update their properties, and delete them when no longer needed.

  • A Chronary account with an API key
  • At least one agent created (see the quickstart)

Org-level calendars are not tied to any agent. Use them for shared resources like meeting rooms or company-wide schedules.

Terminal window
curl -X POST https://api.chronary.ai/v1/calendars \
-H "Authorization: Bearer chr_sk_test_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Conference Room B — 4th Floor",
"timezone": "America/Chicago",
"metadata": {
"capacity": 12,
"building": "HQ",
"floor": 4,
"amenities": ["projector", "whiteboard", "video_conferencing"]
}
}'

Agent-owned calendars belong to a specific agent. Most agents have one calendar, but you can create multiple (e.g., separate calendars for “Client Meetings” and “Internal Syncs”).

Terminal window
curl -X POST https://api.chronary.ai/v1/agents/agt_a1b2c3d4/calendars \
-H "Authorization: Bearer chr_sk_test_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Dr. Chen — Patient Appointments",
"timezone": "America/New_York"
}'

List org-level calendars or all calendars belonging to a specific agent.

Terminal window
# Org-level calendars
curl https://api.chronary.ai/v1/calendars \
-H "Authorization: Bearer chr_sk_test_your_key_here"
# Agent-owned calendars
curl https://api.chronary.ai/v1/agents/agt_a1b2c3d4/calendars \
-H "Authorization: Bearer chr_sk_test_your_key_here"

Retrieve full details for a calendar by ID. The response includes the ical_url you can use to subscribe from any calendar app.

Terminal window
curl https://api.chronary.ai/v1/calendars/cal_x1y2z3 \
-H "Authorization: Bearer chr_sk_test_your_key_here"

Example response:

{
"id": "cal_x1y2z3",
"name": "Dr. Chen — Patient Appointments",
"timezone": "America/New_York",
"agent_id": "agt_a1b2c3d4",
"ical_url": "https://api.chronary.ai/ical/abc123.ics",
"metadata": {},
"created_at": "2026-04-04T10:00:00Z",
"updated_at": "2026-04-04T10:00:00Z"
}

Change the name, timezone, or metadata of an existing calendar. Only the fields you include are updated.

Terminal window
curl -X PATCH https://api.chronary.ai/v1/calendars/cal_x1y2z3 \
-H "Authorization: Bearer chr_sk_test_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Dr. Chen — All Appointments",
"metadata": {
"department": "cardiology",
"location": "Building A, Suite 200"
}
}'

Deleting a calendar permanently removes it and all of its events. This action cannot be undone.

Terminal window
curl -X DELETE https://api.chronary.ai/v1/calendars/cal_x1y2z3 \
-H "Authorization: Bearer chr_sk_test_your_key_here"

Every calendar has a metadata field that accepts any valid JSON object up to 16 KB. Use it to store application-specific data like room capacity, department codes, or external system IDs.

{
"metadata": {
"salesforce_id": "001ABC",
"department": "engineering",
"color": "#4A90D9"
}
}

The timezone field must be a valid IANA timezone identifier such as America/New_York, Europe/London, or Asia/Tokyo. The timezone is used when generating iCal feeds and computing availability.

Every calendar response includes an ical_url field. This is a live feed that can be subscribed to from Google Calendar, Apple Calendar, Outlook, or any other app that supports iCal. See the iCal feeds guide for details on subscribing.

StatusCodeCause
400invalid_timezoneThe timezone value is not a valid IANA identifier
400metadata_too_largeThe metadata object exceeds 16 KB
404agent_not_foundThe agent_id in the URL does not exist
404calendar_not_foundThe calendar ID does not exist or does not belong to your organization
409calendar_has_eventsAttempted to delete a calendar that still has events (delete events first)