Dashboard and reports
Generated at build time from packages/core/src/operations/reports.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.
reports.dashboard
Get the home dashboard
The home dashboard in one call: open orders by stage, orders not yet valid (with what each is missing), open and down tickets, warranties ending within 60 days, overdue tasks, accounts not contacted in 90 days, and low-stock parts. Counts come with the top rows of each list.
Input (object)
| Field | Type | Description |
|---|---|---|
listLimit | integer | Rows to include in each listdefault 8, min 0, max 50 |
Output (object)
| Field | Type | Description |
|---|---|---|
generatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
todayrequired | string (date) | Date as YYYY-MM-DD |
ordersByStagerequired | object[] | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
labelrequired | string | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
openOrderCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openOrderValueCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
invalidOrdersrequired | object | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
itemsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
siteNamerequired | string | null | |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | |
nextStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | null | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
ticketsrequired | object | |
openCountrequired | integer | min -9007199254740991, max 9007199254740991 |
downCountrequired | integer | min -9007199254740991, max 9007199254740991 |
downrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
ticketNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
titlerequired | string | |
descriptionrequired | string | null | |
categoryrequired | "mechanical" | "electrical" | "controls" | "hydraulic" | "pneumatic" | "structural" | "calibration" | "operator_training" | "other" | |
priorityrequired | "low" | "normal" | "high" | "down" | |
statusrequired | "new" | "diagnosing" | "parts_on_order" | "scheduled" | "waiting_on_customer" | "resolved" | "follow_up_complete" | |
rootCauserequired | "component_failure" | "manufacturing_defect" | "wear" | "operator_error" | "installation" | "shipping_damage" | "environment" | "design" | "unknown" | null | |
resolutionrequired | string | null | |
sourcerequired | "staff" | "portal" | "email" | "agent" | |
assignedToUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
isWarrantyrequired | boolean | Whether the work is covered by warranty |
onsiteHoursrequired | number | Total on-site hours loggedmin 0 |
travelHoursrequired | number | Total travel hours loggedmin 0 |
travelMilesrequired | number | Total travel miles loggedmin 0 |
openedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
scheduledForrequired | string (date) | null | Date as YYYY-MM-DD |
resolvedAtrequired | 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 |
accountNamerequired | string | |
machineSerialNumberrequired | string | |
machineModelrequired | string | |
assignedToNamerequired | string | null | |
recentrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
ticketNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
titlerequired | string | |
descriptionrequired | string | null | |
categoryrequired | "mechanical" | "electrical" | "controls" | "hydraulic" | "pneumatic" | "structural" | "calibration" | "operator_training" | "other" | |
priorityrequired | "low" | "normal" | "high" | "down" | |
statusrequired | "new" | "diagnosing" | "parts_on_order" | "scheduled" | "waiting_on_customer" | "resolved" | "follow_up_complete" | |
rootCauserequired | "component_failure" | "manufacturing_defect" | "wear" | "operator_error" | "installation" | "shipping_damage" | "environment" | "design" | "unknown" | null | |
resolutionrequired | string | null | |
sourcerequired | "staff" | "portal" | "email" | "agent" | |
assignedToUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
isWarrantyrequired | boolean | Whether the work is covered by warranty |
onsiteHoursrequired | number | Total on-site hours loggedmin 0 |
travelHoursrequired | number | Total travel hours loggedmin 0 |
travelMilesrequired | number | Total travel miles loggedmin 0 |
openedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
scheduledForrequired | string (date) | null | Date as YYYY-MM-DD |
resolvedAtrequired | 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 |
accountNamerequired | string | |
machineSerialNumberrequired | string | |
machineModelrequired | string | |
assignedToNamerequired | string | null | |
expiringWarrantiesrequired | object | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
withinDaysrequired | integer | min -9007199254740991, max 9007199254740991 |
itemsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
serialNumberrequired | string | |
typerequired | "plant" | "mixer" | "silo" | "feeder" | "power_pack" | |
modelrequired | string | |
configurationrequired | string | null | |
optionsrequired | string[] | |
accountIdrequired | string | Current ownermin length 1, max length 64 |
siteIdrequired | string | null | Current sitemin length 1, max length 64 |
orderIdrequired | string | null | Order the machine was built formin length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "in_build" | "in_transit" | "operating" | "down" | "idle" | "retired" | |
builtOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
commissionedOnrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStartrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyEndrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStaterequired | "none" | "active" | "expiring" | "expired" | Computed from the warranty dates and today's date |
warrantyDaysLeftrequired | integer | null | Days until the warranty ends; negative once expired; null if not startedmin -9007199254740991, max 9007199254740991 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
siteNamerequired | string | null | |
siteCityrequired | string | null | |
siteStaterequired | string | null | |
latituderequired | number | null | |
longituderequired | number | null | |
openTicketCountrequired | integer | min -9007199254740991, max 9007199254740991 |
overdueTasksrequired | object | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
itemsrequired | object[] | |
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 |
accountsNotContactedrequired | object | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
daysrequired | integer | min -9007199254740991, max 9007199254740991 |
itemsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
normalizedNamerequired | string | Lower-cased name without punctuation or company suffixes; used for duplicate checks |
segmentrequired | "concrete_producer" | "multiservice" | |
statusrequired | "active" | "prospect" | "inactive" | |
phonerequired | string | null | |
websiterequired | string | null | |
hqLine1required | string | null | |
hqLine2required | string | null | |
hqCityrequired | string | null | |
hqStaterequired | string | null | Two-letter US state or region code |
hqPostalCoderequired | string | null | |
hqCountryrequired | string | null | |
hubspotCompanyIdrequired | string | null | |
ownerUserIdrequired | string | null | Staff user who owns the accountmin length 1, max length 64 |
notesrequired | string | null | |
lastContactedAtrequired | string (date-time) | null | Most recent call, email, text or visit |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openOrderCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openTicketCountrequired | integer | min -9007199254740991, max 9007199254740991 |
primaryContactNamerequired | string | null | |
daysSinceContactrequired | integer | null | min -9007199254740991, max 9007199254740991 |
lowStockrequired | object | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
machinesrequired | object | |
totalrequired | integer | min -9007199254740991, max 9007199254740991 |
operatingrequired | integer | min -9007199254740991, max 9007199254740991 |
downrequired | integer | min -9007199254740991, max 9007199254740991 |
underWarrantyrequired | integer | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/reports.dashboard \
-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": {
"listLimit": {
"default": 8,
"description": "Rows to include in each list",
"type": "integer",
"minimum": 0,
"maximum": 50
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"generatedAt": {
"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"
},
"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"
},
"ordersByStage": {
"type": "array",
"items": {
"type": "object",
"properties": {
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"label": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
}
},
"required": [
"stage",
"label",
"count",
"totalCents"
],
"additionalProperties": false
}
},
"openOrderCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"openOrderValueCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"invalidOrders": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"orderNumber": {
"type": "string"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Delivery site"
},
"title": {
"type": [
"string",
"null"
]
},
"stage": {
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
"stageDates": {
"type": "object",
"properties": {
"received": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"in_build": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"ready_to_ship": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"shipped": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"delivered": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"set_up": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"commissioned": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"trained": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"closed": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
}
},
"required": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
],
"additionalProperties": false,
"description": "Date each stage was reached; null if not yet"
},
"signedQuoteDocumentId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"signedQuoteReceivedOn": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"balanceRemainingCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
{
"type": "null"
}
],
"description": "Null until someone records it; 0 means paid in full"
},
"isValid": {
"type": "boolean"
},
"financingPartner": {
"type": "string",
"enum": [
"none",
"commercial_capital",
"northland_capital",
"other"
]
},
"financingStatus": {
"type": "string",
"enum": [
"not_applicable",
"pending",
"approved",
"declined",
"funded"
]
},
"financingNotes": {
"type": [
"string",
"null"
]
},
"poNumber": {
"type": [
"string",
"null"
]
},
"expectedShipOn": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"notes": {
"type": [
"string",
"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"
},
"accountName": {
"type": "string"
},
"siteName": {
"type": [
"string",
"null"
]
},
"missing": {
"type": "array",
"items": {
"type": "string",
"enum": [
"signed_quote",
"signed_quote_received_on",
"balance_remaining"
]
}
},
"nextStage": {
"anyOf": [
{
"type": "string",
"enum": [
"received",
"in_build",
"ready_to_ship",
"shipped",
"delivered",
"set_up",
"commissioned",
"trained",
"closed"
]
},
{
"type": "null"
}
]
},
"lineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"machineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"orderNumber",
"accountId",
"siteId",
"title",
"stage",
"stageDates",
"signedQuoteDocumentId",
"signedQuoteReceivedOn",
"totalCents",
"balanceRemainingCents",
"isValid",
"financingPartner",
"financingStatus",
"financingNotes",
"poNumber",
"expectedShipOn",
"ownerUserId",
"notes",
"createdAt",
"updatedAt",
"accountName",
"siteName",
"missing",
"nextStage",
"lineCount",
"machineCount"
],
"additionalProperties": false
}
}
},
"required": [
"count",
"items"
],
"additionalProperties": false
},
"tickets": {
"type": "object",
"properties": {
"openCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"downCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"down": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"ticketNumber": {
"type": "string"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"machineId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"contactId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"title": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"category": {
"type": "string",
"enum": [
"mechanical",
"electrical",
"controls",
"hydraulic",
"pneumatic",
"structural",
"calibration",
"operator_training",
"other"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"down"
]
},
"status": {
"type": "string",
"enum": [
"new",
"diagnosing",
"parts_on_order",
"scheduled",
"waiting_on_customer",
"resolved",
"follow_up_complete"
]
},
"rootCause": {
"anyOf": [
{
"type": "string",
"enum": [
"component_failure",
"manufacturing_defect",
"wear",
"operator_error",
"installation",
"shipping_damage",
"environment",
"design",
"unknown"
]
},
{
"type": "null"
}
]
},
"resolution": {
"type": [
"string",
"null"
]
},
"source": {
"type": "string",
"enum": [
"staff",
"portal",
"email",
"agent"
]
},
"assignedToUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"isWarranty": {
"type": "boolean",
"description": "Whether the work is covered by warranty"
},
"onsiteHours": {
"type": "number",
"minimum": 0,
"description": "Total on-site hours logged"
},
"travelHours": {
"type": "number",
"minimum": 0,
"description": "Total travel hours logged"
},
"travelMiles": {
"type": "number",
"minimum": 0,
"description": "Total travel miles logged"
},
"openedAt": {
"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"
},
"scheduledFor": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"resolvedAt": {
"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"
},
"accountName": {
"type": "string"
},
"machineSerialNumber": {
"type": "string"
},
"machineModel": {
"type": "string"
},
"assignedToName": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"ticketNumber",
"accountId",
"machineId",
"contactId",
"title",
"description",
"category",
"priority",
"status",
"rootCause",
"resolution",
"source",
"assignedToUserId",
"isWarranty",
"onsiteHours",
"travelHours",
"travelMiles",
"openedAt",
"scheduledFor",
"resolvedAt",
"createdAt",
"updatedAt",
"accountName",
"machineSerialNumber",
"machineModel",
"assignedToName"
],
"additionalProperties": false
}
},
"recent": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"ticketNumber": {
"type": "string"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"machineId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"contactId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"title": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"category": {
"type": "string",
"enum": [
"mechanical",
"electrical",
"controls",
"hydraulic",
"pneumatic",
"structural",
"calibration",
"operator_training",
"other"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"down"
]
},
"status": {
"type": "string",
"enum": [
"new",
"diagnosing",
"parts_on_order",
"scheduled",
"waiting_on_customer",
"resolved",
"follow_up_complete"
]
},
"rootCause": {
"anyOf": [
{
"type": "string",
"enum": [
"component_failure",
"manufacturing_defect",
"wear",
"operator_error",
"installation",
"shipping_damage",
"environment",
"design",
"unknown"
]
},
{
"type": "null"
}
]
},
"resolution": {
"type": [
"string",
"null"
]
},
"source": {
"type": "string",
"enum": [
"staff",
"portal",
"email",
"agent"
]
},
"assignedToUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"isWarranty": {
"type": "boolean",
"description": "Whether the work is covered by warranty"
},
"onsiteHours": {
"type": "number",
"minimum": 0,
"description": "Total on-site hours logged"
},
"travelHours": {
"type": "number",
"minimum": 0,
"description": "Total travel hours logged"
},
"travelMiles": {
"type": "number",
"minimum": 0,
"description": "Total travel miles logged"
},
"openedAt": {
"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"
},
"scheduledFor": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"resolvedAt": {
"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"
},
"accountName": {
"type": "string"
},
"machineSerialNumber": {
"type": "string"
},
"machineModel": {
"type": "string"
},
"assignedToName": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"ticketNumber",
"accountId",
"machineId",
"contactId",
"title",
"description",
"category",
"priority",
"status",
"rootCause",
"resolution",
"source",
"assignedToUserId",
"isWarranty",
"onsiteHours",
"travelHours",
"travelMiles",
"openedAt",
"scheduledFor",
"resolvedAt",
"createdAt",
"updatedAt",
"accountName",
"machineSerialNumber",
"machineModel",
"assignedToName"
],
"additionalProperties": false
}
}
},
"required": [
"openCount",
"downCount",
"down",
"recent"
],
"additionalProperties": false
},
"expiringWarranties": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"withinDays": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"serialNumber": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"plant",
"mixer",
"silo",
"feeder",
"power_pack"
]
},
"model": {
"type": "string"
},
"configuration": {
"type": [
"string",
"null"
]
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Current owner"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Current site"
},
"orderId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Order the machine was built for"
},
"productId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"enum": [
"in_build",
"in_transit",
"operating",
"down",
"idle",
"retired"
]
},
"builtOn": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"shippedOn": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"commissionedOn": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"warrantyStart": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"warrantyEnd": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"warrantyState": {
"type": "string",
"enum": [
"none",
"active",
"expiring",
"expired"
],
"description": "Computed from the warranty dates and today's date"
},
"warrantyDaysLeft": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Days until the warranty ends; negative once expired; null if not started"
},
"notes": {
"type": [
"string",
"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"
},
"accountName": {
"type": "string"
},
"siteName": {
"type": [
"string",
"null"
]
},
"siteCity": {
"type": [
"string",
"null"
]
},
"siteState": {
"type": [
"string",
"null"
]
},
"latitude": {
"type": [
"number",
"null"
]
},
"longitude": {
"type": [
"number",
"null"
]
},
"openTicketCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"serialNumber",
"type",
"model",
"configuration",
"options",
"accountId",
"siteId",
"orderId",
"productId",
"status",
"builtOn",
"shippedOn",
"commissionedOn",
"warrantyStart",
"warrantyEnd",
"warrantyState",
"warrantyDaysLeft",
"notes",
"createdAt",
"updatedAt",
"accountName",
"siteName",
"siteCity",
"siteState",
"latitude",
"longitude",
"openTicketCount"
],
"additionalProperties": false
}
}
},
"required": [
"count",
"withinDays",
"items"
],
"additionalProperties": false
},
"overdueTasks": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"items": {
"type": "array",
"items": {
"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
}
}
},
"required": [
"count",
"items"
],
"additionalProperties": false
},
"accountsNotContacted": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"days": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"name": {
"type": "string"
},
"normalizedName": {
"type": "string",
"description": "Lower-cased name without punctuation or company suffixes; used for duplicate checks"
},
"segment": {
"type": "string",
"enum": [
"concrete_producer",
"multiservice"
]
},
"status": {
"type": "string",
"enum": [
"active",
"prospect",
"inactive"
]
},
"phone": {
"type": [
"string",
"null"
]
},
"website": {
"type": [
"string",
"null"
]
},
"hqLine1": {
"type": [
"string",
"null"
]
},
"hqLine2": {
"type": [
"string",
"null"
]
},
"hqCity": {
"type": [
"string",
"null"
]
},
"hqState": {
"description": "Two-letter US state or region code",
"type": [
"string",
"null"
]
},
"hqPostalCode": {
"type": [
"string",
"null"
]
},
"hqCountry": {
"type": [
"string",
"null"
]
},
"hubspotCompanyId": {
"type": [
"string",
"null"
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Staff user who owns the account"
},
"notes": {
"type": [
"string",
"null"
]
},
"lastContactedAt": {
"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": "Most recent call, email, text or visit"
},
"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"
},
"machineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"openOrderCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"openTicketCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"primaryContactName": {
"type": [
"string",
"null"
]
},
"daysSinceContact": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"name",
"normalizedName",
"segment",
"status",
"phone",
"website",
"hqLine1",
"hqLine2",
"hqCity",
"hqState",
"hqPostalCode",
"hqCountry",
"hubspotCompanyId",
"ownerUserId",
"notes",
"lastContactedAt",
"createdAt",
"updatedAt",
"machineCount",
"openOrderCount",
"openTicketCount",
"primaryContactName",
"daysSinceContact"
],
"additionalProperties": false
}
}
},
"required": [
"count",
"days",
"items"
],
"additionalProperties": false
},
"lowStock": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"count"
],
"additionalProperties": false
},
"machines": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"operating": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"down": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"underWarranty": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"total",
"operating",
"down",
"underWarranty"
],
"additionalProperties": false
}
},
"required": [
"generatedAt",
"today",
"ordersByStage",
"openOrderCount",
"openOrderValueCents",
"invalidOrders",
"tickets",
"expiringWarranties",
"overdueTasks",
"accountsNotContacted",
"lowStock",
"machines"
],
"additionalProperties": false
}
}
reports.installed_base
Report: installed base by state and model
Counts of machines by the state of their current site and by model, plus totals by type and status. Retired machines are left out unless asked for.
Input (object)
| Field | Type | Description |
|---|---|---|
includeRetired | boolean | default false |
type | "plant" | "mixer" | "silo" | "feeder" | "power_pack" |
Output (object)
| Field | Type | Description |
|---|---|---|
totalrequired | integer | min -9007199254740991, max 9007199254740991 |
byStaterequired | object[] | |
staterequired | string | State code, or Unknown when the machine has no site |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
byModelrequired | object[] | |
modelrequired | string | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
byStateAndModelrequired | object[] | |
staterequired | string | |
modelrequired | string | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
byTyperequired | object[] | |
typerequired | "plant" | "mixer" | "silo" | "feeder" | "power_pack" | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
byStatusrequired | object[] | |
statusrequired | string | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/reports.installed_base \
-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": {
"includeRetired": {
"default": false,
"type": "boolean"
},
"type": {
"type": "string",
"enum": [
"plant",
"mixer",
"silo",
"feeder",
"power_pack"
]
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"total": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"byState": {
"type": "array",
"items": {
"type": "object",
"properties": {
"state": {
"type": "string",
"description": "State code, or Unknown when the machine has no site"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"state",
"count"
],
"additionalProperties": false
}
},
"byModel": {
"type": "array",
"items": {
"type": "object",
"properties": {
"model": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"model",
"count"
],
"additionalProperties": false
}
},
"byStateAndModel": {
"type": "array",
"items": {
"type": "object",
"properties": {
"state": {
"type": "string"
},
"model": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"state",
"model",
"count"
],
"additionalProperties": false
}
},
"byType": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"plant",
"mixer",
"silo",
"feeder",
"power_pack"
]
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"type",
"count"
],
"additionalProperties": false
}
},
"byStatus": {
"type": "array",
"items": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"status",
"count"
],
"additionalProperties": false
}
}
},
"required": [
"total",
"byState",
"byModel",
"byStateAndModel",
"byType",
"byStatus"
],
"additionalProperties": false
}
}
reports.tickets_by_root_cause
Report: tickets by root cause
Service tickets opened in a date range (default the last 365 days) grouped by root cause and by category, with on-site hours, travel hours and parts cost for each.
Input (object)
| Field | Type | Description |
|---|---|---|
from | string (date) | Date as YYYY-MM-DD |
to | string (date) | Date as YYYY-MM-DD |
model | string | max length 100 |
accountId | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
fromrequired | string (date) | Date as YYYY-MM-DD |
torequired | string (date) | Date as YYYY-MM-DD |
totalrequired | integer | min -9007199254740991, max 9007199254740991 |
byRootCauserequired | object[] | |
rootCauserequired | "component_failure" | "manufacturing_defect" | "wear" | "operator_error" | "installation" | "shipping_damage" | "environment" | "design" | "unknown" | null | Null for tickets with no root cause recorded yet |
labelrequired | string | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
onsiteHoursrequired | number | |
travelHoursrequired | number | |
partsCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
warrantyCountrequired | integer | min -9007199254740991, max 9007199254740991 |
byCategoryrequired | object[] | |
categoryrequired | "mechanical" | "electrical" | "controls" | "hydraulic" | "pneumatic" | "structural" | "calibration" | "operator_training" | "other" | |
labelrequired | string | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/reports.tickets_by_root_cause \
-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": {
"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"
},
"model": {
"type": "string",
"maxLength": 100
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
}
},
"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"
},
"total": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"byRootCause": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rootCause": {
"anyOf": [
{
"type": "string",
"enum": [
"component_failure",
"manufacturing_defect",
"wear",
"operator_error",
"installation",
"shipping_damage",
"environment",
"design",
"unknown"
]
},
{
"type": "null"
}
],
"description": "Null for tickets with no root cause recorded yet"
},
"label": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"onsiteHours": {
"type": "number"
},
"travelHours": {
"type": "number"
},
"partsCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"warrantyCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"rootCause",
"label",
"count",
"onsiteHours",
"travelHours",
"partsCents",
"warrantyCount"
],
"additionalProperties": false
}
},
"byCategory": {
"type": "array",
"items": {
"type": "object",
"properties": {
"category": {
"type": "string",
"enum": [
"mechanical",
"electrical",
"controls",
"hydraulic",
"pneumatic",
"structural",
"calibration",
"operator_training",
"other"
]
},
"label": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"category",
"label",
"count"
],
"additionalProperties": false
}
}
},
"required": [
"from",
"to",
"total",
"byRootCause",
"byCategory"
],
"additionalProperties": false
}
}
reports.parts_revenue
Report: parts revenue
Revenue from parts orders (ordered, shipped or delivered) in a date range, by month, by account and by part. Default range is the last 12 months.
Input (object)
| Field | Type | Description |
|---|---|---|
from | string (date) | Date as YYYY-MM-DD |
to | string (date) | Date as YYYY-MM-DD |
top | integer | default 10, min 1, max 100 |
Output (object)
| Field | Type | Description |
|---|---|---|
fromrequired | string (date) | Date as YYYY-MM-DD |
torequired | string (date) | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
orderCountrequired | integer | min -9007199254740991, max 9007199254740991 |
byMonthrequired | object[] | |
monthrequired | string | YYYY-MM |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
orderCountrequired | integer | min -9007199254740991, max 9007199254740991 |
byAccountrequired | object[] | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
accountNamerequired | string | |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
orderCountrequired | integer | min -9007199254740991, max 9007199254740991 |
byPartrequired | object[] | |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min -9007199254740991, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/reports.parts_revenue \
-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": {
"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"
},
"top": {
"default": 10,
"type": "integer",
"minimum": 1,
"maximum": 100
}
}
},
"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"
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"orderCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"byMonth": {
"type": "array",
"items": {
"type": "object",
"properties": {
"month": {
"type": "string",
"description": "YYYY-MM"
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"orderCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"month",
"totalCents",
"orderCount"
],
"additionalProperties": false
}
},
"byAccount": {
"type": "array",
"items": {
"type": "object",
"properties": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountName": {
"type": "string"
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"orderCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"accountId",
"accountName",
"totalCents",
"orderCount"
],
"additionalProperties": false
}
},
"byPart": {
"type": "array",
"items": {
"type": "object",
"properties": {
"partId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"partNumber": {
"type": "string"
},
"description": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"totalCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
}
},
"required": [
"partId",
"partNumber",
"description",
"quantity",
"totalCents"
],
"additionalProperties": false
}
}
},
"required": [
"from",
"to",
"totalCents",
"orderCount",
"byMonth",
"byAccount",
"byPart"
],
"additionalProperties": false
}
}
reports.expiring_warranties
Report: expiring warranties
Machines whose warranty ends within a number of days (default 60), soonest first, with owner and site. Set includeExpiredDays to also see warranties that ended recently.
Input (object)
| Field | Type | Description |
|---|---|---|
withinDays | integer | default 60, min 1, max 730 |
includeExpiredDays | integer | default 0, min 0, max 365 |
accountId | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
withinDaysrequired | integer | min -9007199254740991, max 9007199254740991 |
todayrequired | string (date) | Date as YYYY-MM-DD |
itemsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
serialNumberrequired | string | |
typerequired | "plant" | "mixer" | "silo" | "feeder" | "power_pack" | |
modelrequired | string | |
configurationrequired | string | null | |
optionsrequired | string[] | |
accountIdrequired | string | Current ownermin length 1, max length 64 |
siteIdrequired | string | null | Current sitemin length 1, max length 64 |
orderIdrequired | string | null | Order the machine was built formin length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "in_build" | "in_transit" | "operating" | "down" | "idle" | "retired" | |
builtOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
commissionedOnrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStartrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyEndrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStaterequired | "none" | "active" | "expiring" | "expired" | Computed from the warranty dates and today's date |
warrantyDaysLeftrequired | integer | null | Days until the warranty ends; negative once expired; null if not startedmin -9007199254740991, max 9007199254740991 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
siteNamerequired | string | null | |
siteCityrequired | string | null | |
siteStaterequired | string | null | |
latituderequired | number | null | |
longituderequired | number | null | |
openTicketCountrequired | integer | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/reports.expiring_warranties \
-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": {
"withinDays": {
"default": 60,
"type": "integer",
"minimum": 1,
"maximum": 730
},
"includeExpiredDays": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 365
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"withinDays": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"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"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"serialNumber": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"plant",
"mixer",
"silo",
"feeder",
"power_pack"
]
},
"model": {
"type": "string"
},
"configuration": {
"type": [
"string",
"null"
]
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Current owner"
},
"siteId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Current site"
},
"orderId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Order the machine was built for"
},
"productId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"enum": [
"in_build",
"in_transit",
"operating",
"down",
"idle",
"retired"
]
},
"builtOn": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"shippedOn": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"commissionedOn": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"warrantyStart": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"warrantyEnd": {
"anyOf": [
{
"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"
},
{
"type": "null"
}
]
},
"warrantyState": {
"type": "string",
"enum": [
"none",
"active",
"expiring",
"expired"
],
"description": "Computed from the warranty dates and today's date"
},
"warrantyDaysLeft": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Days until the warranty ends; negative once expired; null if not started"
},
"notes": {
"type": [
"string",
"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"
},
"accountName": {
"type": "string"
},
"siteName": {
"type": [
"string",
"null"
]
},
"siteCity": {
"type": [
"string",
"null"
]
},
"siteState": {
"type": [
"string",
"null"
]
},
"latitude": {
"type": [
"number",
"null"
]
},
"longitude": {
"type": [
"number",
"null"
]
},
"openTicketCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"id",
"serialNumber",
"type",
"model",
"configuration",
"options",
"accountId",
"siteId",
"orderId",
"productId",
"status",
"builtOn",
"shippedOn",
"commissionedOn",
"warrantyStart",
"warrantyEnd",
"warrantyState",
"warrantyDaysLeft",
"notes",
"createdAt",
"updatedAt",
"accountName",
"siteName",
"siteCity",
"siteState",
"latitude",
"longitude",
"openTicketCount"
],
"additionalProperties": false
}
}
},
"required": [
"withinDays",
"today",
"items"
],
"additionalProperties": false
}
}
reports.accounts_not_contacted
Report: accounts not contacted
Active accounts with no call, email, text or visit in a number of days (default 90), longest silence first. Accounts never contacted come first.
Input (object)
| Field | Type | Description |
|---|---|---|
days | integer | default 90, min 1, max 3650 |
limit | integer | default 100, min 1, max 500 |
Output (object)
| Field | Type | Description |
|---|---|---|
daysrequired | integer | min -9007199254740991, max 9007199254740991 |
todayrequired | string (date) | Date as YYYY-MM-DD |
itemsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
normalizedNamerequired | string | Lower-cased name without punctuation or company suffixes; used for duplicate checks |
segmentrequired | "concrete_producer" | "multiservice" | |
statusrequired | "active" | "prospect" | "inactive" | |
phonerequired | string | null | |
websiterequired | string | null | |
hqLine1required | string | null | |
hqLine2required | string | null | |
hqCityrequired | string | null | |
hqStaterequired | string | null | Two-letter US state or region code |
hqPostalCoderequired | string | null | |
hqCountryrequired | string | null | |
hubspotCompanyIdrequired | string | null | |
ownerUserIdrequired | string | null | Staff user who owns the accountmin length 1, max length 64 |
notesrequired | string | null | |
lastContactedAtrequired | string (date-time) | null | Most recent call, email, text or visit |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openOrderCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openTicketCountrequired | integer | min -9007199254740991, max 9007199254740991 |
primaryContactNamerequired | string | null | |
daysSinceContactrequired | integer | null | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/reports.accounts_not_contacted \
-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": {
"days": {
"default": 90,
"type": "integer",
"minimum": 1,
"maximum": 3650
},
"limit": {
"default": 100,
"type": "integer",
"minimum": 1,
"maximum": 500
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"days": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"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"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"name": {
"type": "string"
},
"normalizedName": {
"type": "string",
"description": "Lower-cased name without punctuation or company suffixes; used for duplicate checks"
},
"segment": {
"type": "string",
"enum": [
"concrete_producer",
"multiservice"
]
},
"status": {
"type": "string",
"enum": [
"active",
"prospect",
"inactive"
]
},
"phone": {
"type": [
"string",
"null"
]
},
"website": {
"type": [
"string",
"null"
]
},
"hqLine1": {
"type": [
"string",
"null"
]
},
"hqLine2": {
"type": [
"string",
"null"
]
},
"hqCity": {
"type": [
"string",
"null"
]
},
"hqState": {
"description": "Two-letter US state or region code",
"type": [
"string",
"null"
]
},
"hqPostalCode": {
"type": [
"string",
"null"
]
},
"hqCountry": {
"type": [
"string",
"null"
]
},
"hubspotCompanyId": {
"type": [
"string",
"null"
]
},
"ownerUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
],
"description": "Staff user who owns the account"
},
"notes": {
"type": [
"string",
"null"
]
},
"lastContactedAt": {
"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": "Most recent call, email, text or visit"
},
"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"
},
"machineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"openOrderCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"openTicketCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"primaryContactName": {
"type": [
"string",
"null"
]
},
"daysSinceContact": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"name",
"normalizedName",
"segment",
"status",
"phone",
"website",
"hqLine1",
"hqLine2",
"hqCity",
"hqState",
"hqPostalCode",
"hqCountry",
"hubspotCompanyId",
"ownerUserId",
"notes",
"lastContactedAt",
"createdAt",
"updatedAt",
"machineCount",
"openOrderCount",
"openTicketCount",
"primaryContactName",
"daysSinceContact"
],
"additionalProperties": false
}
}
},
"required": [
"days",
"today",
"items"
],
"additionalProperties": false
}
}