Service tickets
Generated at build time from packages/core/src/operations/tickets.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.
tickets.board
Get the service board
Service tickets grouped by status in order: new, diagnosing, parts_on_order, scheduled, waiting_on_customer, resolved, follow_up_complete. Within each column down-priority tickets come first. Resolved and follow-up complete columns show only tickets closed in the last 30 days unless includeAllClosed is true.
Input (object)
| Field | Type | Description |
|---|---|---|
accountId | string | Record id (UUID)min length 1, max length 64 |
assignedToUserId | string | Record id (UUID)min length 1, max length 64 |
includeAllClosed | boolean | default false |
Output (object)
| Field | Type | Description |
|---|---|---|
columnsrequired | object[] | |
statusrequired | "new" | "diagnosing" | "parts_on_order" | "scheduled" | "waiting_on_customer" | "resolved" | "follow_up_complete" | |
labelrequired | string | |
countrequired | integer | min -9007199254740991, max 9007199254740991 |
ticketsrequired | object[] | Down tickets first, then by priority and age |
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 | |
openCountrequired | integer | min -9007199254740991, max 9007199254740991 |
downCountrequired | integer | Open tickets with priority downmin -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/tickets.board \
-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": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"assignedToUserId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"includeAllClosed": {
"default": false,
"type": "boolean"
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"columns": {
"type": "array",
"items": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"new",
"diagnosing",
"parts_on_order",
"scheduled",
"waiting_on_customer",
"resolved",
"follow_up_complete"
]
},
"label": {
"type": "string"
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"tickets": {
"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
},
"description": "Down tickets first, then by priority and age"
}
},
"required": [
"status",
"label",
"count",
"tickets"
],
"additionalProperties": false
}
},
"openCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"downCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Open tickets with priority down"
}
},
"required": [
"columns",
"openCount",
"downCount"
],
"additionalProperties": false
}
}
tickets.list
List service tickets
Service tickets as a flat list with filters for account, machine, status, priority, category and assignee.
Input (object)
| Field | Type | Description |
|---|---|---|
accountId | string | Record id (UUID)min length 1, max length 64 |
machineId | string | Record id (UUID)min length 1, max length 64 |
status | "new" | "diagnosing" | "parts_on_order" | "scheduled" | "waiting_on_customer" | "resolved" | "follow_up_complete" | |
priority | "low" | "normal" | "high" | "down" | |
category | "mechanical" | "electrical" | "controls" | "hydraulic" | "pneumatic" | "structural" | "calibration" | "operator_training" | "other" | |
assignedToUserId | string | Record id (UUID)min length 1, max length 64 |
open | boolean | true for tickets not yet resolved, false for resolved and follow-up complete |
query | string | Matches ticket number, title, serial number or account namemax length 200 |
sort | "newest" | "oldest" | "priority" | default "priority" |
limit | integer | Maximum rows to return (default 50, max 500)default 50, min 1, max 500 |
offset | integer | Rows to skip, for pagingdefault 0, min 0, max 9007199254740991 |
Output (object)
| Field | Type | Description |
|---|---|---|
itemsrequired | 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 | |
totalrequired | integer | Total rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991 |
limitrequired | integer | min -9007199254740991, max 9007199254740991 |
offsetrequired | integer | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/tickets.list \
-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": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"machineId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"status": {
"type": "string",
"enum": [
"new",
"diagnosing",
"parts_on_order",
"scheduled",
"waiting_on_customer",
"resolved",
"follow_up_complete"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"down"
]
},
"category": {
"type": "string",
"enum": [
"mechanical",
"electrical",
"controls",
"hydraulic",
"pneumatic",
"structural",
"calibration",
"operator_training",
"other"
]
},
"assignedToUserId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"open": {
"description": "true for tickets not yet resolved, false for resolved and follow-up complete",
"type": "boolean"
},
"query": {
"description": "Matches ticket number, title, serial number or account name",
"type": "string",
"maxLength": 200
},
"sort": {
"default": "priority",
"type": "string",
"enum": [
"newest",
"oldest",
"priority"
]
},
"limit": {
"default": 50,
"description": "Maximum rows to return (default 50, max 500)",
"type": "integer",
"minimum": 1,
"maximum": 500
},
"offset": {
"default": 0,
"description": "Rows to skip, for paging",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"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
}
},
"total": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Total rows matching the filters, ignoring limit and offset"
},
"limit": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"offset": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"items",
"total",
"limit",
"offset"
],
"additionalProperties": false
}
}
tickets.get
Get a service ticket
One ticket by id or ticket number with its machine, parts used, time entries (on-site hours, travel), warranty claims, documents and related activity.
Input (object)
| Field | Type | Description |
|---|---|---|
id | string | Record id (UUID)min length 1, max length 64 |
ticketNumber | string | max length 40 |
Output (object)
| Field | Type | Description |
|---|---|---|
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 | |
partsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
coveredByWarrantyrequired | boolean | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
timeEntriesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | Record id (UUID)min length 1, max length 64 |
workDaterequired | string (date) | Date as YYYY-MM-DD |
onsiteHoursrequired | number | min 0 |
travelHoursrequired | number | min 0 |
travelMilesrequired | number | min 0 |
technicianNamerequired | string | |
noterequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
warrantyClaimsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
claimNumberrequired | string | |
ticketIdrequired | string | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
statusrequired | "submitted" | "approved" | "denied" | "credited" | |
descriptionrequired | string | null | |
amountClaimedCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
creditCentsrequired | integer | Credit granted to the customermin 0, max 9007199254740991 |
submittedOnrequired | string (date) | Date as YYYY-MM-DD |
decidedOnrequired | string (date) | null | Date as YYYY-MM-DD |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
documentsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
kindrequired | "signed_quote" | "quote" | "purchase_order" | "drawing" | "manual" | "inspection_report" | "photo" | "training_record" | "invoice" | "email_attachment" | "export" | "other" | |
titlerequired | string | |
filenamerequired | string | |
contentTyperequired | string | |
sizeBytesrequired | integer | min 0, max 9007199254740991 |
statusrequired | "pending" | "stored" | pending until the file bytes are stored |
accountIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
customerVisiblerequired | boolean | Whether the customer can open it in the portal |
sourcerequired | "upload" | "email" | "portal" | "system" | "import" | |
linksrequired | object[] | |
entityTyperequired | "account" | "contact" | "site" | "order" | "machine" | "ticket" | "warranty_claim" | "parts_order" | "part" | "opportunity" | "check_in" | |
entityIdrequired | string | Record id (UUID)min length 1, max length 64 |
uploadedByNamerequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
activitiesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
typerequired | "call" | "email" | "text" | "visit" | "note" | "system" | |
directionrequired | "outbound" | "inbound" | null | |
subjectrequired | string | |
bodyrequired | string | null | |
occurredAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
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 |
externalRefrequired | string | null | Gmail message id for imported emails; unique |
externalThreadIdrequired | string | null | |
fromAddressrequired | string | null | |
toAddressesrequired | string[] | |
durationMinutesrequired | integer | null | min 0, max 9007199254740991 |
documentIdsrequired | string[] | Attachments stored as documents |
loggedByNamerequired | string | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
machinerequired | 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 |
Example request
curl https://api.cemco.app/v1/ops/tickets.get \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"id":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"ticketNumber": {
"type": "string",
"maxLength": 40
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"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"
]
},
"parts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"ticketId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"partId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"partNumber": {
"type": "string"
},
"description": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"unitPriceCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"coveredByWarranty": {
"type": "boolean"
},
"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"
}
},
"required": [
"id",
"ticketId",
"partId",
"partNumber",
"description",
"quantity",
"unitPriceCents",
"coveredByWarranty",
"createdAt"
],
"additionalProperties": false
}
},
"timeEntries": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"ticketId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"workDate": {
"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"
},
"onsiteHours": {
"type": "number",
"minimum": 0
},
"travelHours": {
"type": "number",
"minimum": 0
},
"travelMiles": {
"type": "number",
"minimum": 0
},
"technicianName": {
"type": "string"
},
"note": {
"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"
}
},
"required": [
"id",
"ticketId",
"workDate",
"onsiteHours",
"travelHours",
"travelMiles",
"technicianName",
"note",
"createdAt"
],
"additionalProperties": false
}
},
"warrantyClaims": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"claimNumber": {
"type": "string"
},
"ticketId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"machineId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"status": {
"type": "string",
"enum": [
"submitted",
"approved",
"denied",
"credited"
]
},
"description": {
"type": [
"string",
"null"
]
},
"amountClaimedCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"creditCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Credit granted to the customer"
},
"submittedOn": {
"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"
},
"decidedOn": {
"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"
}
]
},
"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"
}
},
"required": [
"id",
"claimNumber",
"ticketId",
"machineId",
"accountId",
"status",
"description",
"amountClaimedCents",
"creditCents",
"submittedOn",
"decidedOn",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"documents": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"kind": {
"type": "string",
"enum": [
"signed_quote",
"quote",
"purchase_order",
"drawing",
"manual",
"inspection_report",
"photo",
"training_record",
"invoice",
"email_attachment",
"export",
"other"
]
},
"title": {
"type": "string"
},
"filename": {
"type": "string"
},
"contentType": {
"type": "string"
},
"sizeBytes": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"status": {
"type": "string",
"enum": [
"pending",
"stored"
],
"description": "pending until the file bytes are stored"
},
"accountId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"customerVisible": {
"type": "boolean",
"description": "Whether the customer can open it in the portal"
},
"source": {
"type": "string",
"enum": [
"upload",
"email",
"portal",
"system",
"import"
]
},
"links": {
"type": "array",
"items": {
"type": "object",
"properties": {
"entityType": {
"type": "string",
"enum": [
"account",
"contact",
"site",
"order",
"machine",
"ticket",
"warranty_claim",
"parts_order",
"part",
"opportunity",
"check_in"
]
},
"entityId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"entityType",
"entityId"
],
"additionalProperties": false
}
},
"uploadedByName": {
"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"
}
},
"required": [
"id",
"kind",
"title",
"filename",
"contentType",
"sizeBytes",
"status",
"accountId",
"customerVisible",
"source",
"links",
"uploadedByName",
"createdAt"
],
"additionalProperties": false
}
},
"activities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"type": {
"type": "string",
"enum": [
"call",
"email",
"text",
"visit",
"note",
"system"
]
},
"direction": {
"anyOf": [
{
"type": "string",
"enum": [
"outbound",
"inbound"
]
},
{
"type": "null"
}
]
},
"subject": {
"type": "string"
},
"body": {
"type": [
"string",
"null"
]
},
"occurredAt": {
"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"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"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"
}
]
},
"externalRef": {
"description": "Gmail message id for imported emails; unique",
"type": [
"string",
"null"
]
},
"externalThreadId": {
"type": [
"string",
"null"
]
},
"fromAddress": {
"type": [
"string",
"null"
]
},
"toAddresses": {
"type": "array",
"items": {
"type": "string"
}
},
"durationMinutes": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"documentIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"description": "Attachments stored as documents"
},
"loggedByName": {
"type": "string"
},
"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"
}
},
"required": [
"id",
"type",
"direction",
"subject",
"body",
"occurredAt",
"accountId",
"contactId",
"orderId",
"machineId",
"ticketId",
"externalRef",
"externalThreadId",
"fromAddress",
"toAddresses",
"durationMinutes",
"documentIds",
"loggedByName",
"createdAt"
],
"additionalProperties": false
}
},
"machine": {
"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"
}
},
"required": [
"id",
"serialNumber",
"type",
"model",
"configuration",
"options",
"accountId",
"siteId",
"orderId",
"productId",
"status",
"builtOn",
"shippedOn",
"commissionedOn",
"warrantyStart",
"warrantyEnd",
"warrantyState",
"warrantyDaysLeft",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"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",
"parts",
"timeEntries",
"warrantyClaims",
"documents",
"activities",
"machine"
],
"additionalProperties": false
}
}
tickets.open
Open a service ticket
Open a service ticket on a machine (by machineId or serial number). Priority down means the machine cannot produce: it marks the machine down until the ticket is resolved. The ticket number is assigned automatically and the ticket starts at status new.
Input (object)
| Field | Type | Description |
|---|---|---|
machineId | string | Record id (UUID)min length 1, max length 64 |
serialNumber | string | max length 60 |
titlerequired | string | min length 1, max length 200 |
description | string | null | max length 20000 |
category | "mechanical" | "electrical" | "controls" | "hydraulic" | "pneumatic" | "structural" | "calibration" | "operator_training" | "other" | default "other" |
priority | "low" | "normal" | "high" | "down" | default "normal" |
contactId | string | null | Record id (UUID)min length 1, max length 64 |
assignedToUserId | string | null | Defaults to the callermin length 1, max length 64 |
scheduledFor | string (date) | null | Date as YYYY-MM-DD |
isWarranty | boolean | Defaults to whether the machine is under warranty today |
source | "staff" | "portal" | "email" | "agent" | default "staff" |
Output (object)
| Field | Type | Description |
|---|---|---|
ticketrequired | 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 |
machineEffectrequired | object | |
machinerequired | 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 |
statusChangedrequired | boolean | |
previousStatusrequired | string |
Example request
curl https://api.cemco.app/v1/ops/tickets.open \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"title":"example","machineId":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"machineId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"serialNumber": {
"type": "string",
"maxLength": 60
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"description": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
},
"category": {
"default": "other",
"type": "string",
"enum": [
"mechanical",
"electrical",
"controls",
"hydraulic",
"pneumatic",
"structural",
"calibration",
"operator_training",
"other"
]
},
"priority": {
"default": "normal",
"type": "string",
"enum": [
"low",
"normal",
"high",
"down"
]
},
"contactId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"assignedToUserId": {
"description": "Defaults to the caller",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"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"
}
]
},
"isWarranty": {
"description": "Defaults to whether the machine is under warranty today",
"type": "boolean"
},
"source": {
"default": "staff",
"type": "string",
"enum": [
"staff",
"portal",
"email",
"agent"
]
}
},
"required": [
"title"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticket": {
"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"
}
},
"required": [
"id",
"ticketNumber",
"accountId",
"machineId",
"contactId",
"title",
"description",
"category",
"priority",
"status",
"rootCause",
"resolution",
"source",
"assignedToUserId",
"isWarranty",
"onsiteHours",
"travelHours",
"travelMiles",
"openedAt",
"scheduledFor",
"resolvedAt",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"machineEffect": {
"type": "object",
"properties": {
"machine": {
"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"
}
},
"required": [
"id",
"serialNumber",
"type",
"model",
"configuration",
"options",
"accountId",
"siteId",
"orderId",
"productId",
"status",
"builtOn",
"shippedOn",
"commissionedOn",
"warrantyStart",
"warrantyEnd",
"warrantyState",
"warrantyDaysLeft",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"statusChanged": {
"type": "boolean"
},
"previousStatus": {
"type": "string"
}
},
"required": [
"machine",
"statusChanged",
"previousStatus"
],
"additionalProperties": false
}
},
"required": [
"ticket",
"machineEffect"
],
"additionalProperties": false
}
}
tickets.update
Update a service ticket
Change a ticket's title, description, category, priority, root cause, resolution, assignee, contact, scheduled date or warranty flag. Only the fields you send are changed. Raising the priority to down marks the machine down; lowering it from down returns the machine to operating if no other down ticket is open. Use tickets.set_status to change status.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
title | string | min length 1, max length 200 |
description | string | null | max length 20000 |
category | "mechanical" | "electrical" | "controls" | "hydraulic" | "pneumatic" | "structural" | "calibration" | "operator_training" | "other" | |
priority | "low" | "normal" | "high" | "down" | |
rootCause | "component_failure" | "manufacturing_defect" | "wear" | "operator_error" | "installation" | "shipping_damage" | "environment" | "design" | "unknown" | null | |
resolution | string | null | max length 20000 |
contactId | string | null | Record id (UUID)min length 1, max length 64 |
assignedToUserId | string | null | Record id (UUID)min length 1, max length 64 |
scheduledFor | string (date) | null | Date as YYYY-MM-DD |
isWarranty | boolean |
Output (object)
| Field | Type | Description |
|---|---|---|
ticketrequired | 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 |
machineEffectrequired | object | |
machinerequired | 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 |
statusChangedrequired | boolean | |
previousStatusrequired | string |
Example request
curl https://api.cemco.app/v1/ops/tickets.update \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"id":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"description": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
},
"category": {
"type": "string",
"enum": [
"mechanical",
"electrical",
"controls",
"hydraulic",
"pneumatic",
"structural",
"calibration",
"operator_training",
"other"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high",
"down"
]
},
"rootCause": {
"anyOf": [
{
"type": "string",
"enum": [
"component_failure",
"manufacturing_defect",
"wear",
"operator_error",
"installation",
"shipping_damage",
"environment",
"design",
"unknown"
]
},
{
"type": "null"
}
]
},
"resolution": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
},
"contactId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"assignedToUserId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"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"
}
]
},
"isWarranty": {
"type": "boolean"
}
},
"required": [
"id"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticket": {
"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"
}
},
"required": [
"id",
"ticketNumber",
"accountId",
"machineId",
"contactId",
"title",
"description",
"category",
"priority",
"status",
"rootCause",
"resolution",
"source",
"assignedToUserId",
"isWarranty",
"onsiteHours",
"travelHours",
"travelMiles",
"openedAt",
"scheduledFor",
"resolvedAt",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"machineEffect": {
"type": "object",
"properties": {
"machine": {
"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"
}
},
"required": [
"id",
"serialNumber",
"type",
"model",
"configuration",
"options",
"accountId",
"siteId",
"orderId",
"productId",
"status",
"builtOn",
"shippedOn",
"commissionedOn",
"warrantyStart",
"warrantyEnd",
"warrantyState",
"warrantyDaysLeft",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"statusChanged": {
"type": "boolean"
},
"previousStatus": {
"type": "string"
}
},
"required": [
"machine",
"statusChanged",
"previousStatus"
],
"additionalProperties": false
}
},
"required": [
"ticket",
"machineEffect"
],
"additionalProperties": false
}
}
tickets.set_status
Change a ticket's status
Move a ticket to any status: new, diagnosing, parts_on_order, scheduled, waiting_on_customer, resolved, follow_up_complete. This is what a drag on the service board does. Resolving a down ticket returns its machine to operating (unless another down ticket is still open); reopening a down ticket marks the machine down again. Resolving records the resolved time; a root cause and resolution can be given in the same call.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
statusrequired | "new" | "diagnosing" | "parts_on_order" | "scheduled" | "waiting_on_customer" | "resolved" | "follow_up_complete" | |
rootCause | "component_failure" | "manufacturing_defect" | "wear" | "operator_error" | "installation" | "shipping_damage" | "environment" | "design" | "unknown" | |
resolution | string | max length 20000 |
scheduledFor | string (date) | null | Date as YYYY-MM-DD |
note | string | null | max length 2000 |
Output (object)
| Field | Type | Description |
|---|---|---|
ticketrequired | 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 |
previousStatusrequired | "new" | "diagnosing" | "parts_on_order" | "scheduled" | "waiting_on_customer" | "resolved" | "follow_up_complete" | |
machineEffectrequired | object | |
machinerequired | 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 |
statusChangedrequired | boolean | |
previousStatusrequired | string |
Example request
curl https://api.cemco.app/v1/ops/tickets.set_status \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"id":"00000000-0000-4000-8000-000000000000","status":"new"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"status": {
"type": "string",
"enum": [
"new",
"diagnosing",
"parts_on_order",
"scheduled",
"waiting_on_customer",
"resolved",
"follow_up_complete"
]
},
"rootCause": {
"type": "string",
"enum": [
"component_failure",
"manufacturing_defect",
"wear",
"operator_error",
"installation",
"shipping_damage",
"environment",
"design",
"unknown"
]
},
"resolution": {
"type": "string",
"maxLength": 20000
},
"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"
}
]
},
"note": {
"anyOf": [
{
"type": "string",
"maxLength": 2000
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"status"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticket": {
"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"
}
},
"required": [
"id",
"ticketNumber",
"accountId",
"machineId",
"contactId",
"title",
"description",
"category",
"priority",
"status",
"rootCause",
"resolution",
"source",
"assignedToUserId",
"isWarranty",
"onsiteHours",
"travelHours",
"travelMiles",
"openedAt",
"scheduledFor",
"resolvedAt",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"previousStatus": {
"type": "string",
"enum": [
"new",
"diagnosing",
"parts_on_order",
"scheduled",
"waiting_on_customer",
"resolved",
"follow_up_complete"
]
},
"machineEffect": {
"type": "object",
"properties": {
"machine": {
"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"
}
},
"required": [
"id",
"serialNumber",
"type",
"model",
"configuration",
"options",
"accountId",
"siteId",
"orderId",
"productId",
"status",
"builtOn",
"shippedOn",
"commissionedOn",
"warrantyStart",
"warrantyEnd",
"warrantyState",
"warrantyDaysLeft",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"statusChanged": {
"type": "boolean"
},
"previousStatus": {
"type": "string"
}
},
"required": [
"machine",
"statusChanged",
"previousStatus"
],
"additionalProperties": false
}
},
"required": [
"ticket",
"previousStatus",
"machineEffect"
],
"additionalProperties": false
}
}
tickets.log_parts
Log parts used on a ticket
Record parts used to fix a ticket, by part id or part number. With deductStock true (the default) each part is taken out of stock through a ledger row. Parts on a warranty ticket are marked covered unless stated otherwise.
Input (object)
| Field | Type | Description |
|---|---|---|
ticketIdrequired | string | Record id (UUID)min length 1, max length 64 |
partsrequired | object[] | at least 1 |
partId | string | Record id (UUID)min length 1, max length 64 |
partNumber | string | max length 60 |
quantity | integer | default 1, min 1, max 9007199254740991 |
unitPriceCents | integer | Defaults to the catalog pricemin 0, max 9007199254740991 |
coveredByWarranty | boolean | |
deductStock | boolean | default true |
Output (object)
| Field | Type | Description |
|---|---|---|
partsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | Record id (UUID)min length 1, max length 64 |
partIdrequired | string | Record id (UUID)min length 1, max length 64 |
partNumberrequired | string | |
descriptionrequired | string | |
quantityrequired | integer | min 1, max 9007199254740991 |
unitPriceCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
coveredByWarrantyrequired | boolean | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
stockMovementIdsrequired | string[] | |
lowStockPartNumbersrequired | string[] | Parts now at or below their reorder point |
Example request
curl https://api.cemco.app/v1/ops/tickets.log_parts \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"ticketId":"00000000-0000-4000-8000-000000000000","parts":[{"partId":"00000000-0000-4000-8000-000000000000"}]}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticketId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"parts": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"partId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"partNumber": {
"type": "string",
"maxLength": 60
},
"quantity": {
"default": 1,
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"unitPriceCents": {
"description": "Defaults to the catalog price",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"coveredByWarranty": {
"type": "boolean"
}
}
}
},
"deductStock": {
"default": true,
"type": "boolean"
}
},
"required": [
"ticketId",
"parts"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"parts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"ticketId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"partId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"partNumber": {
"type": "string"
},
"description": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"unitPriceCents": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Amount in integer US cents (zero or more)"
},
"coveredByWarranty": {
"type": "boolean"
},
"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"
}
},
"required": [
"id",
"ticketId",
"partId",
"partNumber",
"description",
"quantity",
"unitPriceCents",
"coveredByWarranty",
"createdAt"
],
"additionalProperties": false
}
},
"stockMovementIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"lowStockPartNumbers": {
"type": "array",
"items": {
"type": "string"
},
"description": "Parts now at or below their reorder point"
}
},
"required": [
"parts",
"stockMovementIds",
"lowStockPartNumbers"
],
"additionalProperties": false
}
}
tickets.remove_part
Remove a part from a ticket
Remove a part line logged on a ticket by mistake. If stock was deducted for it, the stock is returned through a ledger row.
Input (object)
| Field | Type | Description |
|---|---|---|
ticketPartIdrequired | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
okrequired | true | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
Example request
curl https://api.cemco.app/v1/ops/tickets.remove_part \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"ticketPartId":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticketPartId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"ticketPartId"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"ok",
"id"
],
"additionalProperties": false
}
}
tickets.log_time
Log time and travel on a ticket
Record on-site hours, travel hours and travel miles for a day of work on a ticket. The ticket's totals are the sum of its time entries.
Input (object)
| Field | Type | Description |
|---|---|---|
ticketIdrequired | string | Record id (UUID)min length 1, max length 64 |
workDate | string (date) | Defaults to today |
onsiteHours | number | default 0, min 0, max 24 |
travelHours | number | default 0, min 0, max 48 |
travelMiles | number | default 0, min 0, max 10000 |
technicianName | string | Defaults to the caller's namemax length 200 |
note | string | null | max length 2000 |
Output (object)
| Field | Type | Description |
|---|---|---|
entryrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | Record id (UUID)min length 1, max length 64 |
workDaterequired | string (date) | Date as YYYY-MM-DD |
onsiteHoursrequired | number | min 0 |
travelHoursrequired | number | min 0 |
travelMilesrequired | number | min 0 |
technicianNamerequired | string | |
noterequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
ticketrequired | 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 |
Example request
curl https://api.cemco.app/v1/ops/tickets.log_time \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"ticketId":"00000000-0000-4000-8000-000000000000","onsiteHours":1}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ticketId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"workDate": {
"description": "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])))$"
},
"onsiteHours": {
"default": 0,
"type": "number",
"minimum": 0,
"maximum": 24
},
"travelHours": {
"default": 0,
"type": "number",
"minimum": 0,
"maximum": 48
},
"travelMiles": {
"default": 0,
"type": "number",
"minimum": 0,
"maximum": 10000
},
"technicianName": {
"description": "Defaults to the caller's name",
"type": "string",
"maxLength": 200
},
"note": {
"anyOf": [
{
"type": "string",
"maxLength": 2000
},
{
"type": "null"
}
]
}
},
"required": [
"ticketId"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"entry": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"ticketId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"workDate": {
"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"
},
"onsiteHours": {
"type": "number",
"minimum": 0
},
"travelHours": {
"type": "number",
"minimum": 0
},
"travelMiles": {
"type": "number",
"minimum": 0
},
"technicianName": {
"type": "string"
},
"note": {
"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"
}
},
"required": [
"id",
"ticketId",
"workDate",
"onsiteHours",
"travelHours",
"travelMiles",
"technicianName",
"note",
"createdAt"
],
"additionalProperties": false
},
"ticket": {
"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"
}
},
"required": [
"id",
"ticketNumber",
"accountId",
"machineId",
"contactId",
"title",
"description",
"category",
"priority",
"status",
"rootCause",
"resolution",
"source",
"assignedToUserId",
"isWarranty",
"onsiteHours",
"travelHours",
"travelMiles",
"openedAt",
"scheduledFor",
"resolvedAt",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"entry",
"ticket"
],
"additionalProperties": false
}
}