Skip to content

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

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
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)

FieldTypeDescription
assignedToUserIdstringRecord id (UUID)min length 1, max length 64

Output (object)

FieldTypeDescription
staterequired"not_synced" | "pending" | "synced" | "error"
connectedrequiredbooleanTrue when the server holds Google Calendar credentials and syncs on its own
syncedCountrequiredintegermin -9007199254740991, max 9007199254740991
pendingCountrequiredintegermin -9007199254740991, max 9007199254740991
errorCountrequiredintegermin -9007199254740991, max 9007199254740991
lastSyncedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
errorsrequiredobject[]
taskIdrequiredstringRecord id (UUID)min length 1, max length 64
titlerequiredstring
errorrequiredstring
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

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
calendar_pending

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)

FieldTypeDescription
assignedToUserIdstringRecord id (UUID)min length 1, max length 64
limitintegerdefault 50, min 1, max 200

Output (object)

FieldTypeDescription
itemsrequiredobject[]
actionrequired"create" | "update" | "delete"
taskIdrequiredstringRecord id (UUID)min length 1, max length 64
googleEventIdrequiredstring | null
taskrequiredobject | nullNull when the task was deleted
idrequiredstringRecord id (UUID)min length 1, max length 64
typerequired"task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in"
titlerequiredstring
notesrequiredstring | null
statusrequired"open" | "done" | "cancelled"
dueOnrequiredstring (date)Day the task is due or the appointment happens
startsAtrequiredstring (date-time) | nullStart time for timed appointments; null for all-day items
endsAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
locationrequiredstring | null
assignedToUserIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
assignedToNamerequiredstring | null
accountIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
accountNamerequiredstring | null
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
orderIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
siteIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
checkInIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
isOverduerequiredbooleanOpen and due before today
googleEventIdrequiredstring | null
syncStaterequired"not_synced" | "pending" | "synced" | "error"
syncedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
syncErrorrequiredstring | null
completedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
eventrequiredobject | nullReady-made Google Calendar event fields
summaryrequiredstring
descriptionrequiredstring
locationrequiredstring | null
allDayrequiredboolean
startrequiredstringDate (all-day) or UTC timestamp
endrequiredstring
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

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
calendar_record_sync

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)

FieldTypeDescription
resultsrequiredobject[]at least 1
taskIdrequiredstringRecord id (UUID)min length 1, max length 64
googleEventIdstring | nullThe event created or updated; with deleted, the event that was removed (as calendar.pending gave it)max length 300
googleCalendarIdstring | nullmax length 300
deletedbooleanThe Google event was removed. Give its googleEventId too.default false
errorstring | nullmax length 1000

Output (object)

FieldTypeDescription
syncedrequiredintegermin -9007199254740991, max 9007199254740991
errorsrequiredintegermin -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

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
calendar_import_events

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)

FieldTypeDescription
eventsrequiredobject[]at least 1, at most 500
googleEventIdrequiredstringmin length 1, max length 300
googleCalendarIdstring | nullmax length 300
summaryrequiredstringmax length 300
descriptionstring | nullmax length 20000
locationstring | nullmax length 500
startDaterequiredstring (date)Day of the event
startsAtstring (date-time) | nullUTC timestamp, ISO 8601 with Z
endsAtstring (date-time) | nullUTC timestamp, ISO 8601 with Z
cancelledbooleandefault false
updatedAtstring (date-time)UTC timestamp, ISO 8601 with Z
createMissingbooleandefault false
defaultType"task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in"default "visit"
assignedToUserIdstringOwner for new tasks; defaults to the callermin length 1, max length 64

Output (object)

FieldTypeDescription
createdrequiredintegermin -9007199254740991, max 9007199254740991
updatedrequiredintegermin -9007199254740991, max 9007199254740991
cancelledrequiredintegermin -9007199254740991, max 9007199254740991
unchangedrequiredintegermin -9007199254740991, max 9007199254740991
taskIdsrequiredstring[]
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

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
calendar_sync

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)

FieldTypeDescription
userIdstringStaff user to sync; defaults to the callermin length 1, max length 64
createMissingbooleanAlso turn Google events that are not linked to a task into new tasksdefault false

Output (object)

FieldTypeDescription
connectedrequiredboolean
pushedrequiredintegerTasks created or updated in Google Calendarmin -9007199254740991, max 9007199254740991
deletedrequiredintegerGoogle events removedmin -9007199254740991, max 9007199254740991
pulledrequiredintegerTasks created, updated or cancelled from Google changesmin -9007199254740991, max 9007199254740991
errorsrequiredobject[]
taskIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
errorrequiredstring
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

Kind
Write (audited)
Who
Staff: admin, editor, viewer
MCP tool
calendar_feed_get

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)

FieldTypeDescription
feedrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
userIdrequiredstringRecord id (UUID)min length 1, max length 64
urlrequiredstringPrivate iCal subscription URL; treat it like a password
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
lastAccessedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdrequiredboolean
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

Kind
Write (audited)
Who
Staff: admin, editor, viewer
MCP tool
calendar_feed_rotate

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)

FieldTypeDescription
feedrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
userIdrequiredstringRecord id (UUID)min length 1, max length 64
urlrequiredstringPrivate iCal subscription URL; treat it like a password
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
lastAccessedAtrequiredstring (date-time) | nullUTC 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

Kind
Read
Who
Internal only (system)

Internal: returns the iCalendar text for a feed token. Used by the public feed route.

Input (object)

FieldTypeDescription
tokenrequiredstringmin length 1, max length 200

Output (object)

FieldTypeDescription
icsrequiredstring
eventCountrequiredintegermin -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
  }
}