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.
accounts.search
Search or list customer accounts
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)
| Field | Type | Description |
|---|---|---|
query | string | Free text matched against name, city, state and contact namesmax length 200 |
segment | "concrete_producer" | "multiservice" | |
status | "active" | "prospect" | "inactive" | |
state | string | HQ state code, for example TXmax length 40 |
health | "good" | "watch" | "at_risk" | Only accounts at this health level |
notContactedInDays | integer | Only accounts with no call, email, text or visit in this many daysmin 1, max 9007199254740991 |
sort | "name" | "last_contacted" | "created" | default "name" |
limit | integer | Maximum rows to return (default 50, max 500)default 50, min 1, max 500 |
offset | integer | Rows to skip, for pagingdefault 0, min 0, max 9007199254740991 |
Output (object)
| Field | Type | Description |
|---|---|---|
itemsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
normalizedNamerequired | string | Lower-cased name without punctuation or company suffixes; used for duplicate checks |
segmentrequired | "concrete_producer" | "multiservice" | |
statusrequired | "active" | "prospect" | "inactive" | |
phonerequired | string | null | |
websiterequired | string | null | |
hqLine1required | string | null | |
hqLine2required | string | null | |
hqCityrequired | string | null | |
hqStaterequired | string | null | Two-letter US state or region code |
hqPostalCoderequired | string | null | |
hqCountryrequired | string | null | |
hubspotCompanyIdrequired | string | null | |
ownerUserIdrequired | string | null | Staff user who owns the accountmin length 1, max length 64 |
notesrequired | string | null | |
lastContactedAtrequired | string (date-time) | null | Most recent call, email, text or visit |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openOrderCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openTicketCountrequired | integer | min -9007199254740991, max 9007199254740991 |
primaryContactNamerequired | string | null | |
daysSinceContactrequired | integer | null | min -9007199254740991, max 9007199254740991 |
totalrequired | integer | Total rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991 |
limitrequired | integer | min -9007199254740991, max 9007199254740991 |
offsetrequired | integer | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/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
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)
| Field | Type | Description |
|---|---|---|
idrequired | string | Account idmin length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
accountrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
normalizedNamerequired | string | Lower-cased name without punctuation or company suffixes; used for duplicate checks |
segmentrequired | "concrete_producer" | "multiservice" | |
statusrequired | "active" | "prospect" | "inactive" | |
phonerequired | string | null | |
websiterequired | string | null | |
hqLine1required | string | null | |
hqLine2required | string | null | |
hqCityrequired | string | null | |
hqStaterequired | string | null | Two-letter US state or region code |
hqPostalCoderequired | string | null | |
hqCountryrequired | string | null | |
hubspotCompanyIdrequired | string | null | |
ownerUserIdrequired | string | null | Staff user who owns the accountmin length 1, max length 64 |
notesrequired | string | null | |
lastContactedAtrequired | string (date-time) | null | Most recent call, email, text or visit |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
healthrequired | object | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
scorerequired | integer | 100 is healthiestmin 0, max 100 |
levelrequired | "good" | "watch" | "at_risk" | |
openTicketsrequired | integer | min -9007199254740991, max 9007199254740991 |
downMachinesrequired | integer | min -9007199254740991, max 9007199254740991 |
downtimeDays90required | number | Machine-days down in the last 90 days |
partsSpendCents365required | integer | Parts ordered in the last 365 daysmin 0, max 9007199254740991 |
daysSinceContactrequired | integer | null | min -9007199254740991, max 9007199254740991 |
machinesUnderWarrantyrequired | integer | min -9007199254740991, max 9007199254740991 |
warrantiesExpiringSoonrequired | integer | min -9007199254740991, max 9007199254740991 |
overdueTasksrequired | integer | min -9007199254740991, max 9007199254740991 |
reasonsrequired | string[] | Plain-language reasons behind the score |
contactsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
firstNamerequired | string | |
lastNamerequired | string | |
rolerequired | string | null | Job title or role at the customer, for example Plant manager |
emailrequired | string | null | |
mobilerequired | string | null | |
phonerequired | string | null | |
preferredChannelrequired | "email" | "phone" | "text" | |
isPrimaryrequired | boolean | |
hubspotContactIdrequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
sitesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
line1required | string | null | |
line2required | string | null | |
cityrequired | string | null | |
staterequired | string | null | |
postalCoderequired | string | null | |
countryrequired | string | null | |
latituderequired | number | null | min -90, max 90 |
longituderequired | number | null | min -180, max 180 |
powerSourcerequired | string | null | For example utility 480V three-phase, or generator |
waterSourcerequired | string | null | For example municipal, well, hauled |
activeFromrequired | string (date) | null | Date as YYYY-MM-DD |
activeTorequired | string (date) | null | Set when the site is no longer used |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
machinesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
serialNumberrequired | string | |
typerequired | "plant" | "mixer" | "silo" | "feeder" | "power_pack" | |
modelrequired | string | |
configurationrequired | string | null | |
optionsrequired | string[] | |
accountIdrequired | string | Current ownermin length 1, max length 64 |
siteIdrequired | string | null | Current sitemin length 1, max length 64 |
orderIdrequired | string | null | Order the machine was built formin length 1, max length 64 |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "in_build" | "in_transit" | "operating" | "down" | "idle" | "retired" | |
builtOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
commissionedOnrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStartrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyEndrequired | string (date) | null | Date as YYYY-MM-DD |
warrantyStaterequired | "none" | "active" | "expiring" | "expired" | Computed from the warranty dates and today's date |
warrantyDaysLeftrequired | integer | null | Days until the warranty ends; negative once expired; null if not startedmin -9007199254740991, max 9007199254740991 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
siteNamerequired | string | null | |
siteCityrequired | string | null | |
siteStaterequired | string | null | |
latituderequired | number | null | |
longituderequired | number | null | |
openTicketCountrequired | integer | min -9007199254740991, max 9007199254740991 |
ordersrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
siteIdrequired | string | null | Delivery sitemin length 1, max length 64 |
titlerequired | string | null | |
stagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | |
stageDatesrequired | object | Date each stage was reached; null if not yet |
receivedrequired | string (date) | null | Date as YYYY-MM-DD |
in_buildrequired | string (date) | null | Date as YYYY-MM-DD |
ready_to_shiprequired | string (date) | null | Date as YYYY-MM-DD |
shippedrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredrequired | string (date) | null | Date as YYYY-MM-DD |
set_uprequired | string (date) | null | Date as YYYY-MM-DD |
commissionedrequired | string (date) | null | Date as YYYY-MM-DD |
trainedrequired | string (date) | null | Date as YYYY-MM-DD |
closedrequired | string (date) | null | Date as YYYY-MM-DD |
signedQuoteDocumentIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
signedQuoteReceivedOnrequired | string (date) | null | Date as YYYY-MM-DD |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
balanceRemainingCentsrequired | integer | null | Null until someone records it; 0 means paid in fullmin 0, max 9007199254740991 |
isValidrequired | boolean | |
financingPartnerrequired | "none" | "commercial_capital" | "northland_capital" | "other" | |
financingStatusrequired | "not_applicable" | "pending" | "approved" | "declined" | "funded" | |
financingNotesrequired | string | null | |
poNumberrequired | string | null | |
expectedShipOnrequired | string (date) | null | Date as YYYY-MM-DD |
ownerUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
siteNamerequired | string | null | |
missingrequired | ("signed_quote" | "signed_quote_received_on" | "balance_remaining")[] | |
nextStagerequired | "received" | "in_build" | "ready_to_ship" | "shipped" | "delivered" | "set_up" | "commissioned" | "trained" | "closed" | null | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
openTicketsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
ticketNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
titlerequired | string | |
descriptionrequired | string | null | |
categoryrequired | "mechanical" | "electrical" | "controls" | "hydraulic" | "pneumatic" | "structural" | "calibration" | "operator_training" | "other" | |
priorityrequired | "low" | "normal" | "high" | "down" | |
statusrequired | "new" | "diagnosing" | "parts_on_order" | "scheduled" | "waiting_on_customer" | "resolved" | "follow_up_complete" | |
rootCauserequired | "component_failure" | "manufacturing_defect" | "wear" | "operator_error" | "installation" | "shipping_damage" | "environment" | "design" | "unknown" | null | |
resolutionrequired | string | null | |
sourcerequired | "staff" | "portal" | "email" | "agent" | |
assignedToUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
isWarrantyrequired | boolean | Whether the work is covered by warranty |
onsiteHoursrequired | number | Total on-site hours loggedmin 0 |
travelHoursrequired | number | Total travel hours loggedmin 0 |
travelMilesrequired | number | Total travel miles loggedmin 0 |
openedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
scheduledForrequired | string (date) | null | Date as YYYY-MM-DD |
resolvedAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
machineSerialNumberrequired | string | |
machineModelrequired | string | |
assignedToNamerequired | string | null | |
partsOrdersrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
orderNumberrequired | string | |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
statusrequired | "quote" | "ordered" | "shipped" | "delivered" | "cancelled" | |
subtotalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
shippingCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
taxCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
totalCentsrequired | integer | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
quotedOnrequired | string (date) | Date as YYYY-MM-DD |
quoteValidUntilrequired | string (date) | null | Date as YYYY-MM-DD |
orderedOnrequired | string (date) | null | Date as YYYY-MM-DD |
shippedOnrequired | string (date) | null | Date as YYYY-MM-DD |
deliveredOnrequired | string (date) | null | Date as YYYY-MM-DD |
carrierrequired | string | null | |
trackingNumberrequired | string | null | |
shipToNamerequired | string | null | |
shipToAddressrequired | string | null | |
customerPorequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
lineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
tasksrequired | object[] | Open tasks, soonest first |
idrequired | string | Record id (UUID)min length 1, max length 64 |
typerequired | "task" | "call" | "visit" | "delivery" | "commissioning" | "service" | "check_in" | |
titlerequired | string | |
notesrequired | string | null | |
statusrequired | "open" | "done" | "cancelled" | |
dueOnrequired | string (date) | Day the task is due or the appointment happens |
startsAtrequired | string (date-time) | null | Start time for timed appointments; null for all-day items |
endsAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
locationrequired | string | null | |
assignedToUserIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
assignedToNamerequired | string | null | |
accountIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
accountNamerequired | string | null | |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
siteIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
checkInIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
isOverduerequired | boolean | Open and due before today |
googleEventIdrequired | string | null | |
syncStaterequired | "not_synced" | "pending" | "synced" | "error" | |
syncedAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
syncErrorrequired | string | null | |
completedAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
activitiesrequired | object[] | Most recent 50 timeline entries |
idrequired | string | Record id (UUID)min length 1, max length 64 |
typerequired | "call" | "email" | "text" | "visit" | "note" | "system" | |
directionrequired | "outbound" | "inbound" | null | |
subjectrequired | string | |
bodyrequired | string | null | |
occurredAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
orderIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
machineIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
ticketIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
externalRefrequired | string | null | Gmail message id for imported emails; unique |
externalThreadIdrequired | string | null | |
fromAddressrequired | string | null | |
toAddressesrequired | string[] | |
durationMinutesrequired | integer | null | min 0, max 9007199254740991 |
documentIdsrequired | string[] | Attachments stored as documents |
loggedByNamerequired | string | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
opportunitiesrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
accountNamerequired | string | |
titlerequired | string | |
descriptionrequired | string | null | |
productIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
productNamerequired | string | null | |
machineIdrequired | string | null | Machine that prompted the add-on, if anymin length 1, max length 64 |
estimatedValueCentsrequired | integer | null | Amount in integer US cents (zero or more)min 0, max 9007199254740991 |
statusrequired | "open" | "handed_to_sales" | "won" | "lost" | |
handedToSalesOnrequired | string (date) | null | Date as YYYY-MM-DD |
salesContactrequired | string | null | Sales person the opportunity was handed to |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
documentsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
kindrequired | "signed_quote" | "quote" | "purchase_order" | "drawing" | "manual" | "inspection_report" | "photo" | "training_record" | "invoice" | "email_attachment" | "export" | "other" | |
titlerequired | string | |
filenamerequired | string | |
contentTyperequired | string | |
sizeBytesrequired | integer | min 0, max 9007199254740991 |
statusrequired | "pending" | "stored" | pending until the file bytes are stored |
accountIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
customerVisiblerequired | boolean | Whether the customer can open it in the portal |
sourcerequired | "upload" | "email" | "portal" | "system" | "import" | |
linksrequired | object[] | |
entityTyperequired | "account" | "contact" | "site" | "order" | "machine" | "ticket" | "warranty_claim" | "parts_order" | "part" | "opportunity" | "check_in" | |
entityIdrequired | string | Record id (UUID)min length 1, max length 64 |
uploadedByNamerequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
portalUsersrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
accountNamerequired | string | |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
emailrequired | string (email) | max length 254 |
namerequired | string | |
activerequired | boolean | |
lastSeenAtrequired | string (date-time) | null | UTC timestamp, ISO 8601 with Z |
createdAtrequired | string (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
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)
| Field | Type | Description |
|---|---|---|
namerequired | string | Company 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" |
phone | string | null | max length 40 |
website | string | null | max length 200 |
hqLine1 | string | null | max length 200 |
hqLine2 | string | null | max length 200 |
hqCity | string | null | max length 100 |
hqState | string | null | Two-letter state code, for example TXmax length 40 |
hqPostalCode | string | null | max length 20 |
hqCountry | string | null | max length 60 |
hubspotCompanyId | string | null | max length 60 |
ownerUserId | string | null | Record id (UUID)min length 1, max length 64 |
notes | string | null | max length 20000 |
allowDuplicate | boolean | Create even if another account has the same normalized namedefault false |
primaryContact | object | |
firstNamerequired | string | min length 1, max length 100 |
lastName | string | default "", max length 100 |
role | string | null | max length 100 |
email | string (email) | null | max length 254 |
mobile | string | null | max length 40 |
Output (object)
| Field | Type | Description |
|---|---|---|
accountrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
normalizedNamerequired | string | Lower-cased name without punctuation or company suffixes; used for duplicate checks |
segmentrequired | "concrete_producer" | "multiservice" | |
statusrequired | "active" | "prospect" | "inactive" | |
phonerequired | string | null | |
websiterequired | string | null | |
hqLine1required | string | null | |
hqLine2required | string | null | |
hqCityrequired | string | null | |
hqStaterequired | string | null | Two-letter US state or region code |
hqPostalCoderequired | string | null | |
hqCountryrequired | string | null | |
hubspotCompanyIdrequired | string | null | |
ownerUserIdrequired | string | null | Staff user who owns the accountmin length 1, max length 64 |
notesrequired | string | null | |
lastContactedAtrequired | string (date-time) | null | Most recent call, email, text or visit |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
primaryContactIdrequired | string | null | Record 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
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)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
name | string | Company name as the customer writes itmin length 1, max length 200 |
segment | "concrete_producer" | "multiservice" | concrete_producer or multiservice |
status | "active" | "prospect" | "inactive" | |
phone | string | null | max length 40 |
website | string | null | max length 200 |
hqLine1 | string | null | max length 200 |
hqLine2 | string | null | max length 200 |
hqCity | string | null | max length 100 |
hqState | string | null | Two-letter state code, for example TXmax length 40 |
hqPostalCode | string | null | max length 20 |
hqCountry | string | null | max length 60 |
hubspotCompanyId | string | null | max length 60 |
ownerUserId | string | null | Record id (UUID)min length 1, max length 64 |
notes | string | null | max length 20000 |
allowDuplicate | boolean | default false |
Output (object)
| Field | Type | Description |
|---|---|---|
accountrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
normalizedNamerequired | string | Lower-cased name without punctuation or company suffixes; used for duplicate checks |
segmentrequired | "concrete_producer" | "multiservice" | |
statusrequired | "active" | "prospect" | "inactive" | |
phonerequired | string | null | |
websiterequired | string | null | |
hqLine1required | string | null | |
hqLine2required | string | null | |
hqCityrequired | string | null | |
hqStaterequired | string | null | Two-letter US state or region code |
hqPostalCoderequired | string | null | |
hqCountryrequired | string | null | |
hubspotCompanyIdrequired | string | null | |
ownerUserIdrequired | string | null | Staff user who owns the accountmin length 1, max length 64 |
notesrequired | string | null | |
lastContactedAtrequired | string (date-time) | null | Most recent call, email, text or visit |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
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
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)
| Field | Type | Description |
|---|---|---|
name | string | min length 1, max length 200 |
hubspotCompanyId | string | max length 60 |
email | string | max length 254 |
excludeAccountId | string | Ignore this account (when checking a rename)min length 1, max length 64 |
excludeContactId | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
normalizedNamerequired | string | null | |
normalizedEmailrequired | string | null | |
hasDuplicatesrequired | boolean | |
matchesrequired | object[] | |
kindrequired | "account_name" | "hubspot_company_id" | "contact_email" | |
accountrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
contactrequired | object | null | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | |
matchedOnrequired | string | The 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
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)
| Field | Type | Description |
|---|---|---|
idrequired | string | Account idmin length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
scorerequired | integer | 100 is healthiestmin 0, max 100 |
levelrequired | "good" | "watch" | "at_risk" | |
openTicketsrequired | integer | min -9007199254740991, max 9007199254740991 |
downMachinesrequired | integer | min -9007199254740991, max 9007199254740991 |
downtimeDays90required | number | Machine-days down in the last 90 days |
partsSpendCents365required | integer | Parts ordered in the last 365 daysmin 0, max 9007199254740991 |
daysSinceContactrequired | integer | null | min -9007199254740991, max 9007199254740991 |
machinesUnderWarrantyrequired | integer | min -9007199254740991, max 9007199254740991 |
warrantiesExpiringSoonrequired | integer | min -9007199254740991, max 9007199254740991 |
overdueTasksrequired | integer | min -9007199254740991, max 9007199254740991 |
reasonsrequired | string[] | 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
}
}