iCal Subscriptions
iCal subscriptions let you import events from external calendars (Google Calendar, Outlook, etc.) into Chronary. This means your agents’ availability queries can account for events from human calendars, so agents can avoid scheduling over them.
How it works
Section titled “How it works”- You provide a public or authenticated
.icsfeed URL from an external calendar - Chronary periodically syncs events from that feed into a target calendar
- Imported events appear alongside native events and block availability
- Imported events are read-only — they can’t be edited or deleted via the API
Create a subscription
Section titled “Create a subscription”curl -X POST https://api.chronary.ai/v1/agents/agt_a1b2c3d4/ical-subscriptions \ -H "Authorization: Bearer chr_sk_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "calendar_id": "cal_x1y2z3", "url": "https://calendar.google.com/calendar/ical/user%40gmail.com/basic.ics", "label": "Alex'\''s Google Calendar" }'const response = await fetch( 'https://api.chronary.ai/v1/agents/agt_a1b2c3d4/ical-subscriptions', { method: 'POST', headers: { 'Authorization': 'Bearer chr_sk_your_key_here', 'Content-Type': 'application/json', }, body: JSON.stringify({ calendar_id: 'cal_x1y2z3', url: 'https://calendar.google.com/calendar/ical/user%40gmail.com/basic.ics', label: "Alex's Google Calendar", }), });const subscription = await response.json();console.log(subscription.id); // "ics_a1b2c3"from chronary import Chronary
client = Chronary()
subscription = client.ical_subscriptions.create( agent_id="agt_a1b2c3d4", calendar_id="cal_x1y2z3", url="https://calendar.google.com/calendar/ical/user%40gmail.com/basic.ics", label="Alex's Google Calendar",)print(subscription.id) # "ics_a1b2c3"Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
calendar_id | string | Yes | Target calendar to import events into |
url | string | Yes | HTTPS URL of the .ics feed |
label | string | No | Human-readable label (1–255 characters) |
List subscriptions
Section titled “List subscriptions”curl "https://api.chronary.ai/v1/agents/agt_a1b2c3d4/ical-subscriptions?status=active" \ -H "Authorization: Bearer chr_sk_your_key_here"Filter by status: active, error, or paused.
Get a subscription
Section titled “Get a subscription”curl https://api.chronary.ai/v1/ical-subscriptions/ics_a1b2c3 \ -H "Authorization: Bearer chr_sk_your_key_here"Update a subscription
Section titled “Update a subscription”Change the label or URL:
curl -X PATCH https://api.chronary.ai/v1/ical-subscriptions/ics_a1b2c3 \ -H "Authorization: Bearer chr_sk_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "label": "Alex'\''s Work Calendar" }'Trigger a manual sync
Section titled “Trigger a manual sync”Force an immediate sync instead of waiting for the next scheduled cycle:
curl -X POST https://api.chronary.ai/v1/ical-subscriptions/ics_a1b2c3/sync \ -H "Authorization: Bearer chr_sk_your_key_here"Returns 202 Accepted — the sync runs asynchronously.
Delete a subscription
Section titled “Delete a subscription”curl -X DELETE https://api.chronary.ai/v1/ical-subscriptions/ics_a1b2c3 \ -H "Authorization: Bearer chr_sk_your_key_here"Returns 204 No Content. Previously imported events remain in the calendar.
Subscription statuses
Section titled “Subscription statuses”| Status | Meaning |
|---|---|
active | Syncing normally |
error | Last sync failed (URL unreachable, invalid iCal, etc.) |
paused | Manually paused |
Getting external calendar URLs
Section titled “Getting external calendar URLs”Google Calendar: Settings > Calendar > “Secret address in iCal format”
Outlook/Office 365: Calendar settings > Shared calendars > Publish a calendar > ICS link
Apple iCloud: Calendar sharing > Public Calendar > copy the URL
Imported events
Section titled “Imported events”Events imported via iCal subscriptions:
- Have
source: "external_ical"in the event data - Are read-only — update/delete returns
403 Forbidden - Block availability just like native events
- Are updated on each sync cycle (changed events are updated, deleted events are removed)
Time zones
Section titled “Time zones”Times in the feed are converted to UTC using the zone the feed declares:
- A
TZIDon a time (for exampleDTSTART;TZID=America/New_York:20261120T090000) is honoured. Both standard zone names (America/New_York) and Windows zone names (Pacific Standard Time) are recognised, including across daylight-saving changes. - A time with no
TZIDand no trailingZ(a “floating” time) is read in the feed’sX-WR-TIMEZONEwhen the feed sets one, else in the subscribing calendar’stimezone(see below), else as UTC. - A zone name the feed defines only in its own
VTIMEZONEblock (for example Outlook’s “Customized Time Zone”) is matched to the standard zone with the same offsets. - A
TZIDzone name that isn’t recognised is read as UTC. AnX-WR-TIMEZONEthat isn’t recognised counts as no zone (see below). - An all-day event (
DTSTART;VALUE=DATE) blocks that day in the feed’s time zone, from local midnight to local midnight, so an all-day out-of-office in Sydney blocks the Sydney day. The zone is the date’s ownTZID, else the feed’sX-WR-TIMEZONE, else the feed’sVTIMEZONEwhen it has exactly one (Outlook feeds), else the subscribing calendar’stimezone, else UTC. A Chronary calendar’s own feed is the exception: its all-day events are whole UTC days, so they are imported as the same UTC days. - An all-day event in a zone other than UTC is imported as a timed busy block (
allDay: false) from local midnight to local midnight.allDay: truealways means whole UTC days, so the event never shows on the wrong date. An all-day event read in UTC is imported withallDay: true, as before.
Each event’s own DTSTART and DTEND (or DURATION) are read.
Feeds that declare no time zone
Section titled “Feeds that declare no time zone”Some feeds name no zone at all: no X-WR-TIMEZONE, no single VTIMEZONE and no TZID (for example, some CalDAV exports, or an Outlook feed with only all-day events). Their all-day dates and floating times are read in the timezone of the Chronary calendar the feed is subscribed into. A calendar in UTC (the default) reads them as UTC, as before. An X-WR-TIMEZONE or single VTIMEZONE that isn’t recognised counts as no zone here.
That zone is the subscriber’s, not necessarily the feed owner’s. If you subscribe to a colleague’s feed from a calendar in another zone, set the subscribing calendar’s timezone to the feed owner’s zone, or ask the publisher to add X-WR-TIMEZONE. Changing a calendar’s timezone (PATCH /v1/calendars/{id}) re-reads its feeds on their next sync (within 15 minutes, or right away with a manual sync). Chronary’s own feeds are recognised and keep whole UTC days for their all-day events, so they are not affected.
Recurring events
Section titled “Recurring events”A recurring event (RRULE, RDATE) is imported as one busy block per occurrence, from 30 days back to at least 180 days ahead. The window moves forward every week. Cancelled occurrences (EXDATE) are left out, and a moved occurrence (RECURRENCE-ID) is imported at its new time. A repeat pattern Chronary can’t expand (for example, hourly) imports its first occurrence only.
Free and cancelled events
Section titled “Free and cancelled events”Events marked free (TRANSP:TRANSPARENT, or Outlook’s “Show as: Free”) and cancelled events (STATUS:CANCELLED) don’t block time, so they aren’t imported. Tentative events are imported as busy.