Skip to content

Agenda

Generated at build time from packages/core/src/operations/agenda.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.

agenda.get

Get the agenda

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
agenda_get
In-chat view
ui://cemco/agenda.html

What is coming up, grouped by day: tasks, calls, visits, deliveries, commissioning and service appointments, order ship dates, warranty end dates, check-ins, preventive maintenance due and service contract renewals. Defaults to the 14 days starting today. Overdue open tasks are returned separately. Includes the Google Calendar sync state.

Input (object)

FieldTypeDescription
fromstring (date)First day; defaults to today
tostring (date)Last day; defaults to 13 days after from
assignedToUserIdstringRecord id (UUID)min length 1, max length 64
minebooleanOnly tasks assigned to the caller (dated records such as warranty ends are always included)default false
accountIdstringRecord id (UUID)min length 1, max length 64
kinds("task" | "ship_date" | "delivery" | "warranty_end" | "check_in" | "service_due" | "contract_renewal")[]Limit to these kinds of item

Output (object)

FieldTypeDescription
fromrequiredstring (date)Date as YYYY-MM-DD
torequiredstring (date)Date as YYYY-MM-DD
todayrequiredstring (date)Date as YYYY-MM-DD
daysrequiredobject[]Only days that have items, in date order
daterequiredstring (date)Date as YYYY-MM-DD
isTodayrequiredboolean
itemsrequiredobject[]
kindrequired"task" | "ship_date" | "delivery" | "warranty_end" | "check_in" | "service_due" | "contract_renewal"
daterequiredstring (date)Date as YYYY-MM-DD
titlerequiredstring
subtitlerequiredstring | null
startsAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
entityTyperequired"account" | "contact" | "site" | "order" | "product" | "machine" | "ticket" | "warranty_claim" | "part" | "parts_order" | "document" | "activity" | "task" | "check_in" | "opportunity" | "service_plan" | "service_contract" | "training_record" | "import_run" | "user" | "portal_invite" | "customer_user" | "calendar_feed" | "stock_movement" | "email"
entityIdrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
accountNamerequiredstring | null
taskIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
taskTyperequired"task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in" | null
donerequiredboolean
overduerequiredboolean
syncStaterequired"not_synced" | "pending" | "synced" | "error" | null
overduerequiredobject[]Open tasks due before the range
kindrequired"task" | "ship_date" | "delivery" | "warranty_end" | "check_in" | "service_due" | "contract_renewal"
daterequiredstring (date)Date as YYYY-MM-DD
titlerequiredstring
subtitlerequiredstring | null
startsAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
entityTyperequired"account" | "contact" | "site" | "order" | "product" | "machine" | "ticket" | "warranty_claim" | "part" | "parts_order" | "document" | "activity" | "task" | "check_in" | "opportunity" | "service_plan" | "service_contract" | "training_record" | "import_run" | "user" | "portal_invite" | "customer_user" | "calendar_feed" | "stock_movement" | "email"
entityIdrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
accountNamerequiredstring | null
taskIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
taskTyperequired"task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in" | null
donerequiredboolean
overduerequiredboolean
syncStaterequired"not_synced" | "pending" | "synced" | "error" | null
syncrequiredobject
staterequired"not_synced" | "pending" | "synced" | "error"
pendingCountrequiredintegermin -9007199254740991, max 9007199254740991
errorCountrequiredintegermin -9007199254740991, max 9007199254740991
lastSyncedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/agenda.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": {
      "from": {
        "description": "First day; defaults to today",
        "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])))$"
      },
      "to": {
        "description": "Last day; defaults to 13 days after from",
        "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])))$"
      },
      "assignedToUserId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "mine": {
        "default": false,
        "description": "Only tasks assigned to the caller (dated records such as warranty ends are always included)",
        "type": "boolean"
      },
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "kinds": {
        "description": "Limit to these kinds of item",
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "task",
            "ship_date",
            "delivery",
            "warranty_end",
            "check_in",
            "service_due",
            "contract_renewal"
          ]
        }
      }
    }
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "from": {
        "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": "Date as YYYY-MM-DD"
      },
      "to": {
        "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": "Date as YYYY-MM-DD"
      },
      "today": {
        "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": "Date as YYYY-MM-DD"
      },
      "days": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "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": "Date as YYYY-MM-DD"
            },
            "isToday": {
              "type": "boolean"
            },
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "task",
                      "ship_date",
                      "delivery",
                      "warranty_end",
                      "check_in",
                      "service_due",
                      "contract_renewal"
                    ]
                  },
                  "date": {
                    "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": "Date as YYYY-MM-DD"
                  },
                  "title": {
                    "type": "string"
                  },
                  "subtitle": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "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"
                      }
                    ]
                  },
                  "entityType": {
                    "type": "string",
                    "enum": [
                      "account",
                      "contact",
                      "site",
                      "order",
                      "product",
                      "machine",
                      "ticket",
                      "warranty_claim",
                      "part",
                      "parts_order",
                      "document",
                      "activity",
                      "task",
                      "check_in",
                      "opportunity",
                      "service_plan",
                      "service_contract",
                      "training_record",
                      "import_run",
                      "user",
                      "portal_invite",
                      "customer_user",
                      "calendar_feed",
                      "stock_movement",
                      "email"
                    ]
                  },
                  "entityId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "Record id (UUID)"
                  },
                  "accountId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64,
                        "description": "Record id (UUID)"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "accountName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "taskId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64,
                        "description": "Record id (UUID)"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "taskType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "task",
                          "call",
                          "visit",
                          "delivery",
                          "commissioning",
                          "service",
                          "check_in"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "done": {
                    "type": "boolean"
                  },
                  "overdue": {
                    "type": "boolean"
                  },
                  "syncState": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "not_synced",
                          "pending",
                          "synced",
                          "error"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "date",
                  "title",
                  "subtitle",
                  "startsAt",
                  "entityType",
                  "entityId",
                  "accountId",
                  "accountName",
                  "taskId",
                  "taskType",
                  "done",
                  "overdue",
                  "syncState"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "date",
            "isToday",
            "items"
          ],
          "additionalProperties": false
        },
        "description": "Only days that have items, in date order"
      },
      "overdue": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "task",
                "ship_date",
                "delivery",
                "warranty_end",
                "check_in",
                "service_due",
                "contract_renewal"
              ]
            },
            "date": {
              "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": "Date as YYYY-MM-DD"
            },
            "title": {
              "type": "string"
            },
            "subtitle": {
              "type": [
                "string",
                "null"
              ]
            },
            "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"
                }
              ]
            },
            "entityType": {
              "type": "string",
              "enum": [
                "account",
                "contact",
                "site",
                "order",
                "product",
                "machine",
                "ticket",
                "warranty_claim",
                "part",
                "parts_order",
                "document",
                "activity",
                "task",
                "check_in",
                "opportunity",
                "service_plan",
                "service_contract",
                "training_record",
                "import_run",
                "user",
                "portal_invite",
                "customer_user",
                "calendar_feed",
                "stock_movement",
                "email"
              ]
            },
            "entityId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "accountId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "accountName": {
              "type": [
                "string",
                "null"
              ]
            },
            "taskId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "taskType": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "task",
                    "call",
                    "visit",
                    "delivery",
                    "commissioning",
                    "service",
                    "check_in"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "done": {
              "type": "boolean"
            },
            "overdue": {
              "type": "boolean"
            },
            "syncState": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "not_synced",
                    "pending",
                    "synced",
                    "error"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "kind",
            "date",
            "title",
            "subtitle",
            "startsAt",
            "entityType",
            "entityId",
            "accountId",
            "accountName",
            "taskId",
            "taskType",
            "done",
            "overdue",
            "syncState"
          ],
          "additionalProperties": false
        },
        "description": "Open tasks due before the range"
      },
      "sync": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "not_synced",
              "pending",
              "synced",
              "error"
            ]
          },
          "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"
              }
            ]
          }
        },
        "required": [
          "state",
          "pendingCount",
          "errorCount",
          "lastSyncedAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "from",
      "to",
      "today",
      "days",
      "overdue",
      "sync"
    ],
    "additionalProperties": false
  }
}