Sites and site readiness
Generated at build time from packages/core/src/operations/sites.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.
sites.list
List sites
List job sites and yards, optionally for one account or one state. Each row has GPS coordinates, the number of machines on site and the readiness checklist summary.
Input (object)
| Field | Type | Description |
|---|---|---|
accountId | string | Record id (UUID)min length 1, max length 64 |
state | string | max length 40 |
activeOnly | boolean | Leave out sites that have been closeddefault false |
query | string | max length 200 |
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 |
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 |
accountNamerequired | string | |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
readinessrequired | object | |
siteIdrequired | string | Record id (UUID)min length 1, max length 64 |
itemsrequired | object[] | One entry per checklist item: pad, power, water, access, aggregate_supply |
itemrequired | "pad" | "power" | "water" | "access" | "aggregate_supply" | |
confirmedrequired | boolean | |
confirmedOnrequired | string (date) | null | Date as YYYY-MM-DD |
confirmedByNamerequired | string | null | |
noterequired | string | null | |
confirmedCountrequired | integer | min -9007199254740991, max 9007199254740991 |
totalCountrequired | integer | min -9007199254740991, max 9007199254740991 |
readyrequired | boolean | True when every item is confirmed |
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/sites.list \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"state": {
"type": "string",
"maxLength": 40
},
"activeOnly": {
"default": false,
"description": "Leave out sites that have been closed",
"type": "boolean"
},
"query": {
"type": "string",
"maxLength": 200
},
"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)"
},
"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"
},
"accountName": {
"type": "string"
},
"machineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"readiness": {
"type": "object",
"properties": {
"siteId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"enum": [
"pad",
"power",
"water",
"access",
"aggregate_supply"
]
},
"confirmed": {
"type": "boolean"
},
"confirmedOn": {
"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"
}
]
},
"confirmedByName": {
"type": [
"string",
"null"
]
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"item",
"confirmed",
"confirmedOn",
"confirmedByName",
"note"
],
"additionalProperties": false
},
"description": "One entry per checklist item: pad, power, water, access, aggregate_supply"
},
"confirmedCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"totalCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"ready": {
"type": "boolean",
"description": "True when every item is confirmed"
}
},
"required": [
"siteId",
"items",
"confirmedCount",
"totalCount",
"ready"
],
"additionalProperties": false
}
},
"required": [
"id",
"accountId",
"name",
"line1",
"line2",
"city",
"state",
"postalCode",
"country",
"latitude",
"longitude",
"powerSource",
"waterSource",
"activeFrom",
"activeTo",
"notes",
"createdAt",
"updatedAt",
"accountName",
"machineCount",
"readiness"
],
"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
}
}
sites.get
Get a site
Read one site with its address, GPS, power and water source, machine count and readiness checklist.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
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 |
accountNamerequired | string | |
machineCountrequired | integer | min -9007199254740991, max 9007199254740991 |
readinessrequired | object | |
siteIdrequired | string | Record id (UUID)min length 1, max length 64 |
itemsrequired | object[] | One entry per checklist item: pad, power, water, access, aggregate_supply |
itemrequired | "pad" | "power" | "water" | "access" | "aggregate_supply" | |
confirmedrequired | boolean | |
confirmedOnrequired | string (date) | null | Date as YYYY-MM-DD |
confirmedByNamerequired | string | null | |
noterequired | string | null | |
confirmedCountrequired | integer | min -9007199254740991, max 9007199254740991 |
totalCountrequired | integer | min -9007199254740991, max 9007199254740991 |
readyrequired | boolean | True when every item is confirmed |
Example request
curl https://api.cemco.app/v1/ops/sites.get \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"id":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"id"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"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"
},
"accountName": {
"type": "string"
},
"machineCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"readiness": {
"type": "object",
"properties": {
"siteId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"enum": [
"pad",
"power",
"water",
"access",
"aggregate_supply"
]
},
"confirmed": {
"type": "boolean"
},
"confirmedOn": {
"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"
}
]
},
"confirmedByName": {
"type": [
"string",
"null"
]
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"item",
"confirmed",
"confirmedOn",
"confirmedByName",
"note"
],
"additionalProperties": false
},
"description": "One entry per checklist item: pad, power, water, access, aggregate_supply"
},
"confirmedCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"totalCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"ready": {
"type": "boolean",
"description": "True when every item is confirmed"
}
},
"required": [
"siteId",
"items",
"confirmedCount",
"totalCount",
"ready"
],
"additionalProperties": false
}
},
"required": [
"id",
"accountId",
"name",
"line1",
"line2",
"city",
"state",
"postalCode",
"country",
"latitude",
"longitude",
"powerSource",
"waterSource",
"activeFrom",
"activeTo",
"notes",
"createdAt",
"updatedAt",
"accountName",
"machineCount",
"readiness"
],
"additionalProperties": false
}
}
sites.create
Add a site to an account
Create a job site or yard for an account. Give latitude and longitude when known so machines there appear on the map. The five-item readiness checklist starts unconfirmed.
Input (object)
| Field | Type | Description |
|---|---|---|
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
namerequired | string | Name of the yard or job sitemin length 1, max length 200 |
line1 | string | null | max length 200 |
line2 | string | null | max length 200 |
city | string | null | max length 100 |
state | string | null | Two-letter state codemax length 40 |
postalCode | string | null | max length 20 |
country | string | null | max length 60 |
latitude | number | null | min -90, max 90 |
longitude | number | null | min -180, max 180 |
powerSource | string | null | max length 200 |
waterSource | string | null | max length 200 |
activeFrom | string (date) | null | Date as YYYY-MM-DD |
activeTo | string (date) | null | Set to close the site |
notes | string | null | max length 20000 |
Output (object)
| Field | Type | Description |
|---|---|---|
siterequired | 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 |
Example request
curl https://api.cemco.app/v1/ops/sites.create \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"accountId":"00000000-0000-4000-8000-000000000000","name":"example"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Name of the yard or job site"
},
"line1": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"line2": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"city": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
]
},
"state": {
"anyOf": [
{
"type": "string",
"maxLength": 40
},
{
"type": "null"
}
],
"description": "Two-letter state code"
},
"postalCode": {
"anyOf": [
{
"type": "string",
"maxLength": 20
},
{
"type": "null"
}
]
},
"country": {
"anyOf": [
{
"type": "string",
"maxLength": 60
},
{
"type": "null"
}
]
},
"latitude": {
"anyOf": [
{
"type": "number",
"minimum": -90,
"maximum": 90
},
{
"type": "null"
}
]
},
"longitude": {
"anyOf": [
{
"type": "number",
"minimum": -180,
"maximum": 180
},
{
"type": "null"
}
]
},
"powerSource": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"waterSource": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "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 to close the site"
},
"notes": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
}
},
"required": [
"accountId",
"name"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"site": {
"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
}
},
"required": [
"site"
],
"additionalProperties": false
}
}
sites.update
Update a site
Change fields on a site; only the fields you send are changed.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
name | string | Name of the yard or job sitemin length 1, max length 200 |
line1 | string | null | max length 200 |
line2 | string | null | max length 200 |
city | string | null | max length 100 |
state | string | null | Two-letter state codemax length 40 |
postalCode | string | null | max length 20 |
country | string | null | max length 60 |
latitude | number | null | min -90, max 90 |
longitude | number | null | min -180, max 180 |
powerSource | string | null | max length 200 |
waterSource | string | null | max length 200 |
activeFrom | string (date) | null | Date as YYYY-MM-DD |
activeTo | string (date) | null | Set to close the site |
notes | string | null | max length 20000 |
Output (object)
| Field | Type | Description |
|---|---|---|
siterequired | 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 |
Example request
curl https://api.cemco.app/v1/ops/sites.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": "Name of the yard or job site"
},
"line1": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"line2": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"city": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
]
},
"state": {
"anyOf": [
{
"type": "string",
"maxLength": 40
},
{
"type": "null"
}
],
"description": "Two-letter state code"
},
"postalCode": {
"anyOf": [
{
"type": "string",
"maxLength": 20
},
{
"type": "null"
}
]
},
"country": {
"anyOf": [
{
"type": "string",
"maxLength": 60
},
{
"type": "null"
}
]
},
"latitude": {
"anyOf": [
{
"type": "number",
"minimum": -90,
"maximum": 90
},
{
"type": "null"
}
]
},
"longitude": {
"anyOf": [
{
"type": "number",
"minimum": -180,
"maximum": 180
},
{
"type": "null"
}
]
},
"powerSource": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"waterSource": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "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 to close the site"
},
"notes": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
}
},
"required": [
"id"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"site": {
"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
}
},
"required": [
"site"
],
"additionalProperties": false
}
}
sites.readiness_get
Get the site readiness checklist
The pre-delivery checklist for a site: pad, power, water, access and aggregate supply, each confirmed or not, with who confirmed it and when. ready is true only when all five are confirmed.
Input (object)
| Field | Type | Description |
|---|---|---|
siteIdrequired | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
siteIdrequired | string | Record id (UUID)min length 1, max length 64 |
itemsrequired | object[] | One entry per checklist item: pad, power, water, access, aggregate_supply |
itemrequired | "pad" | "power" | "water" | "access" | "aggregate_supply" | |
confirmedrequired | boolean | |
confirmedOnrequired | string (date) | null | Date as YYYY-MM-DD |
confirmedByNamerequired | string | null | |
noterequired | string | null | |
confirmedCountrequired | integer | min -9007199254740991, max 9007199254740991 |
totalCountrequired | integer | min -9007199254740991, max 9007199254740991 |
readyrequired | boolean | True when every item is confirmed |
Example request
curl https://api.cemco.app/v1/ops/sites.readiness_get \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"siteId":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"siteId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"siteId"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"siteId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"enum": [
"pad",
"power",
"water",
"access",
"aggregate_supply"
]
},
"confirmed": {
"type": "boolean"
},
"confirmedOn": {
"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"
}
]
},
"confirmedByName": {
"type": [
"string",
"null"
]
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"item",
"confirmed",
"confirmedOn",
"confirmedByName",
"note"
],
"additionalProperties": false
},
"description": "One entry per checklist item: pad, power, water, access, aggregate_supply"
},
"confirmedCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"totalCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"ready": {
"type": "boolean",
"description": "True when every item is confirmed"
}
},
"required": [
"siteId",
"items",
"confirmedCount",
"totalCount",
"ready"
],
"additionalProperties": false
}
}
sites.readiness_update
Confirm site readiness items
Mark one or more readiness checklist items confirmed or not confirmed, with an optional note. Confirming records today's date and your name. Returns the whole checklist.
Input (object)
| Field | Type | Description |
|---|---|---|
siteIdrequired | string | Record id (UUID)min length 1, max length 64 |
itemsrequired | object[] | at least 1 |
itemrequired | "pad" | "power" | "water" | "access" | "aggregate_supply" | |
confirmedrequired | boolean | |
confirmedOn | string (date) | Defaults to today when confirming |
note | string | null | max length 2000 |
Output (object)
| Field | Type | Description |
|---|---|---|
siteIdrequired | string | Record id (UUID)min length 1, max length 64 |
itemsrequired | object[] | One entry per checklist item: pad, power, water, access, aggregate_supply |
itemrequired | "pad" | "power" | "water" | "access" | "aggregate_supply" | |
confirmedrequired | boolean | |
confirmedOnrequired | string (date) | null | Date as YYYY-MM-DD |
confirmedByNamerequired | string | null | |
noterequired | string | null | |
confirmedCountrequired | integer | min -9007199254740991, max 9007199254740991 |
totalCountrequired | integer | min -9007199254740991, max 9007199254740991 |
readyrequired | boolean | True when every item is confirmed |
Example request
curl https://api.cemco.app/v1/ops/sites.readiness_update \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"siteId":"00000000-0000-4000-8000-000000000000","items":[{"item":"pad","confirmed":true}]}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"siteId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"items": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"enum": [
"pad",
"power",
"water",
"access",
"aggregate_supply"
]
},
"confirmed": {
"type": "boolean"
},
"confirmedOn": {
"description": "Defaults to today when confirming",
"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])))$"
},
"note": {
"anyOf": [
{
"type": "string",
"maxLength": 2000
},
{
"type": "null"
}
]
}
},
"required": [
"item",
"confirmed"
]
}
}
},
"required": [
"siteId",
"items"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"siteId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string",
"enum": [
"pad",
"power",
"water",
"access",
"aggregate_supply"
]
},
"confirmed": {
"type": "boolean"
},
"confirmedOn": {
"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"
}
]
},
"confirmedByName": {
"type": [
"string",
"null"
]
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"item",
"confirmed",
"confirmedOn",
"confirmedByName",
"note"
],
"additionalProperties": false
},
"description": "One entry per checklist item: pad, power, water, access, aggregate_supply"
},
"confirmedCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"totalCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"ready": {
"type": "boolean",
"description": "True when every item is confirmed"
}
},
"required": [
"siteId",
"items",
"confirmedCount",
"totalCount",
"ready"
],
"additionalProperties": false
}
}