Skip to content

Accounts

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

Search or list customer accounts

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

Find customer accounts by name, city, state or contact, or list them all when no query is given. Returns one row per account with counts of machines, open orders and open tickets and the days since last contact. Use this first to get an account id before calling accounts.get.

Input (object)

FieldTypeDescription
querystringFree text matched against name, city, state and contact namesmax length 200
segment"concrete_producer" | "multiservice"
status"active" | "prospect" | "inactive"
statestringHQ state code, for example TXmax length 40
health"good" | "watch" | "at_risk"Only accounts at this health level
notContactedInDaysintegerOnly accounts with no call, email, text or visit in this many daysmin 1, max 9007199254740991
sort"name" | "last_contacted" | "created"default "name"
limitintegerMaximum rows to return (default 50, max 500)default 50, min 1, max 500
offsetintegerRows to skip, for pagingdefault 0, min 0, max 9007199254740991

Output (object)

FieldTypeDescription
itemsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
namerequiredstring
normalizedNamerequiredstringLower-cased name without punctuation or company suffixes; used for duplicate checks
segmentrequired"concrete_producer" | "multiservice"
statusrequired"active" | "prospect" | "inactive"
phonerequiredstring | null
websiterequiredstring | null
hqLine1requiredstring | null
hqLine2requiredstring | null
hqCityrequiredstring | null
hqStaterequiredstring | nullTwo-letter US state or region code
hqPostalCoderequiredstring | null
hqCountryrequiredstring | null
hubspotCompanyIdrequiredstring | null
ownerUserIdrequiredstring | nullStaff user who owns the accountmin length 1, max length 64
notesrequiredstring | null
lastContactedAtrequiredstring (date-time) | nullMost recent call, email, text or visit
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
machineCountrequiredintegermin -9007199254740991, max 9007199254740991
openOrderCountrequiredintegermin -9007199254740991, max 9007199254740991
openTicketCountrequiredintegermin -9007199254740991, max 9007199254740991
primaryContactNamerequiredstring | null
daysSinceContactrequiredinteger | nullmin -9007199254740991, max 9007199254740991
totalrequiredintegerTotal rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991
limitrequiredintegermin -9007199254740991, max 9007199254740991
offsetrequiredintegermin -9007199254740991, max 9007199254740991
Example request
                curl https://api.cemco.app/v1/ops/accounts.search \
  -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": {
      "query": {
        "description": "Free text matched against name, city, state and contact names",
        "type": "string",
        "maxLength": 200
      },
      "segment": {
        "type": "string",
        "enum": [
          "concrete_producer",
          "multiservice"
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "active",
          "prospect",
          "inactive"
        ]
      },
      "state": {
        "description": "HQ state code, for example TX",
        "type": "string",
        "maxLength": 40
      },
      "health": {
        "description": "Only accounts at this health level",
        "type": "string",
        "enum": [
          "good",
          "watch",
          "at_risk"
        ]
      },
      "notContactedInDays": {
        "description": "Only accounts with no call, email, text or visit in this many days",
        "type": "integer",
        "minimum": 1,
        "maximum": 9007199254740991
      },
      "sort": {
        "default": "name",
        "type": "string",
        "enum": [
          "name",
          "last_contacted",
          "created"
        ]
      },
      "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)"
            },
            "name": {
              "type": "string"
            },
            "normalizedName": {
              "type": "string",
              "description": "Lower-cased name without punctuation or company suffixes; used for duplicate checks"
            },
            "segment": {
              "type": "string",
              "enum": [
                "concrete_producer",
                "multiservice"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "active",
                "prospect",
                "inactive"
              ]
            },
            "phone": {
              "type": [
                "string",
                "null"
              ]
            },
            "website": {
              "type": [
                "string",
                "null"
              ]
            },
            "hqLine1": {
              "type": [
                "string",
                "null"
              ]
            },
            "hqLine2": {
              "type": [
                "string",
                "null"
              ]
            },
            "hqCity": {
              "type": [
                "string",
                "null"
              ]
            },
            "hqState": {
              "description": "Two-letter US state or region code",
              "type": [
                "string",
                "null"
              ]
            },
            "hqPostalCode": {
              "type": [
                "string",
                "null"
              ]
            },
            "hqCountry": {
              "type": [
                "string",
                "null"
              ]
            },
            "hubspotCompanyId": {
              "type": [
                "string",
                "null"
              ]
            },
            "ownerUserId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Staff user who owns the account"
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            },
            "lastContactedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "UTC timestamp, ISO 8601 with Z"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Most recent call, email, text or visit"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "machineCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "openOrderCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "openTicketCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "primaryContactName": {
              "type": [
                "string",
                "null"
              ]
            },
            "daysSinceContact": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "id",
            "name",
            "normalizedName",
            "segment",
            "status",
            "phone",
            "website",
            "hqLine1",
            "hqLine2",
            "hqCity",
            "hqState",
            "hqPostalCode",
            "hqCountry",
            "hubspotCompanyId",
            "ownerUserId",
            "notes",
            "lastContactedAt",
            "createdAt",
            "updatedAt",
            "machineCount",
            "openOrderCount",
            "openTicketCount",
            "primaryContactName",
            "daysSinceContact"
          ],
          "additionalProperties": false
        }
      },
      "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
  }
}
            

accounts.get

Get the full account overview

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

Everything on one customer account: profile, health, contacts, sites, machines with warranty status, orders, open tickets, parts orders, open tasks, the 50 most recent activities, opportunities, documents and portal users. This is the data behind the account page.

Input (object)

FieldTypeDescription
idrequiredstringAccount idmin length 1, max length 64

Output (object)

FieldTypeDescription
accountrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
namerequiredstring
normalizedNamerequiredstringLower-cased name without punctuation or company suffixes; used for duplicate checks
segmentrequired"concrete_producer" | "multiservice"
statusrequired"active" | "prospect" | "inactive"
phonerequiredstring | null
websiterequiredstring | null
hqLine1requiredstring | null
hqLine2requiredstring | null
hqCityrequiredstring | null
hqStaterequiredstring | nullTwo-letter US state or region code
hqPostalCoderequiredstring | null
hqCountryrequiredstring | null
hubspotCompanyIdrequiredstring | null
ownerUserIdrequiredstring | nullStaff user who owns the accountmin length 1, max length 64
notesrequiredstring | null
lastContactedAtrequiredstring (date-time) | nullMost recent call, email, text or visit
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
healthrequiredobject
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
scorerequiredinteger100 is healthiestmin 0, max 100
levelrequired"good" | "watch" | "at_risk"
openTicketsrequiredintegermin -9007199254740991, max 9007199254740991
downMachinesrequiredintegermin -9007199254740991, max 9007199254740991
downtimeDays90requirednumberMachine-days down in the last 90 days
partsSpendCents365requiredintegerParts ordered in the last 365 daysmin 0, max 9007199254740991
daysSinceContactrequiredinteger | nullmin -9007199254740991, max 9007199254740991
machinesUnderWarrantyrequiredintegermin -9007199254740991, max 9007199254740991
warrantiesExpiringSoonrequiredintegermin -9007199254740991, max 9007199254740991
overdueTasksrequiredintegermin -9007199254740991, max 9007199254740991
reasonsrequiredstring[]Plain-language reasons behind the score
contactsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
firstNamerequiredstring
lastNamerequiredstring
rolerequiredstring | nullJob title or role at the customer, for example Plant manager
emailrequiredstring | null
mobilerequiredstring | null
phonerequiredstring | null
preferredChannelrequired"email" | "phone" | "text"
isPrimaryrequiredboolean
hubspotContactIdrequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
sitesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
namerequiredstring
line1requiredstring | null
line2requiredstring | null
cityrequiredstring | null
staterequiredstring | null
postalCoderequiredstring | null
countryrequiredstring | null
latituderequirednumber | nullmin -90, max 90
longituderequirednumber | nullmin -180, max 180
powerSourcerequiredstring | nullFor example utility 480V three-phase, or generator
waterSourcerequiredstring | nullFor example municipal, well, hauled
activeFromrequiredstring (date) | nullDate as YYYY-MM-DD
activeTorequiredstring (date) | nullSet when the site is no longer used
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
machinesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
serialNumberrequiredstring
typerequired"plant" | "mixer" | "silo" | "feeder" | "power_pack"
modelrequiredstring
configurationrequiredstring | null
optionsrequiredstring[]
accountIdrequiredstringCurrent ownermin length 1, max length 64
siteIdrequiredstring | nullCurrent sitemin length 1, max length 64
orderIdrequiredstring | nullOrder the machine was built formin length 1, max length 64
productIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"in_build" | "in_transit" | "operating" | "down" | "idle" | "retired"
builtOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
commissionedOnrequiredstring (date) | nullDate as YYYY-MM-DD
warrantyStartrequiredstring (date) | nullDate as YYYY-MM-DD
warrantyEndrequiredstring (date) | nullDate as YYYY-MM-DD
warrantyStaterequired"none" | "active" | "expiring" | "expired"Computed from the warranty dates and today's date
warrantyDaysLeftrequiredinteger | nullDays until the warranty ends; negative once expired; null if not startedmin -9007199254740991, max 9007199254740991
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
siteNamerequiredstring | null
siteCityrequiredstring | null
siteStaterequiredstring | null
latituderequirednumber | null
longituderequirednumber | null
openTicketCountrequiredintegermin -9007199254740991, max 9007199254740991
ordersrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
siteIdrequiredstring | nullDelivery sitemin length 1, max length 64
titlerequiredstring | null
stagerequired"received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed"
stageDatesrequiredobjectDate each stage was reached; null if not yet
receivedrequiredstring (date) | nullDate as YYYY-MM-DD
in_buildrequiredstring (date) | nullDate as YYYY-MM-DD
ready_to_shiprequiredstring (date) | nullDate as YYYY-MM-DD
shippedrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredrequiredstring (date) | nullDate as YYYY-MM-DD
set_uprequiredstring (date) | nullDate as YYYY-MM-DD
commissionedrequiredstring (date) | nullDate as YYYY-MM-DD
trainedrequiredstring (date) | nullDate as YYYY-MM-DD
closedrequiredstring (date) | nullDate as YYYY-MM-DD
signedQuoteDocumentIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
signedQuoteReceivedOnrequiredstring (date) | nullDate as YYYY-MM-DD
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
balanceRemainingCentsrequiredinteger | nullNull until someone records it; 0 means paid in fullmin 0, max 9007199254740991
isValidrequiredboolean
financingPartnerrequired"none" | "commercial_capital" | "northland_capital" | "other"
financingStatusrequired"not_applicable" | "pending" | "approved" | "declined" | "funded"
financingNotesrequiredstring | null
poNumberrequiredstring | null
expectedShipOnrequiredstring (date) | nullDate as YYYY-MM-DD
ownerUserIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
siteNamerequiredstring | null
missingrequired("signed_quote" | "signed_quote_received_on" | "balance_remaining")[]
nextStagerequired"received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | null
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
machineCountrequiredintegermin -9007199254740991, max 9007199254740991
openTicketsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
ticketNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
machineIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
titlerequiredstring
descriptionrequiredstring | 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
resolutionrequiredstring | null
sourcerequired"staff" | "portal" | "email" | "agent"
assignedToUserIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
isWarrantyrequiredbooleanWhether the work is covered by warranty
onsiteHoursrequirednumberTotal on-site hours loggedmin 0
travelHoursrequirednumberTotal travel hours loggedmin 0
travelMilesrequirednumberTotal travel miles loggedmin 0
openedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
scheduledForrequiredstring (date) | nullDate as YYYY-MM-DD
resolvedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
machineSerialNumberrequiredstring
machineModelrequiredstring
assignedToNamerequiredstring | null
partsOrdersrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
orderNumberrequiredstring
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
statusrequired"quote" | "ordered" | "shipped" | "delivered" | "cancelled"
subtotalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
shippingCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
taxCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
totalCentsrequiredintegerAmount in integer US cents (zero or more)min 0, max 9007199254740991
quotedOnrequiredstring (date)Date as YYYY-MM-DD
quoteValidUntilrequiredstring (date) | nullDate as YYYY-MM-DD
orderedOnrequiredstring (date) | nullDate as YYYY-MM-DD
shippedOnrequiredstring (date) | nullDate as YYYY-MM-DD
deliveredOnrequiredstring (date) | nullDate as YYYY-MM-DD
carrierrequiredstring | null
trackingNumberrequiredstring | null
shipToNamerequiredstring | null
shipToAddressrequiredstring | null
customerPorequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
lineCountrequiredintegermin -9007199254740991, max 9007199254740991
tasksrequiredobject[]Open tasks, soonest first
idrequiredstringRecord id (UUID)min length 1, max length 64
typerequired"task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in"
titlerequiredstring
notesrequiredstring | null
statusrequired"open" | "done" | "cancelled"
dueOnrequiredstring (date)Day the task is due or the appointment happens
startsAtrequiredstring (date-time) | nullStart time for timed appointments; null for all-day items
endsAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
locationrequiredstring | null
assignedToUserIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
assignedToNamerequiredstring | null
accountIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
accountNamerequiredstring | null
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
orderIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
siteIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
checkInIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
isOverduerequiredbooleanOpen and due before today
googleEventIdrequiredstring | null
syncStaterequired"not_synced" | "pending" | "synced" | "error"
syncedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
syncErrorrequiredstring | null
completedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
activitiesrequiredobject[]Most recent 50 timeline entries
idrequiredstringRecord id (UUID)min length 1, max length 64
typerequired"call" | "email" | "text" | "visit" | "note" | "system"
directionrequired"outbound" | "inbound" | null
subjectrequiredstring
bodyrequiredstring | null
occurredAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
orderIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
machineIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
ticketIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
externalRefrequiredstring | nullGmail message id for imported emails; unique
externalThreadIdrequiredstring | null
fromAddressrequiredstring | null
toAddressesrequiredstring[]
durationMinutesrequiredinteger | nullmin 0, max 9007199254740991
documentIdsrequiredstring[]Attachments stored as documents
loggedByNamerequiredstring
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
opportunitiesrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
accountNamerequiredstring
titlerequiredstring
descriptionrequiredstring | null
productIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
productNamerequiredstring | null
machineIdrequiredstring | nullMachine that prompted the add-on, if anymin length 1, max length 64
estimatedValueCentsrequiredinteger | nullAmount in integer US cents (zero or more)min 0, max 9007199254740991
statusrequired"open" | "handed_to_sales" | "won" | "lost"
handedToSalesOnrequiredstring (date) | nullDate as YYYY-MM-DD
salesContactrequiredstring | nullSales person the opportunity was handed to
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
documentsrequiredobject[]
idrequiredstringRecord 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"
titlerequiredstring
filenamerequiredstring
contentTyperequiredstring
sizeBytesrequiredintegermin 0, max 9007199254740991
statusrequired"pending" | "stored"pending until the file bytes are stored
accountIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
customerVisiblerequiredbooleanWhether the customer can open it in the portal
sourcerequired"upload" | "email" | "portal" | "system" | "import"
linksrequiredobject[]
entityTyperequired"account" | "contact" | "site" | "order" | "machine" | "ticket" | "warranty_claim" | "parts_order" | "part" | "opportunity" | "check_in"
entityIdrequiredstringRecord id (UUID)min length 1, max length 64
uploadedByNamerequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
portalUsersrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
accountNamerequiredstring
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/accounts.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": "Account id"
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "name": {
            "type": "string"
          },
          "normalizedName": {
            "type": "string",
            "description": "Lower-cased name without punctuation or company suffixes; used for duplicate checks"
          },
          "segment": {
            "type": "string",
            "enum": [
              "concrete_producer",
              "multiservice"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "prospect",
              "inactive"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqLine1": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqLine2": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqCity": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqState": {
            "description": "Two-letter US state or region code",
            "type": [
              "string",
              "null"
            ]
          },
          "hqPostalCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqCountry": {
            "type": [
              "string",
              "null"
            ]
          },
          "hubspotCompanyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ownerUserId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ],
            "description": "Staff user who owns the account"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastContactedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                "description": "UTC timestamp, ISO 8601 with Z"
              },
              {
                "type": "null"
              }
            ],
            "description": "Most recent call, email, text or visit"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          }
        },
        "required": [
          "id",
          "name",
          "normalizedName",
          "segment",
          "status",
          "phone",
          "website",
          "hqLine1",
          "hqLine2",
          "hqCity",
          "hqState",
          "hqPostalCode",
          "hqCountry",
          "hubspotCompanyId",
          "ownerUserId",
          "notes",
          "lastContactedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "health": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "100 is healthiest"
          },
          "level": {
            "type": "string",
            "enum": [
              "good",
              "watch",
              "at_risk"
            ]
          },
          "openTickets": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "downMachines": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "downtimeDays90": {
            "type": "number",
            "description": "Machine-days down in the last 90 days"
          },
          "partsSpendCents365": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Parts ordered in the last 365 days"
          },
          "daysSinceContact": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "machinesUnderWarranty": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "warrantiesExpiringSoon": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "overdueTasks": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Plain-language reasons behind the score"
          }
        },
        "required": [
          "accountId",
          "score",
          "level",
          "openTickets",
          "downMachines",
          "downtimeDays90",
          "partsSpendCents365",
          "daysSinceContact",
          "machinesUnderWarranty",
          "warrantiesExpiringSoon",
          "overdueTasks",
          "reasons"
        ],
        "additionalProperties": false
      },
      "contacts": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "accountId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "firstName": {
              "type": "string"
            },
            "lastName": {
              "type": "string"
            },
            "role": {
              "description": "Job title or role at the customer, for example Plant manager",
              "type": [
                "string",
                "null"
              ]
            },
            "email": {
              "type": [
                "string",
                "null"
              ]
            },
            "mobile": {
              "type": [
                "string",
                "null"
              ]
            },
            "phone": {
              "type": [
                "string",
                "null"
              ]
            },
            "preferredChannel": {
              "type": "string",
              "enum": [
                "email",
                "phone",
                "text"
              ]
            },
            "isPrimary": {
              "type": "boolean"
            },
            "hubspotContactId": {
              "type": [
                "string",
                "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",
            "accountId",
            "firstName",
            "lastName",
            "role",
            "email",
            "mobile",
            "phone",
            "preferredChannel",
            "isPrimary",
            "hubspotContactId",
            "notes",
            "createdAt",
            "updatedAt"
          ],
          "additionalProperties": false
        }
      },
      "sites": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "accountId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "name": {
              "type": "string"
            },
            "line1": {
              "type": [
                "string",
                "null"
              ]
            },
            "line2": {
              "type": [
                "string",
                "null"
              ]
            },
            "city": {
              "type": [
                "string",
                "null"
              ]
            },
            "state": {
              "type": [
                "string",
                "null"
              ]
            },
            "postalCode": {
              "type": [
                "string",
                "null"
              ]
            },
            "country": {
              "type": [
                "string",
                "null"
              ]
            },
            "latitude": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                {
                  "type": "null"
                }
              ]
            },
            "longitude": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                },
                {
                  "type": "null"
                }
              ]
            },
            "powerSource": {
              "description": "For example utility 480V three-phase, or generator",
              "type": [
                "string",
                "null"
              ]
            },
            "waterSource": {
              "description": "For example municipal, well, hauled",
              "type": [
                "string",
                "null"
              ]
            },
            "activeFrom": {
              "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"
                }
              ]
            },
            "activeTo": {
              "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"
                }
              ],
              "description": "Set when the site is no longer used"
            },
            "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",
            "accountId",
            "name",
            "line1",
            "line2",
            "city",
            "state",
            "postalCode",
            "country",
            "latitude",
            "longitude",
            "powerSource",
            "waterSource",
            "activeFrom",
            "activeTo",
            "notes",
            "createdAt",
            "updatedAt"
          ],
          "additionalProperties": false
        }
      },
      "machines": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "serialNumber": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "plant",
                "mixer",
                "silo",
                "feeder",
                "power_pack"
              ]
            },
            "model": {
              "type": "string"
            },
            "configuration": {
              "type": [
                "string",
                "null"
              ]
            },
            "options": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "accountId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Current owner"
            },
            "siteId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Current site"
            },
            "orderId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Order the machine was built for"
            },
            "productId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "in_build",
                "in_transit",
                "operating",
                "down",
                "idle",
                "retired"
              ]
            },
            "builtOn": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "Date as YYYY-MM-DD"
                },
                {
                  "type": "null"
                }
              ]
            },
            "shippedOn": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "Date as YYYY-MM-DD"
                },
                {
                  "type": "null"
                }
              ]
            },
            "commissionedOn": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "Date as YYYY-MM-DD"
                },
                {
                  "type": "null"
                }
              ]
            },
            "warrantyStart": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "Date as YYYY-MM-DD"
                },
                {
                  "type": "null"
                }
              ]
            },
            "warrantyEnd": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "Date as YYYY-MM-DD"
                },
                {
                  "type": "null"
                }
              ]
            },
            "warrantyState": {
              "type": "string",
              "enum": [
                "none",
                "active",
                "expiring",
                "expired"
              ],
              "description": "Computed from the warranty dates and today's date"
            },
            "warrantyDaysLeft": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ],
              "description": "Days until the warranty ends; negative once expired; null if not started"
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "accountName": {
              "type": "string"
            },
            "siteName": {
              "type": [
                "string",
                "null"
              ]
            },
            "siteCity": {
              "type": [
                "string",
                "null"
              ]
            },
            "siteState": {
              "type": [
                "string",
                "null"
              ]
            },
            "latitude": {
              "type": [
                "number",
                "null"
              ]
            },
            "longitude": {
              "type": [
                "number",
                "null"
              ]
            },
            "openTicketCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "id",
            "serialNumber",
            "type",
            "model",
            "configuration",
            "options",
            "accountId",
            "siteId",
            "orderId",
            "productId",
            "status",
            "builtOn",
            "shippedOn",
            "commissionedOn",
            "warrantyStart",
            "warrantyEnd",
            "warrantyState",
            "warrantyDaysLeft",
            "notes",
            "createdAt",
            "updatedAt",
            "accountName",
            "siteName",
            "siteCity",
            "siteState",
            "latitude",
            "longitude",
            "openTicketCount"
          ],
          "additionalProperties": false
        }
      },
      "orders": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "orderNumber": {
              "type": "string"
            },
            "accountId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "siteId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Delivery site"
            },
            "title": {
              "type": [
                "string",
                "null"
              ]
            },
            "stage": {
              "type": "string",
              "enum": [
                "received",
                "in_build",
                "ready_to_ship",
                "shipped",
                "delivered",
                "set_up",
                "commissioned",
                "trained",
                "closed"
              ]
            },
            "stageDates": {
              "type": "object",
              "properties": {
                "received": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "in_build": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ready_to_ship": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "shipped": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "delivered": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "set_up": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "commissioned": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "trained": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "closed": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                      "description": "Date as YYYY-MM-DD"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "received",
                "in_build",
                "ready_to_ship",
                "shipped",
                "delivered",
                "set_up",
                "commissioned",
                "trained",
                "closed"
              ],
              "additionalProperties": false,
              "description": "Date each stage was reached; null if not yet"
            },
            "signedQuoteDocumentId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "signedQuoteReceivedOn": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "Date as YYYY-MM-DD"
                },
                {
                  "type": "null"
                }
              ]
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "balanceRemainingCents": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Null until someone records it; 0 means paid in full"
            },
            "isValid": {
              "type": "boolean"
            },
            "financingPartner": {
              "type": "string",
              "enum": [
                "none",
                "commercial_capital",
                "northland_capital",
                "other"
              ]
            },
            "financingStatus": {
              "type": "string",
              "enum": [
                "not_applicable",
                "pending",
                "approved",
                "declined",
                "funded"
              ]
            },
            "financingNotes": {
              "type": [
                "string",
                "null"
              ]
            },
            "poNumber": {
              "type": [
                "string",
                "null"
              ]
            },
            "expectedShipOn": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                  "description": "Date as YYYY-MM-DD"
                },
                {
                  "type": "null"
                }
              ]
            },
            "ownerUserId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "accountName": {
              "type": "string"
            },
            "siteName": {
              "type": [
                "string",
                "null"
              ]
            },
            "missing": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "signed_quote",
                  "signed_quote_received_on",
                  "balance_remaining"
                ]
              }
            },
            "nextStage": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "received",
                    "in_build",
                    "ready_to_ship",
                    "shipped",
                    "delivered",
                    "set_up",
                    "commissioned",
                    "trained",
                    "closed"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "lineCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "machineCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "id",
            "orderNumber",
            "accountId",
            "siteId",
            "title",
            "stage",
            "stageDates",
            "signedQuoteDocumentId",
            "signedQuoteReceivedOn",
            "totalCents",
            "balanceRemainingCents",
            "isValid",
            "financingPartner",
            "financingStatus",
            "financingNotes",
            "poNumber",
            "expectedShipOn",
            "ownerUserId",
            "notes",
            "createdAt",
            "updatedAt",
            "accountName",
            "siteName",
            "missing",
            "nextStage",
            "lineCount",
            "machineCount"
          ],
          "additionalProperties": false
        }
      },
      "openTickets": {
        "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
        }
      },
      "partsOrders": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "orderNumber": {
              "type": "string"
            },
            "accountId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "contactId": {
              "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"
                }
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "quote",
                "ordered",
                "shipped",
                "delivered",
                "cancelled"
              ]
            },
            "subtotalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "shippingCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "taxCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "totalCents": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Amount in integer US cents (zero or more)"
            },
            "quotedOn": {
              "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"
            },
            "quoteValidUntil": {
              "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"
                }
              ]
            },
            "orderedOn": {
              "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"
                }
              ]
            },
            "deliveredOn": {
              "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"
                }
              ]
            },
            "carrier": {
              "type": [
                "string",
                "null"
              ]
            },
            "trackingNumber": {
              "type": [
                "string",
                "null"
              ]
            },
            "shipToName": {
              "type": [
                "string",
                "null"
              ]
            },
            "shipToAddress": {
              "type": [
                "string",
                "null"
              ]
            },
            "customerPo": {
              "type": [
                "string",
                "null"
              ]
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "accountName": {
              "type": "string"
            },
            "lineCount": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "id",
            "orderNumber",
            "accountId",
            "contactId",
            "machineId",
            "ticketId",
            "status",
            "subtotalCents",
            "shippingCents",
            "taxCents",
            "totalCents",
            "quotedOn",
            "quoteValidUntil",
            "orderedOn",
            "shippedOn",
            "deliveredOn",
            "carrier",
            "trackingNumber",
            "shipToName",
            "shipToAddress",
            "customerPo",
            "notes",
            "createdAt",
            "updatedAt",
            "accountName",
            "lineCount"
          ],
          "additionalProperties": false
        }
      },
      "tasks": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "type": {
              "type": "string",
              "enum": [
                "task",
                "call",
                "visit",
                "delivery",
                "commissioning",
                "service",
                "check_in"
              ]
            },
            "title": {
              "type": "string"
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "open",
                "done",
                "cancelled"
              ]
            },
            "dueOn": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
              "description": "Day the task is due or the appointment happens"
            },
            "startsAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "UTC timestamp, ISO 8601 with Z"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start time for timed appointments; null for all-day items"
            },
            "endsAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "UTC timestamp, ISO 8601 with Z"
                },
                {
                  "type": "null"
                }
              ]
            },
            "location": {
              "type": [
                "string",
                "null"
              ]
            },
            "assignedToUserId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "assignedToName": {
              "type": [
                "string",
                "null"
              ]
            },
            "accountId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "accountName": {
              "type": [
                "string",
                "null"
              ]
            },
            "contactId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "orderId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "machineId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "ticketId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "siteId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "checkInId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "isOverdue": {
              "type": "boolean",
              "description": "Open and due before today"
            },
            "googleEventId": {
              "type": [
                "string",
                "null"
              ]
            },
            "syncState": {
              "type": "string",
              "enum": [
                "not_synced",
                "pending",
                "synced",
                "error"
              ]
            },
            "syncedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "UTC timestamp, ISO 8601 with Z"
                },
                {
                  "type": "null"
                }
              ]
            },
            "syncError": {
              "type": [
                "string",
                "null"
              ]
            },
            "completedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "UTC timestamp, ISO 8601 with Z"
                },
                {
                  "type": "null"
                }
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "UTC timestamp, ISO 8601 with Z"
            }
          },
          "required": [
            "id",
            "type",
            "title",
            "notes",
            "status",
            "dueOn",
            "startsAt",
            "endsAt",
            "location",
            "assignedToUserId",
            "assignedToName",
            "accountId",
            "accountName",
            "contactId",
            "orderId",
            "machineId",
            "ticketId",
            "siteId",
            "checkInId",
            "isOverdue",
            "googleEventId",
            "syncState",
            "syncedAt",
            "syncError",
            "completedAt",
            "createdAt",
            "updatedAt"
          ],
          "additionalProperties": false
        },
        "description": "Open tasks, soonest first"
      },
      "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
        },
        "description": "Most recent 50 timeline entries"
      },
      "opportunities": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "accountId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "accountName": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "description": {
              "type": [
                "string",
                "null"
              ]
            },
            "productId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "productName": {
              "type": [
                "string",
                "null"
              ]
            },
            "machineId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Machine that prompted the add-on, if any"
            },
            "estimatedValueCents": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Amount in integer US cents (zero or more)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "open",
                "handed_to_sales",
                "won",
                "lost"
              ]
            },
            "handedToSalesOn": {
              "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"
                }
              ]
            },
            "salesContact": {
              "description": "Sales person the opportunity was handed to",
              "type": [
                "string",
                "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",
            "accountId",
            "accountName",
            "title",
            "description",
            "productId",
            "productName",
            "machineId",
            "estimatedValueCents",
            "status",
            "handedToSalesOn",
            "salesContact",
            "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
        }
      },
      "portalUsers": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "accountId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Record id (UUID)"
            },
            "accountName": {
              "type": "string"
            },
            "contactId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "email": {
              "type": "string",
              "maxLength": 254,
              "format": "email",
              "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
            },
            "name": {
              "type": "string"
            },
            "active": {
              "type": "boolean"
            },
            "lastSeenAt": {
              "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"
            }
          },
          "required": [
            "id",
            "accountId",
            "accountName",
            "contactId",
            "email",
            "name",
            "active",
            "lastSeenAt",
            "createdAt"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "account",
      "health",
      "contacts",
      "sites",
      "machines",
      "orders",
      "openTickets",
      "partsOrders",
      "tasks",
      "activities",
      "opportunities",
      "documents",
      "portalUsers"
    ],
    "additionalProperties": false
  }
}
            

accounts.create

Create a customer account

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

Create an account. A duplicate check runs on the normalized company name (and HubSpot company id); if a match exists the call fails with a conflict error listing the matches unless allowDuplicate is true. Optionally creates the first contact in the same call.

Input (object)

FieldTypeDescription
namerequiredstringCompany name as the customer writes itmin length 1, max length 200
segmentrequired"concrete_producer" | "multiservice"concrete_producer or multiservice
status"active" | "prospect" | "inactive"default "active"
phonestring | nullmax length 40
websitestring | nullmax length 200
hqLine1string | nullmax length 200
hqLine2string | nullmax length 200
hqCitystring | nullmax length 100
hqStatestring | nullTwo-letter state code, for example TXmax length 40
hqPostalCodestring | nullmax length 20
hqCountrystring | nullmax length 60
hubspotCompanyIdstring | nullmax length 60
ownerUserIdstring | nullRecord id (UUID)min length 1, max length 64
notesstring | nullmax length 20000
allowDuplicatebooleanCreate even if another account has the same normalized namedefault false
primaryContactobject
firstNamerequiredstringmin length 1, max length 100
lastNamestringdefault "", max length 100
rolestring | nullmax length 100
emailstring (email) | nullmax length 254
mobilestring | nullmax length 40

Output (object)

FieldTypeDescription
accountrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
namerequiredstring
normalizedNamerequiredstringLower-cased name without punctuation or company suffixes; used for duplicate checks
segmentrequired"concrete_producer" | "multiservice"
statusrequired"active" | "prospect" | "inactive"
phonerequiredstring | null
websiterequiredstring | null
hqLine1requiredstring | null
hqLine2requiredstring | null
hqCityrequiredstring | null
hqStaterequiredstring | nullTwo-letter US state or region code
hqPostalCoderequiredstring | null
hqCountryrequiredstring | null
hubspotCompanyIdrequiredstring | null
ownerUserIdrequiredstring | nullStaff user who owns the accountmin length 1, max length 64
notesrequiredstring | null
lastContactedAtrequiredstring (date-time) | nullMost recent call, email, text or visit
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
primaryContactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
Example request
                curl https://api.cemco.app/v1/ops/accounts.create \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"example","segment":"concrete_producer"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "description": "Company name as the customer writes it"
      },
      "segment": {
        "type": "string",
        "enum": [
          "concrete_producer",
          "multiservice"
        ],
        "description": "concrete_producer or multiservice"
      },
      "status": {
        "default": "active",
        "type": "string",
        "enum": [
          "active",
          "prospect",
          "inactive"
        ]
      },
      "phone": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 40
          },
          {
            "type": "null"
          }
        ]
      },
      "website": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "null"
          }
        ]
      },
      "hqLine1": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "null"
          }
        ]
      },
      "hqLine2": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "null"
          }
        ]
      },
      "hqCity": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 100
          },
          {
            "type": "null"
          }
        ]
      },
      "hqState": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 40
          },
          {
            "type": "null"
          }
        ],
        "description": "Two-letter state code, for example TX"
      },
      "hqPostalCode": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 20
          },
          {
            "type": "null"
          }
        ]
      },
      "hqCountry": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 60
          },
          {
            "type": "null"
          }
        ]
      },
      "hubspotCompanyId": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 60
          },
          {
            "type": "null"
          }
        ]
      },
      "ownerUserId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "notes": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 20000
          },
          {
            "type": "null"
          }
        ]
      },
      "allowDuplicate": {
        "default": false,
        "description": "Create even if another account has the same normalized name",
        "type": "boolean"
      },
      "primaryContact": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "lastName": {
            "default": "",
            "type": "string",
            "maxLength": 100
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "mobile": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "firstName"
        ]
      }
    },
    "required": [
      "name",
      "segment"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "name": {
            "type": "string"
          },
          "normalizedName": {
            "type": "string",
            "description": "Lower-cased name without punctuation or company suffixes; used for duplicate checks"
          },
          "segment": {
            "type": "string",
            "enum": [
              "concrete_producer",
              "multiservice"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "prospect",
              "inactive"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqLine1": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqLine2": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqCity": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqState": {
            "description": "Two-letter US state or region code",
            "type": [
              "string",
              "null"
            ]
          },
          "hqPostalCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqCountry": {
            "type": [
              "string",
              "null"
            ]
          },
          "hubspotCompanyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ownerUserId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ],
            "description": "Staff user who owns the account"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastContactedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                "description": "UTC timestamp, ISO 8601 with Z"
              },
              {
                "type": "null"
              }
            ],
            "description": "Most recent call, email, text or visit"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          }
        },
        "required": [
          "id",
          "name",
          "normalizedName",
          "segment",
          "status",
          "phone",
          "website",
          "hqLine1",
          "hqLine2",
          "hqCity",
          "hqState",
          "hqPostalCode",
          "hqCountry",
          "hubspotCompanyId",
          "ownerUserId",
          "notes",
          "lastContactedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "primaryContactId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "account",
      "primaryContactId"
    ],
    "additionalProperties": false
  }
}
            

accounts.update

Update a customer account

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

Change any profile field of an account. Only the fields you send are changed. Renaming re-runs the duplicate check against other accounts and fails with a conflict unless allowDuplicate is true.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
namestringCompany name as the customer writes itmin length 1, max length 200
segment"concrete_producer" | "multiservice"concrete_producer or multiservice
status"active" | "prospect" | "inactive"
phonestring | nullmax length 40
websitestring | nullmax length 200
hqLine1string | nullmax length 200
hqLine2string | nullmax length 200
hqCitystring | nullmax length 100
hqStatestring | nullTwo-letter state code, for example TXmax length 40
hqPostalCodestring | nullmax length 20
hqCountrystring | nullmax length 60
hubspotCompanyIdstring | nullmax length 60
ownerUserIdstring | nullRecord id (UUID)min length 1, max length 64
notesstring | nullmax length 20000
allowDuplicatebooleandefault false

Output (object)

FieldTypeDescription
accountrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
namerequiredstring
normalizedNamerequiredstringLower-cased name without punctuation or company suffixes; used for duplicate checks
segmentrequired"concrete_producer" | "multiservice"
statusrequired"active" | "prospect" | "inactive"
phonerequiredstring | null
websiterequiredstring | null
hqLine1requiredstring | null
hqLine2requiredstring | null
hqCityrequiredstring | null
hqStaterequiredstring | nullTwo-letter US state or region code
hqPostalCoderequiredstring | null
hqCountryrequiredstring | null
hubspotCompanyIdrequiredstring | null
ownerUserIdrequiredstring | nullStaff user who owns the accountmin length 1, max length 64
notesrequiredstring | null
lastContactedAtrequiredstring (date-time) | nullMost recent call, email, text or visit
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/accounts.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)"
      },
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "description": "Company name as the customer writes it"
      },
      "segment": {
        "type": "string",
        "enum": [
          "concrete_producer",
          "multiservice"
        ],
        "description": "concrete_producer or multiservice"
      },
      "status": {
        "type": "string",
        "enum": [
          "active",
          "prospect",
          "inactive"
        ]
      },
      "phone": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 40
          },
          {
            "type": "null"
          }
        ]
      },
      "website": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "null"
          }
        ]
      },
      "hqLine1": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "null"
          }
        ]
      },
      "hqLine2": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "null"
          }
        ]
      },
      "hqCity": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 100
          },
          {
            "type": "null"
          }
        ]
      },
      "hqState": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 40
          },
          {
            "type": "null"
          }
        ],
        "description": "Two-letter state code, for example TX"
      },
      "hqPostalCode": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 20
          },
          {
            "type": "null"
          }
        ]
      },
      "hqCountry": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 60
          },
          {
            "type": "null"
          }
        ]
      },
      "hubspotCompanyId": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 60
          },
          {
            "type": "null"
          }
        ]
      },
      "ownerUserId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "notes": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 20000
          },
          {
            "type": "null"
          }
        ]
      },
      "allowDuplicate": {
        "default": false,
        "type": "boolean"
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "name": {
            "type": "string"
          },
          "normalizedName": {
            "type": "string",
            "description": "Lower-cased name without punctuation or company suffixes; used for duplicate checks"
          },
          "segment": {
            "type": "string",
            "enum": [
              "concrete_producer",
              "multiservice"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "prospect",
              "inactive"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqLine1": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqLine2": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqCity": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqState": {
            "description": "Two-letter US state or region code",
            "type": [
              "string",
              "null"
            ]
          },
          "hqPostalCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqCountry": {
            "type": [
              "string",
              "null"
            ]
          },
          "hubspotCompanyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ownerUserId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ],
            "description": "Staff user who owns the account"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastContactedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                "description": "UTC timestamp, ISO 8601 with Z"
              },
              {
                "type": "null"
              }
            ],
            "description": "Most recent call, email, text or visit"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "UTC timestamp, ISO 8601 with Z"
          }
        },
        "required": [
          "id",
          "name",
          "normalizedName",
          "segment",
          "status",
          "phone",
          "website",
          "hqLine1",
          "hqLine2",
          "hqCity",
          "hqState",
          "hqPostalCode",
          "hqCountry",
          "hubspotCompanyId",
          "ownerUserId",
          "notes",
          "lastContactedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "account"
    ],
    "additionalProperties": false
  }
}
            

accounts.duplicate_check

Check for duplicate accounts or contacts

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

Before creating or importing, check whether a company name, HubSpot company id or contact email already exists. Company names are compared in normalized form (case, punctuation and suffixes such as LLC or Inc ignored); emails are compared case-insensitively. Returns the matches, empty when there are none.

Input (object)

FieldTypeDescription
namestringmin length 1, max length 200
hubspotCompanyIdstringmax length 60
emailstringmax length 254
excludeAccountIdstringIgnore this account (when checking a rename)min length 1, max length 64
excludeContactIdstringRecord id (UUID)min length 1, max length 64

Output (object)

FieldTypeDescription
normalizedNamerequiredstring | null
normalizedEmailrequiredstring | null
hasDuplicatesrequiredboolean
matchesrequiredobject[]
kindrequired"account_name" | "hubspot_company_id" | "contact_email"
accountrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
namerequiredstring
contactrequiredobject | null
idrequiredstringRecord id (UUID)min length 1, max length 64
namerequiredstring
matchedOnrequiredstringThe normalized value that matched
Example request
                curl https://api.cemco.app/v1/ops/accounts.duplicate_check \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"example"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "hubspotCompanyId": {
        "type": "string",
        "maxLength": 60
      },
      "email": {
        "type": "string",
        "maxLength": 254
      },
      "excludeAccountId": {
        "description": "Ignore this account (when checking a rename)",
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      },
      "excludeContactId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      }
    }
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "normalizedName": {
        "type": [
          "string",
          "null"
        ]
      },
      "normalizedEmail": {
        "type": [
          "string",
          "null"
        ]
      },
      "hasDuplicates": {
        "type": "boolean"
      },
      "matches": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "account_name",
                "hubspot_company_id",
                "contact_email"
              ]
            },
            "account": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            },
            "contact": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "description": "Record id (UUID)"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "matchedOn": {
              "type": "string",
              "description": "The normalized value that matched"
            }
          },
          "required": [
            "kind",
            "account",
            "contact",
            "matchedOn"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "normalizedName",
      "normalizedEmail",
      "hasDuplicates",
      "matches"
    ],
    "additionalProperties": false
  }
}
            

accounts.health

Get account health

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

One status for an account built from open tickets, machines down, downtime in the last 90 days, parts spend in the last year, days since last contact, warranties and overdue tasks. Returns a 0-100 score, a level (good, watch, at_risk) and the reasons in plain language.

Input (object)

FieldTypeDescription
idrequiredstringAccount idmin length 1, max length 64

Output (object)

FieldTypeDescription
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
scorerequiredinteger100 is healthiestmin 0, max 100
levelrequired"good" | "watch" | "at_risk"
openTicketsrequiredintegermin -9007199254740991, max 9007199254740991
downMachinesrequiredintegermin -9007199254740991, max 9007199254740991
downtimeDays90requirednumberMachine-days down in the last 90 days
partsSpendCents365requiredintegerParts ordered in the last 365 daysmin 0, max 9007199254740991
daysSinceContactrequiredinteger | nullmin -9007199254740991, max 9007199254740991
machinesUnderWarrantyrequiredintegermin -9007199254740991, max 9007199254740991
warrantiesExpiringSoonrequiredintegermin -9007199254740991, max 9007199254740991
overdueTasksrequiredintegermin -9007199254740991, max 9007199254740991
reasonsrequiredstring[]Plain-language reasons behind the score
Example request
                curl https://api.cemco.app/v1/ops/accounts.health \
  -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": "Account id"
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "accountId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "score": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100,
        "description": "100 is healthiest"
      },
      "level": {
        "type": "string",
        "enum": [
          "good",
          "watch",
          "at_risk"
        ]
      },
      "openTickets": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "downMachines": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "downtimeDays90": {
        "type": "number",
        "description": "Machine-days down in the last 90 days"
      },
      "partsSpendCents365": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "Parts ordered in the last 365 days"
      },
      "daysSinceContact": {
        "anyOf": [
          {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          {
            "type": "null"
          }
        ]
      },
      "machinesUnderWarranty": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "warrantiesExpiringSoon": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "overdueTasks": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "reasons": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Plain-language reasons behind the score"
      }
    },
    "required": [
      "accountId",
      "score",
      "level",
      "openTickets",
      "downMachines",
      "downtimeDays90",
      "partsSpendCents365",
      "daysSinceContact",
      "machinesUnderWarranty",
      "warrantiesExpiringSoon",
      "overdueTasks",
      "reasons"
    ],
    "additionalProperties": false
  }
}