Calendar sync and iCal feed
Generated at build time from packages/core/src/operations/calendar.ts. Every operation below isPOST /v1/ops/{name} over HTTP, env.API.invoke(actor, name, input) over RPC, and, when staff may call it, an MCP tool. See the API overview for authentication and errors.
calendar.sync_state
Get Google Calendar sync state
How the CRM's tasks and appointments stand against Google Calendar: how many are synced, pending a push, or in error, when the last sync ran, and whether a direct Google connection is configured. Without a direct connection, sync is done through Claude's Google Calendar connector using calendar.pending and calendar.record_sync.
Input (object)
| Field | Type | Description |
|---|---|---|
assignedToUserId | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
staterequired | "not_synced" | "pending" | "synced" | "error" | |
connectedrequired | boolean | True when the server holds Google Calendar credentials and syncs on its own |
syncedCountrequired | integer | min -9007199254740991, max 9007199254740991 |
pendingCountrequired | integer | min -9007199254740991, max 9007199254740991 |
errorCountrequired | integer | min -9007199254740991, max 9007199254740991 |
lastSyncedAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
errorsrequired | object[] | |
taskIdrequired | string | Record id (UUID)min length 1, max length 64 |
titlerequired | string | |
errorrequired | string |
Example request
curl https://api.cemco.app/v1/ops/calendar.sync_state \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"assignedToUserId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"state": {
"type": "string",
"enum": [
"not_synced",
"pending",
"synced",
"error"
]
},
"connected": {
"type": "boolean",
"description": "True when the server holds Google Calendar credentials and syncs on its own"
},
"syncedCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"pendingCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"errorCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"lastSyncedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
]
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"taskId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"title": {
"type": "string"
},
"error": {
"type": "string"
}
},
"required": [
"taskId",
"title",
"error"
],
"additionalProperties": false
}
}
},
"required": [
"state",
"connected",
"syncedCount",
"pendingCount",
"errorCount",
"lastSyncedAt",
"errors"
],
"additionalProperties": false
}
}
calendar.pending
List tasks waiting to sync to Google Calendar
Tasks and appointments that were created, changed, completed or deleted since they were last pushed to Google Calendar. For each one, action says what to do in Google Calendar (create, update or delete the event). After doing it, call calendar.record_sync with the Google event id.
Input (object)
| Field | Type | Description |
|---|---|---|
assignedToUserId | string | Record id (UUID)min length 1, max length 64 |
limit | integer | default 50, min 1, max 200 |
Output (object)
| Field | Type | Description |
|---|---|---|
itemsrequired | object[] | |
actionrequired | "create" | "update" | "delete" | |
taskIdrequired | string | Record id (UUID)min length 1, max length 64 |
googleEventIdrequired | string | null | |
taskrequired | object | null | Null when the task was deleted |
idrequired | string | Record id (UUID)min length 1, max length 64 |
typerequired | "task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in" | |
titlerequired | string | |
notesrequired | string | null | |
statusrequired | "open" | "done" | "cancelled" | |
dueOnrequired | string (date) | Day the task is due or the appointment happens |
startsAtrequired | string (date-time) | null | Start time for timed appointments; null for all-day items |
endsAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
locationrequired | string | null | |
assignedToUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
assignedToNamerequired | string | null | |
accountIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
accountNamerequired | string | null | |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
siteIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
checkInIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
isOverduerequired | boolean | Open and due before today |
googleEventIdrequired | string | null | |
syncStaterequired | "not_synced" | "pending" | "synced" | "error" | |
syncedAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
syncErrorrequired | string | null | |
completedAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
eventrequired | object | null | Ready-made Google Calendar event fields |
summaryrequired | string | |
descriptionrequired | string | |
locationrequired | string | null | |
allDayrequired | boolean | |
startrequired | string | Date (all-day) or UTC timestamp |
endrequired | string |
Example request
curl https://api.cemco.app/v1/ops/calendar.pending \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"assignedToUserId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"limit": {
"default": 50,
"type": "integer",
"minimum": 1,
"maximum": 200
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"action": {
"type": "string",
"enum": [
"create",
"update",
"delete"
]
},
"taskId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"googleEventId": {
"type": [
"string",
"null"
]
},
"task": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"type": {
"type": "string",
"enum": [
"task",
"call",
"visit",
"delivery",
"commissioning",
"service",
"check_in"
]
},
"title": {
"type": "string"
},
"notes": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"open",
"done",
"cancelled"
]
},
"dueOn": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Day the task is due or the appointment happens"
},
"startsAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
],
"description": "Start time for timed appointments; null for all-day items"
},
"endsAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
]
},
"location": {
"type": [
"string",
"null"
]
},
"assignedToUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"assignedToName": {
"type": [
"string",
"null"
]
},
"accountId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"accountName": {
"type": [
"string",
"null"
]
},
"contactId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"orderId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"machineId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"ticketId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"checkInId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"isOverdue": {
"type": "boolean",
"description": "Open and due before today"
},
"googleEventId": {
"type": [
"string",
"null"
]
},
"syncState": {
"type": "string",
"enum": [
"not_synced",
"pending",
"synced",
"error"
]
},
"syncedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
]
},
"syncError": {
"type": [
"string",
"null"
]
},
"completedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
}
},
"required": [
"id",
"type",
"title",
"notes",
"status",
"dueOn",
"startsAt",
"endsAt",
"location",
"assignedToUserId",
"assignedToName",
"accountId",
"accountName",
"contactId",
"orderId",
"machineId",
"ticketId",
"siteId",
"checkInId",
"isOverdue",
"googleEventId",
"syncState",
"syncedAt",
"syncError",
"completedAt",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "Null when the task was deleted"
},
"event": {
"anyOf": [
{
"type": "object",
"properties": {
"summary": {
"type": "string"
},
"description": {
"type": "string"
},
"location": {
"type": [
"string",
"null"
]
},
"allDay": {
"type": "boolean"
},
"start": {
"type": "string",
"description": "Date (all-day) or UTC timestamp"
},
"end": {
"type": "string"
}
},
"required": [
"summary",
"description",
"location",
"allDay",
"start",
"end"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "Ready-made Google Calendar event fields"
}
},
"required": [
"action",
"taskId",
"googleEventId",
"task",
"event"
],
"additionalProperties": false
}
}
},
"required": [
"items"
],
"additionalProperties": false
}
}
calendar.record_sync
Record a Google Calendar sync result
After creating, updating or deleting a Google Calendar event for a task, record the outcome: the Google event id on success, or an error message. Marks the task synced (or error).
Input (object)
| Field | Type | Description |
|---|---|---|
resultsrequired | object[] | at least 1 |
taskIdrequired | string | Record id (UUID)min length 1, max length 64 |
googleEventId | string | null | The event created or updated; with deleted, the event that was removed (as calendar.pending gave it)max length 300 |
googleCalendarId | string | null | max length 300 |
deleted | boolean | The Google event was removed. Give its googleEventId too.default false |
error | string | null | max length 1000 |
Output (object)
| Field | Type | Description |
|---|---|---|
syncedrequired | integer | min -9007199254740991, max 9007199254740991 |
errorsrequired | integer | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/calendar.record_sync \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"results":[{"taskId":"00000000-0000-4000-8000-000000000000"}]}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"results": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"taskId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"googleEventId": {
"description": "The event created or updated; with deleted, the event that was removed (as calendar.pending gave it)",
"anyOf": [
{
"type": "string",
"maxLength": 300
},
{
"type": "null"
}
]
},
"googleCalendarId": {
"anyOf": [
{
"type": "string",
"maxLength": 300
},
{
"type": "null"
}
]
},
"deleted": {
"default": false,
"description": "The Google event was removed. Give its googleEventId too.",
"type": "boolean"
},
"error": {
"anyOf": [
{
"type": "string",
"maxLength": 1000
},
{
"type": "null"
}
]
}
},
"required": [
"taskId"
]
}
}
},
"required": [
"results"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"synced": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"errors": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"synced",
"errors"
],
"additionalProperties": false
}
}
calendar.import_events
Bring Google Calendar changes into the CRM
The inbound half of two-way sync. Give events read from Google Calendar; events already linked to a task (by Google event id) update that task's title, date, time and location, cancelled events cancel the task, and events not yet linked become new tasks when createMissing is true.
Input (object)
| Field | Type | Description |
|---|---|---|
eventsrequired | object[] | at least 1, at most 500 |
googleEventIdrequired | string | min length 1, max length 300 |
googleCalendarId | string | null | max length 300 |
summaryrequired | string | max length 300 |
description | string | null | max length 20000 |
location | string | null | max length 500 |
startDaterequired | string (date) | Day of the event |
startsAt | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
endsAt | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
cancelled | boolean | default false |
updatedAt | string (date-time) | UTC timestamp, ISO 8601 with Z |
createMissing | boolean | default false |
defaultType | "task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in" | default "visit" |
assignedToUserId | string | Owner for new tasks; defaults to the callermin length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
createdrequired | integer | min -9007199254740991, max 9007199254740991 |
updatedrequired | integer | min -9007199254740991, max 9007199254740991 |
cancelledrequired | integer | min -9007199254740991, max 9007199254740991 |
unchangedrequired | integer | min -9007199254740991, max 9007199254740991 |
taskIdsrequired | string[] |
Example request
curl https://api.cemco.app/v1/ops/calendar.import_events \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"events":[{"googleEventId":"00000000-0000-4000-8000-000000000000","summary":"example","startDate":"2026-12-06"}]}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"events": {
"minItems": 1,
"maxItems": 500,
"type": "array",
"items": {
"type": "object",
"properties": {
"googleEventId": {
"type": "string",
"minLength": 1,
"maxLength": 300
},
"googleCalendarId": {
"anyOf": [
{
"type": "string",
"maxLength": 300
},
{
"type": "null"
}
]
},
"summary": {
"type": "string",
"maxLength": 300
},
"description": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
},
"location": {
"anyOf": [
{
"type": "string",
"maxLength": 500
},
{
"type": "null"
}
]
},
"startDate": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Day of the event"
},
"startsAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
]
},
"endsAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
]
},
"cancelled": {
"default": false,
"type": "boolean"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
}
},
"required": [
"googleEventId",
"summary",
"startDate"
]
}
},
"createMissing": {
"default": false,
"type": "boolean"
},
"defaultType": {
"default": "visit",
"type": "string",
"enum": [
"task",
"call",
"visit",
"delivery",
"commissioning",
"service",
"check_in"
]
},
"assignedToUserId": {
"description": "Owner for new tasks; defaults to the caller",
"type": "string",
"minLength": 1,
"maxLength": 64
}
},
"required": [
"events"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"created": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"updated": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"cancelled": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"unchanged": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"taskIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
}
},
"required": [
"created",
"updated",
"cancelled",
"unchanged",
"taskIds"
],
"additionalProperties": false
}
}
calendar.sync
Sync with Google Calendar now
Run the two-way Google Calendar sync for one staff user (the caller by default) using the server's direct Google connection: pulls events changed in Google into their linked tasks, then pushes tasks that were created, changed or deleted in the CRM. Returns connected false, and changes nothing, when that user has not connected Google Calendar; in that case sync through Claude's connector with calendar.pending and calendar.record_sync.
Input (object)
| Field | Type | Description |
|---|---|---|
userId | string | Staff user to sync; defaults to the callermin length 1, max length 64 |
createMissing | boolean | Also turn Google events that are not linked to a task into new tasksdefault false |
Output (object)
| Field | Type | Description |
|---|---|---|
connectedrequired | boolean | |
pushedrequired | integer | Tasks created or updated in Google Calendarmin -9007199254740991, max 9007199254740991 |
deletedrequired | integer | Google events removedmin -9007199254740991, max 9007199254740991 |
pulledrequired | integer | Tasks created, updated or cancelled from Google changesmin -9007199254740991, max 9007199254740991 |
errorsrequired | object[] | |
taskIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
errorrequired | string |
Example request
curl https://api.cemco.app/v1/ops/calendar.sync \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"userId": {
"description": "Staff user to sync; defaults to the caller",
"type": "string",
"minLength": 1,
"maxLength": 64
},
"createMissing": {
"default": false,
"description": "Also turn Google events that are not linked to a task into new tasks",
"type": "boolean"
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"connected": {
"type": "boolean"
},
"pushed": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Tasks created or updated in Google Calendar"
},
"deleted": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Google events removed"
},
"pulled": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Tasks created, updated or cancelled from Google changes"
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"taskId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"error": {
"type": "string"
}
},
"required": [
"taskId",
"error"
],
"additionalProperties": false
}
}
},
"required": [
"connected",
"pushed",
"deleted",
"pulled",
"errors"
],
"additionalProperties": false
}
}
calendar.feed_get
Get my private iCal feed
The caller's private iCal subscription URL, creating it on first use. Subscribing in Google Calendar, Apple Calendar or Outlook shows tasks, visits, ship dates and warranty ends read-only. Treat the URL like a password.
Input (empty object)
No input. Send {}.
Output (object)
| Field | Type | Description |
|---|---|---|
feedrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
userIdrequired | string | Record id (UUID)min length 1, max length 64 |
urlrequired | string | Private iCal subscription URL; treat it like a password |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
lastAccessedAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
createdrequired | boolean |
Example request
curl https://api.cemco.app/v1/ops/calendar.feed_get \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"feed": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"userId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"url": {
"type": "string",
"description": "Private iCal subscription URL; treat it like a password"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"lastAccessedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"userId",
"url",
"createdAt",
"lastAccessedAt"
],
"additionalProperties": false
},
"created": {
"type": "boolean"
}
},
"required": [
"feed",
"created"
],
"additionalProperties": false
}
}
calendar.feed_rotate
Replace my iCal feed URL
Issue a new private iCal URL for the caller and stop the old one working. Use it if the URL was shared by mistake.
Input (empty object)
No input. Send {}.
Output (object)
| Field | Type | Description |
|---|---|---|
feedrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
userIdrequired | string | Record id (UUID)min length 1, max length 64 |
urlrequired | string | Private iCal subscription URL; treat it like a password |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
lastAccessedAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
Example request
curl https://api.cemco.app/v1/ops/calendar.feed_rotate \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"feed": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"userId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"url": {
"type": "string",
"description": "Private iCal subscription URL; treat it like a password"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"lastAccessedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"userId",
"url",
"createdAt",
"lastAccessedAt"
],
"additionalProperties": false
}
},
"required": [
"feed"
],
"additionalProperties": false
}
}
calendar.feed_render
Render an iCal feed
Internal: returns the iCalendar text for a feed token. Used by the public feed route.
Input (object)
| Field | Type | Description |
|---|---|---|
tokenrequired | string | min length 1, max length 200 |
Output (object)
| Field | Type | Description |
|---|---|---|
icsrequired | string | |
eventCountrequired | integer | min -9007199254740991, max 9007199254740991 |
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"token": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"required": [
"token"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ics": {
"type": "string"
},
"eventCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"ics",
"eventCount"
],
"additionalProperties": false
}
}