Parse an ICS or CSV calendar into a preview
LogsPOST /calendar/imports
Parses an ICS or CSV calendar, sent inline in content or fetched from url (10 second timeout, 4 MB limit), and stores a preview that lists the days and rules it would add, change or remove, the conflicts with existing days, and the schedules the change may move. Nothing is written to the calendar unless auto_apply is true and the preview has no conflicts; otherwise apply it later with the apply endpoint. ICS input must use all-day events with optional yearly RRULEs; multi-day events, EXDATE and timed starts are rejected with 400. When source_id is given the source must exist and be enabled, and days or rules that the source previously supplied but no longer contains are reported as removals and conflicts. Requires automations:write.
Body application/json
formatone of
ics,csvcontenturlsource_idauto_apply
Returns
201 Import preview with added, changed, removed, conflicts, affected schedules and explicit coverage limitations
Show attributes
idtenant_idsource_idformatone of
ics,csvstatusone of
preview,applied,faileditemsShow child attributes
kinduiddatemonthdayweekdaypositioneaster_kindone of
western,orthodoxeaster_offsetobservedone of
none,next,previous,nearestvalid_fromvalid_toname_ptname_enkind_of_dayone of
holiday,closure,workingarea_idsource_ref
addedShow child attributes
kinduiddatemonthdayweekdaypositioneaster_kindone of
western,orthodoxeaster_offsetobservedone of
none,next,previous,nearestvalid_fromvalid_toname_ptname_enkind_of_dayone of
holiday,closure,workingarea_idsource_ref
changedShow child attributes
kinduiddatemonthdayweekdaypositioneaster_kindone of
western,orthodoxeaster_offsetobservedone of
none,next,previous,nearestvalid_fromvalid_toname_ptname_enkind_of_dayone of
holiday,closure,workingarea_idsource_ref
removedShow child attributes
kinduiddatemonthdayweekdaypositioneaster_kindone of
western,orthodoxeaster_offsetobservedone of
none,next,previous,nearestvalid_fromvalid_toname_ptname_enkind_of_dayone of
holiday,closure,workingarea_idsource_ref
conflictsShow child attributes
dateexisting_kindone of
holiday,closure,workingincoming_kindone of
holiday,closure,workingdetail
affectedShow child attributes
typeidnamefromtocount
affected_limitationsConsumer coverage gaps and date behaviors not recalculated by this preview.
confirmed_byoutcomecreated_atapplied_at
Permissions automations:write · Roles: admin, finance, operations, owner
curl -X POST "$BUSINESS_API/calendar/imports" \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"format": "ics",
"content": "content",
"url": "https://example.org/",
"source_id": "sou_2fjWEpPCsLRCQBV64hz26xd8MF9",
"auto_apply": true
}'
# No matching CLI command; use cURL or direct HTTP.
const res = await fetch("$BUSINESS_API/calendar/imports", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"format": "ics",
"content": "content",
"url": "https://example.org/",
"source_id": "sou_2fjWEpPCsLRCQBV64hz26xd8MF9",
"auto_apply": true
})
});
const data = await res.json();
import requests
res = requests.post(
"$BUSINESS_API/calendar/imports",
headers={
"Authorization": "Bearer sk_test_..."
},
json={
"format": "ics",
"content": "content",
"url": "https://example.org/",
"source_id": "sou_2fjWEpPCsLRCQBV64hz26xd8MF9",
"auto_apply": true
}
)
data = res.json()
body := strings.NewReader(`{
"format": "ics",
"content": "content",
"url": "https://example.org/",
"source_id": "sou_2fjWEpPCsLRCQBV64hz26xd8MF9",
"auto_apply": true
}`)
req, _ := http.NewRequest("POST", "$BUSINESS_API/calendar/imports", body)
req.Header.Set("Authorization", "Bearer sk_test_...")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
{
"id": "cal_26gTtQiVPucb3CyVJaoRD6UlbOQ",
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
"source_id": "sou_2fjWEpPCsLRCQBV64hz26xd8MF9",
"format": "ics",
"status": "preview",
"items": [
{
"kind": "active",
"uid": "uid",
"date": "2026-11-19",
"month": 1,
"day": 1,
"weekday": 1,
"position": 1,
"easter_kind": "western",
"easter_offset": 1,
"observed": "none",
"valid_from": "2026-11-19",
"valid_to": "2026-11-19",
"name_pt": "name pt",
"name_en": "name en",
"kind_of_day": "holiday",
"area_id": "are_2ZTQYjrK63ZImD3sMz1O2BhWeZV",
"source_ref": "source ref"
}
],
"added": [
{
"kind": "active",
"uid": "uid",
"date": "2026-11-19",
"month": 1,
"day": 1,
"weekday": 1,
"position": 1,
"easter_kind": "western",
"easter_offset": 1,
"observed": "none",
"valid_from": "2026-11-19",
"valid_to": "2026-11-19",
"name_pt": "name pt",
"name_en": "name en",
"kind_of_day": "holiday",
"area_id": "are_2ZTQYjrK63ZImD3sMz1O2BhWeZV",
"source_ref": "source ref"
}
],
"changed": [
{
"kind": "active",
"uid": "uid",
"date": "2026-11-19",
"month": 1,
"day": 1,
"weekday": 1,
"position": 1,
"easter_kind": "western",
"easter_offset": 1,
"observed": "none",
"valid_from": "2026-11-19",
"valid_to": "2026-11-19",
"name_pt": "name pt",
"name_en": "name en",
"kind_of_day": "holiday",
"area_id": "are_2ZTQYjrK63ZImD3sMz1O2BhWeZV",
"source_ref": "source ref"
}
],
"removed": [
{
"kind": "active",
"uid": "uid",
"date": "2026-11-19",
"month": 1,
"day": 1,
"weekday": 1,
"position": 1,
"easter_kind": "western",
"easter_offset": 1,
"observed": "none",
"valid_from": "2026-11-19",
"valid_to": "2026-11-19",
"name_pt": "name pt",
"name_en": "name en",
"kind_of_day": "holiday",
"area_id": "are_2ZTQYjrK63ZImD3sMz1O2BhWeZV",
"source_ref": "source ref"
}
],
"conflicts": [
{
"date": "2026-11-19",
"existing_kind": "holiday",
"incoming_kind": "holiday",
"detail": "detail"
}
],
"affected": [
{
"type": "active",
"id": "cal_26gTtQiVPucb3CyVJaoRD6UlbOQ",
"name": "Ana Matsinhe",
"from": "2026-11-19T09:30:00Z",
"to": "2026-11-19T09:30:00Z",
"count": 1
}
],
"affected_limitations": [
"affected limitation"
],
"confirmed_by": "confirmed by",
"outcome": "outcome",
"created_at": "2026-11-19T09:30:00Z",
"applied_at": "2026-11-19T09:30:00Z"
}