Skip to main content

Fleet

Get a fleet-wide view of machine status, roll up KPIs by site, manage edge-agent heartbeats, and read what each edge agent logged. Unless noted, endpoints are authenticated with a Bearer JWT (see Authentication); the agent heartbeat and the agent's sending of its log use an API key.

Endpoints​

MethodPathDescription
GET/api/v1/fleet/statusStatus of every active machine in your fleet
GET/api/v1/fleet/sitesList sites with rolled-up KPIs
GET/api/v1/fleet/sites/comparisonCross-site KPI comparison
GET/api/v1/fleet/sites/{site_id}/kpisDetailed KPI rollup for one site
GET/api/v1/fleet/benchmarkEvery machine's OEE and downtime over a window
GET/api/v1/analytics/reliabilityDowntime Pareto, MTTR and MTBF trend, machines and lines
GET/api/v1/agent/heartbeatEdge-agent heartbeat (API key)
POST/api/v1/agent/heartbeatEdge-agent heartbeat with telemetry (API key)
GET/api/v1/agent/fleetStatus of your reporting edge agents (Admin)
PUT/api/v1/agent/nicknamesGive an edge agent a nickname, or remove it (Admin)
POST/api/v1/agent/logsEdge agent sends the lines it logged (API key)
GET/api/v1/agent/logs/agentsEdge agents with log lines kept (Admin)
GET/api/v1/agent/logsOne edge agent's log lines, filtered (Admin)

Endpoints marked Admin require an account administrator role. The three sites endpoints need the Sites page.

Fleet status​

GET /api/v1/fleet/status

Returns each active machine with its status (healthy, warning, critical or offline), its count of active alerts (not acknowledged, not resolved, not snoozed), and its most recent reading time.

curl https://api.haltless.io/api/v1/fleet/status \
-H "Authorization: Bearer YOUR_TOKEN"
{
"total_machines": 45,
"machines": [
{
"machine_id": "...",
"machine_name": "CNC Mill #1",
"machine_identifier": "CNC-001",
"status": "healthy",
"active_alert_count": 0,
"last_reading_at": "2026-08-05T10:30:00Z"
}
]
}

Sites​

A site groups machines so KPIs can be rolled up per location.

List sites​

GET /api/v1/fleet/sites

Returns each site with its aggregated KPIs.

Cross-site comparison​

GET /api/v1/fleet/sites/comparison

Returns a comparison table of key KPIs across all sites in one response.

Site detail​

GET /api/v1/fleet/sites/{site_id}/kpis

Returns the detailed KPI rollup for a single site. Responds 404 if the site does not exist.

Fleet benchmark​

GET /api/v1/fleet/benchmark?days=30

Needs the Machines page, where the benchmark is shown. One request for every active machine you may see: its average OEE over the last days (default 30, 1 to 90; null when it has no OEE records) and its downtime in hours (overlapping stops counted once).

{
"period_days": 30,
"machines": [
{ "machine_id": "550e8400-e29b-41d4-a716-446655440000", "oee_pct": 71.4, "downtime_hours": 12.5 }
]
}

Reliability analytics​

GET /api/v1/analytics/reliability

What the Analytics page shows, over the last window_days (default 90, 1 to 365), narrowed to one machine group with group_id. Needs the Analytics page and the company's advanced reports feature (403 otherwise); a member limited to some machines sees only theirs.

FieldDescription
window_days, window_from, window_toThe window
totalsdowntime_hours, events, mttr_hours, mtbf_hours, machines_with_downtime
paretoDowntime by cause, largest first: cause, category, downtime_hours, events, share_pct, cumulative_pct. The 12 largest causes, the rest folded into one
pareto_threshold_pctWhere the Pareto line is drawn (80)
trendbucket_start, bucket_days, mttr_hours, mtbf_hours, downtime_hours, events per week (per 30 days over a window longer than 180 days)
bucket_daysThe trend's bucket length
machinesPer machine: machine_id, machine_name, downtime_hours, events, mttr_hours, mtbf_hours, oee_pct
linesPer line group: group_id, group_name, machine_count, downtime_hours, events
truncatedtrue when the window held more than 20,000 completed stops, so only the latest were counted

MTTR and MTBF are null where there are too few stops to tell.

Edge-agent heartbeat​

The edge agent calls these endpoints with an edge-agent API key that holds the agent scope (see API Keys and the Edge Agent overview). A key without that scope gets 403.

Heartbeat​

GET /api/v1/agent/heartbeat

Returns 200 while your company's account is active. The success body tells the agent when to check in again (every 5 minutes) and whether an update is available:

{
"status": "active",
"next_check_seconds": 300,
"server_time": "2026-11-24T10:30:00+00:00",
"latest_agent_version": "0.10.0",
"min_supported_version": "0.7.0",
"update_available": false,
"unsupported": false
}

While your company's account is suspended, it returns 402 Payment Required instead, telling the agent to pause and check again later:

{
"detail": {
"error_code": "TENANT_SUSPENDED",
"message": "This company account has been suspended. Contact your administrator for help.",
"next_check_seconds": 300
}
}

server_time is the server's clock in UTC. An agent can compare it with its own: a reading stamped more than 300 seconds ahead of the server is refused.

Heartbeat with telemetry​

POST /api/v1/agent/heartbeat

Posts a telemetry snapshot with the heartbeat. Same authentication and 200/402 behavior as the GET; update_available and unsupported are worked out from the agent_version you send. The agent shows up in the fleet view for 15 minutes after its last heartbeat.

{
"agent_id": "edge-plant-1-abc123",
"agent_version": "0.10.0",
"uptime_seconds": 86400,
"buffer_count": 0,
"buffer_age_hours": 0.0,
"collectors": { "modbus-line-1": "ok", "opcua-line-2": "ok" },
"hostname": "edge-plant-1"
}
FieldDescription
agent_idRequired, 1 to 128 characters
agent_versionRequired, numeric X, X.Y or X.Y.Z; a malformed one returns 422
uptime_seconds, buffer_count, buffer_age_hoursRequired, not negative
collectorsStatus per collector name. Names are cut at 320 characters, statuses at 64, and entries past 1,000 are left out, so a heartbeat is never refused for them
refused_systemsSent from agent 0.9.0: System identifiers whose readings were refused since the last heartbeat (an identifier no active System has), each with the reason. At most 50 are kept
hostnameUp to 253 characters
install_methoddocker or source
update_modemanual or auto
update_windowWhen an automatic update may run, as the site set it (up to 64 characters)

Agent fleet view​

GET /api/v1/agent/fleet

Lists your currently reporting edge agents, as the portal's Edge Agents page shows them. Requires an account administrator role.

{
"agents": [
{
"agent_id": "edge-plant-1-abc123",
"agent_version": "0.10.0",
"hostname": "edge-plant-1",
"uptime_seconds": 86400,
"buffer_count": 0,
"buffer_age_hours": 0.0,
"collectors": { "modbus-line-1": "ok" },
"refused_systems": {},
"last_seen": "2026-08-05T10:30:00Z",
"online": true,
"update_available": false,
"unsupported": false,
"install_method": "docker",
"update_mode": "manual",
"update_window": null,
"nickname": "Press hall, line 3"
}
],
"total": 1,
"latest_agent_version": "0.10.0",
"min_supported_version": "0.7.0"
}

nickname is the name your company gave the agent, or null if it has none.

Nickname an agent​

PUT /api/v1/agent/nicknames

An agent names itself by its host, and a Docker install's host name is its container's id, such as 126cd36274c5. Give each agent a name your team recognises instead. The portal shows the nickname wherever it names the agent, and the fleet view and the agents with logs carry it. Requires an account administrator role, and each change is recorded in the audit log.

{
"agent_id": "edge-plant-1-abc123",
"nickname": "Press hall, line 3"
}

The nickname is trimmed and may be up to 64 characters, on one line; longer, or with a line break, is refused with 422. An empty or null nickname removes it. Any agent id can be named, whether it is reporting or not. The response is the agent's nickname as it now stands:

{
"agent_id": "edge-plant-1-abc123",
"nickname": "Press hall, line 3"
}

Agent logs​

From version 0.10.0 the Edge Agent sends what it logs as well as printing it on its host, every five seconds, unless its site set send_logs: false. Lines are kept for 14 days after they arrive. The portal's Edge Agents page shows them live and back over that time.

Send log lines​

POST /api/v1/agent/logs

Authenticated with an API key holding the agent scope, with the same 402 for a suspended company as the heartbeat. It counts against the key's write budget (see Rate limiting).

{
"agent_id": "edge-plant-1-abc123",
"hostname": "edge-plant-1",
"entries": [
{
"logged_at": "2026-11-27T10:15:02.481Z",
"level": "ERROR",
"logger": "src.collector.s7_collector",
"message": "PLC 10.0.0.5 did not answer: timed out"
}
]
}
FieldDescription
agent_idRequired, 1 to 128 characters: the same id the heartbeat sends
hostnameUp to 253 characters. A batch without one keeps the host named before
entriesThe lines, oldest first. Past 500 the rest are left out
entries[].logged_atWhen the line was logged (ISO 8601); a time without a zone is UTC
entries[].levelDEBUG, INFO, WARNING, ERROR or CRITICAL
entries[].loggerThe part of the agent that logged it; cut at 128 characters
entries[].messageThe line, with its traceback if any; cut at 8,000 characters

A batch is never refused for being over these limits: it is cut. The answer says how many lines were kept:

{
"accepted": 1
}

Agents with logs​

GET /api/v1/agent/logs/agents

Lists every edge agent with lines kept, including one that has stopped reporting and so is no longer in the fleet view. The agent that sent most recently comes first. Requires an account administrator role.

{
"agents": [
{
"agent_id": "edge-plant-1-abc123",
"hostname": "edge-plant-1",
"loggers": ["src.collector.s7_collector", "src.main"],
"last_logged_at": "2026-11-27T10:15:02.481Z",
"last_received_at": "2026-11-27T10:15:04Z",
"nickname": "Press hall, line 3"
}
],
"retention_days": 14
}

loggers names every part of the agent its kept lines came from, for filtering by component.

Read an agent's log​

GET /api/v1/agent/logs?agent_id=edge-plant-1-abc123

One agent's lines, newest first. Requires an account administrator role.

ParameterDescription
agent_idRequired: the agent to read
levelOnly lines of this level. Repeat it for several: level=ERROR&level=CRITICAL
loggerOnly lines from this part of the agent
qOnly lines containing this text (up to 200 characters), in the message or the logger's name, ignoring case
since, untilOnly lines logged at or after, at or before, these times (ISO 8601)
beforeOnly lines that arrived before this seq: the next page back
afterOnly lines that arrived after this seq: what is new since you last read
limitLines per page, 1 to 1,000 (default 200)
{
"entries": [
{
"seq": 48213,
"logged_at": "2026-11-27T10:15:02.481Z",
"received_at": "2026-11-27T10:15:04Z",
"level": "ERROR",
"logger": "src.collector.s7_collector",
"message": "PLC 10.0.0.5 did not answer: timed out"
}
],
"has_more": true
}

seq is the order lines arrived in. To page back, pass the last line's seq as before; has_more says whether older lines remain. To follow the log, pass the newest seq you hold as after: the page holds the oldest lines after it (still newest first within the page), and has_more says that newer ones remain, to ask for at once. before and after cannot be used together, and since must not be after until; either returns 422.