Customer API / API reference

Downtime API

Query computed downtime events that overlap an interval and list the active code labels available for a site.

In this article

Query downtime events

Use GET /api/customer/v1/downtime with siteId, from, and to. Optional filters include lineId, machineId, up to 100 repeated downCode values, pageSize, and cursor. machineId requires lineId.

An event is returned when any part overlaps the half-open interval [from,to), including an event that began before from or is still open.

GET /api/customer/v1/downtime?siteId=site-1&lineId=line-1&machineId=machine-1&from=2026-09-01T12%3A00%3A00Z&to=2026-09-01T13%3A00%3A00Z&pageSize=500
Authorization: Bearer <access-token>
Accept: application/json

Read an event response

{
  "data": [
    {
      "eventId": "22222222-2222-4222-8222-222222222222",
      "siteId": "site-1",
      "lineId": "line-1",
      "machineId": "machine-1",
      "machineName": "Case Packer",
      "startedAt": "2026-09-01T12:15:00Z",
      "endedAt": "2026-09-01T12:18:30Z",
      "durationMs": 210000,
      "downCode": 12,
      "codeLabel": "Material shortage",
      "codeCategory": "Material",
      "codeColor": "#D97706",
      "codeCapturedAt": "2026-09-01T12:16:00Z",
      "isFallbackCode": false,
      "state": "closed"
    }
  ],
  "nextCursor": null
}

endedAt and durationMs can be null while an event is open. Code display fields can be null when no active display mapping is available; downCode remains the recorded numeric value.

List downtime codes

Use GET /api/customer/v1/downtime/codes with siteId. Optional pageSize and cursor parameters page the active code mappings visible for that site.

{
  "data": [
    {
      "numericCode": 12,
      "label": "Material shortage",
      "category": "Material",
      "color": "#D97706",
      "sortOrder": 10
    }
  ],
  "nextCursor": null
}

Page results

For downtime responses, pageSize counts event or code rows. Send a returned nextCursor unchanged with the original filters until it is null. See pagination and data consistency for the shared cursor contract.

Errors

Malformed ranges and filter combinations return 400. A request outside the credential's visible hierarchy or enabled downtime policy returns 403. See resolve Customer API errors for the complete customer action table.