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
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)
| Field | Type | Description |
|---|---|---|
from | string (date) | First day; defaults to today |
to | string (date) | Last day; defaults to 13 days after from |
assignedToUserId | string | Record id (UUID)min length 1, max length 64 |
mine | boolean | Only tasks assigned to the caller (dated records such as warranty ends are always included)default false |
accountId | string | Record 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)
| Field | Type | Description |
|---|---|---|
fromrequired | string (date) | Date as YYYY-MM-DD |
torequired | string (date) | Date as YYYY-MM-DD |
todayrequired | string (date) | Date as YYYY-MM-DD |
daysrequired | object[] | Only days that have items, in date order |
daterequired | string (date) | Date as YYYY-MM-DD |
isTodayrequired | boolean | |
itemsrequired | object[] | |
kindrequired | "task" | "ship_date" | "delivery" | "warranty_end" | "check_in" | "service_due" | "contract_renewal" | |
daterequired | string (date) | Date as YYYY-MM-DD |
titlerequired | string | |
subtitlerequired | string | null | |
startsAtrequired | string (date-time) | null | UTC 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" | |
entityIdrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
accountNamerequired | string | null | |
taskIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
taskTyperequired | "task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in" | null | |
donerequired | boolean | |
overduerequired | boolean | |
syncStaterequired | "not_synced" | "pending" | "synced" | "error" | null | |
overduerequired | object[] | Open tasks due before the range |
kindrequired | "task" | "ship_date" | "delivery" | "warranty_end" | "check_in" | "service_due" | "contract_renewal" | |
daterequired | string (date) | Date as YYYY-MM-DD |
titlerequired | string | |
subtitlerequired | string | null | |
startsAtrequired | string (date-time) | null | UTC 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" | |
entityIdrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
accountNamerequired | string | null | |
taskIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
taskTyperequired | "task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in" | null | |
donerequired | boolean | |
overduerequired | boolean | |
syncStaterequired | "not_synced" | "pending" | "synced" | "error" | null | |
syncrequired | object | |
staterequired | "not_synced" | "pending" | "synced" | "error" | |
pendingCountrequired | integer | min -9007199254740991, max 9007199254740991 |
errorCountrequired | integer | min -9007199254740991, max 9007199254740991 |
lastSyncedAtrequired | string (date-time) | null | UTC 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
}
}