Skip to main content

Machines

Manage your machine fleet , register, update, query, and organize machines into groups.

Create a machine

POST /machines

Auth: Bearer JWT (admin, operator)

curl -X POST https://api.haltless.io/api/v1/machines \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "CNC Mill #1",
"machine_identifier": "CNC-001",
"protocol": "json",
"location": "Building A, Line 3"
}'

Request body:

FieldTypeRequiredDescription
namestringYesHuman-readable name
machine_identifierstringYesUnique identifier (used in ingestion)
protocolstringYesopc_ua, modbus_tcp, csv, json
locationstringNoPhysical location

Response 201:

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "CNC Mill #1",
"machine_identifier": "CNC-001",
"protocol": "json",
"location": "Building A, Line 3",
"status": "offline",
"tenant_id": "...",
"is_active": true,
"created_at": "2026-04-04T10:00:00Z",
"updated_at": "2026-04-04T10:00:00Z"
}

List machines

GET /machines

Auth: Bearer JWT (any role)

ParameterTypeDefaultDescription
pageint1Page number
page_sizeint20Items per page (max 100)
group_iduuid-Filter by machine group
searchstring-Search by name/identifier (max 200 chars)
statusstring-Filter by status: healthy, warning, critical, offline
sort_bystringnameSort field
sort_dirstringascasc or desc
curl "https://api.haltless.io/api/v1/machines?status=critical&page_size=50" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"items": [
{
"id": "...",
"name": "CNC Mill #1",
"machine_identifier": "CNC-001",
"status": "critical",
"protocol": "json",
"location": "Building A",
"created_at": "2026-04-04T10:00:00Z"
}
],
"total": 1,
"page": 1,
"page_size": 50,
"total_pages": 1
}

Get a machine

GET /machines/{machine_id}

Auth: Bearer JWT (any role)

curl https://api.haltless.io/api/v1/machines/MACHINE_ID \
-H "Authorization: Bearer YOUR_TOKEN"

Update a machine

PATCH /machines/{machine_id}

Auth: Bearer JWT (admin, operator)

curl -X PATCH https://api.haltless.io/api/v1/machines/MACHINE_ID \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"location": "Building B, Line 1"}'

All fields are optional , only include fields you want to change.

Delete a machine

DELETE /machines/{machine_id}

Auth: Bearer JWT (admin, operator)

Performs a soft-delete (machine is deactivated, not permanently removed).

curl -X DELETE https://api.haltless.io/api/v1/machines/MACHINE_ID \
-H "Authorization: Bearer YOUR_TOKEN"

Response: 204 No Content

Import machines (CSV/XLSX)

POST /machines/import

Auth: Bearer JWT (admin, operator)

Bulk import up to 500 machines from a CSV or XLSX file.

curl -X POST https://api.haltless.io/api/v1/machines/import \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@machines.csv"

Required columns: name, machine_identifier, protocol

Optional columns: location

Response:

{
"created": 45,
"skipped": 3,
"errors": [
{"row": 12, "error": "Duplicate machine_identifier: CNC-003"}
]
}

Machine groups

Organize machines into hierarchical groups (sites, lines, departments).

Create a group

POST /machine-groups

Auth: Bearer JWT (admin, operator)

{
"name": "Building A",
"group_type": "site",
"parent_id": null,
"description": "Main production facility"
}

Group types: site, line, department, custom

List groups

GET /machine-groups

Get group tree

GET /machine-groups/tree

Returns the full hierarchy as a nested tree structure.

Update group members

PUT /machine-groups/{group_id}/members

{
"machine_ids": ["uuid1", "uuid2", "uuid3"]
}

Machine statuses

StatusDescription
healthyAll metrics within normal baselines
warningOne or more metrics above warning threshold
criticalOne or more metrics above critical threshold
offlineNo readings received recently

Statuses are computed automatically based on sensor data and alert rules.