Calendars
A calendar belongs to one connected mailbox: the mailbox’s own primary calendar, or another calendar the mailbox can open at the provider, such as a shared team calendar. Carom imports calendar events only from calendars with sync turned on. Use this resource to see which calendars Carom knows about and to turn syncing on or off.
When Carom first finds a mailbox’s calendars, it turns sync on for the primary calendar and for calendars the mailbox owns, and leaves it off for the rest. After that, the setting changes only when someone changes it. Your key sees the calendars of every mailbox your key’s user can read: mailboxes they own, mailboxes whose view_policy or send_policy is everyone, and mailboxes whose grants include them.
#The calendar object
Returned by both calendar endpoints, and embedded in each calendar event under calendars.
Attributes
-
idstring · uuidUnique identifier for the calendar.
-
namestring · nullableThe calendar’s name at the provider. A primary calendar is often named after its email address.
-
descriptionstring · nullable -
access_rolestring · nullableThe mailbox’s level of access to the calendar at the provider.
freeBusyReaderoccurs only on Google calendars.ownerwriterreaderfreeBusyReader -
mailbox_idstring · uuid · nullableThe mailbox the calendar belongs to.
-
sync_enabledboolean · nullableWhether Carom imports events from this calendar. Change it with Update a calendar.
-
primaryboolean · nullableTrue for the mailbox’s primary calendar.
{
"id": "eaa47c21-17fa-456b-a381-db96b0191f5b",
"name": "dana@harborline.example",
"description": null,
"access_role": "owner",
"mailbox_id": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70",
"sync_enabled": true,
"primary": true
}
#List calendars
Without mailbox_id, returns the calendars visible to your key that have sync turned on. With mailbox_id, returns every visible calendar of that mailbox, synced or not, which is how you find calendars to turn on. Returns every calendar in one response; the list isn’t paginated.
Query parameters
-
mailbox_idstring · uuidOnly calendars of this mailbox, including those with sync turned off.
Returns
-
collectionobjectShow 2 child attributesHide child attributes
-
recordsarray of calendars -
total_resultsintegerThe number of calendars in
records.
-
Errors
- 400
invalid_requestmailbox_idis present but empty.
curl "https://api.carom.io/calendars?mailbox_id=d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70" \
-H "Authorization: Bearer $CAROM_API_KEY"
{
"collection": {
"records": [
{
"id": "eaa47c21-17fa-456b-a381-db96b0191f5b",
"name": "dana@harborline.example",
"description": null,
"access_role": "owner",
"mailbox_id": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70",
"sync_enabled": true,
"primary": true
},
{
"id": "6515d415-9385-4723-b9b0-4906618a5c85",
"name": "Harborline team events",
"description": "Offsites, all-hands, and holidays",
"access_role": "reader",
"mailbox_id": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70",
"sync_enabled": false,
"primary": false
}
],
"total_results": 2
}
}
#Update a calendar
Turns syncing on or off for one calendar. Turning it on starts an import right away.
Only the owner of the calendar’s mailbox can change it. Other keys that can see the calendar, including an account admin’s, get 403 permission_denied.
Path parameters
-
idstring · uuidrequired
Request body application/json
-
calendarobjectrequiredShow 1 child attributeHide child attributes
-
sync_enabledbooleantrueto import this calendar’s events,falseto stop.
-
Returns
The updated calendar object, wrapped in calendar.
Errors
- 400
invalid_requestThe body has nocalendarobject, orsync_enabledisn’t a boolean. - 403
permission_deniedThe calendar belongs to a mailbox your key’s user doesn’t own. - 404
record_not_foundNo calendar with that id is visible to your key.
curl -X PATCH https://api.carom.io/calendars/6515d415-9385-4723-b9b0-4906618a5c85 \
-H "Authorization: Bearer $CAROM_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "calendar": { "sync_enabled": true } }'
{
"calendar": {
"id": "6515d415-9385-4723-b9b0-4906618a5c85",
"name": "Harborline team events",
"description": "Offsites, all-hands, and holidays",
"access_role": "reader",
"mailbox_id": "d4e5f6a7-b8c9-4d0e-9f1a-2b3c4d5e6f70",
"sync_enabled": true,
"primary": false
}
}