GymMaintain
Contents · Machines

Machines

GET   /machines?q=treadmill&status=defect&location_id={id}
GET   /machines/{id}
POST  /machines
PATCH /machines/{id}
PATCH /machines/{id}/status

q searches name, brand, model, serial_number, asset_tag. The location_id filter is the numeric id (not a uuid).

status: active | defect | partial_defect | out_of_service | maintenance | waiting_parts | retired.

POST — name is required. Optional: brand, model, type, category, serial_number, asset_tag, location, zone, status (default active), location_id, supplier_id, purchased_at, purchase_price, warranty_until, expected_lifespan_years, commissioned_at. Response 201.

PATCH /machines/{id} — the same fields, all optional. status retired sets retired_at when it is still empty.

PATCH /machines/{id}/status:

{"status":"out_of_service","reason":"Cable snapped"}

status is required, reason is optional. retired sets retired_at. For defect or out_of_service, reason can be stored as blocked_reason.

curl -X POST https://app.gymmaintain.com/api/v1/machines \
  -H "Authorization: Bearer gm_..." -H "Content-Type: application/json" \
  -d '{"name":"Treadmill 4","brand":"Matrix","status":"active","location_id":"<uuid>"}'

Machines cannot be deleted through the API.