Work orders
The work orders endpoint lists your organisation's work orders with their operations and the jobs run against each. It includes work orders that were imported but never started, which no other endpoint shows, and each operation's conversion from part-count pulses to finished parts.
Field names match what POST /api/v1/jobs takes (wo_number, step_number, part_unique_identifier, part_issue, recipe_version), so an operation plus a machine and a start time is a complete request to clock a job on.
If your organisation doesn't use work orders, the list is empty and every id returns 404.
Permissions
| Endpoint | Method | Read-only Access | Read-write Access | Description |
|---|---|---|---|---|
/api/v1/work_orders | GET | ✅ | ✅ | List work orders |
/api/v1/work_orders/:id | GET | ✅ | ✅ | One work order |
GET /api/v1/work_orders
Required role: read-only or read-write
Query parameters (all optional; list parameters take name[]=A&name[]=B or a single bare value):
statuses[]:planned,released,in_progress,completedorcancelled.wo_numbers[]: work order numbers, exactly.part_unique_identifiers[]: part numbers, exactly.machine_foreign_ids[]/machine_display_names[]: work orders a machine is part of: an operation routed to a capability the machine has (which finds orders not yet started), or a job run on it. Matched as on the other endpoints: exactly, archived machines included, an unknown machine a422.has_jobs:falsefor work orders with no job run on any operation (never started, whatever their status says);truefor those with at least one. Deleted jobs don't count.due_from/due_to: due-date window, ISO8601 dates or timestamps. A bare-datedue_toincludes that day.offset,limit: paging, at most 500 per call (the default), ordered by creation. When there are more, theX-Next-Offsetresponse header says where the next page starts (absent on the last page), besideX-Total-Count.
Any other parameter returns 422 naming it.
Example request
The work orders not yet started on one machine:
curl "https://your-org.trackmymachines.app/api/v1/work_orders?machine_foreign_ids[]=MAZA-L1&has_jobs=false" \
-H "Authorization: Bearer YOUR_API_KEY"
Example response
[
{
"id": "wo_Jd8sK2mQpL0xVn4R",
"wo_number": "WO1820505",
"status": "released",
"part_unique_identifier": "PART123",
"part_issue": "C",
"recipe_version": 1,
"quantity_expected": 40,
"quantity_made": 0,
"quantity_scrapped": 0,
"due_date": "2026-11-06T17:00:00Z",
"started_at": null,
"completed_at": null,
"operations": [
{
"step_number": 30,
"description": "Mill second side",
"time_per_part": 840,
"expected_setup_time": 3600,
"number_of_subops": 2,
"output_parts": 1,
"machine_group": "5-axis",
"quantity_made": 0,
"quantity_scrapped": 0,
"jobs": []
}
]
}
]
Response fields
id: the work order's public id (wo_…), accepted byGET /api/v1/work_orders/:id.wo_number: the work order number.status:planned,released,in_progress,completedorcancelled, as set by your import or in TrackMyMachines.part_unique_identifier,part_issue,recipe_version: the part, its issue and the route version.quantity_expected,quantity_made,quantity_scrapped: the target and what finished jobs have counted.due_date,started_at,completed_at: ISO8601, ornull.operations: in operation order, each with:step_number: the operation number.description: what the operation does.time_per_part,expected_setup_time: seconds.time_per_partis the time for one finished part; one sequence takestime_per_part×output_parts.number_of_subops,output_parts: how part-count pulses become parts. One sequence takesnumber_of_subopspulses and yieldsoutput_partsparts, so finished parts = pulses ÷number_of_subops(rounded down) ×output_parts. That is the conversion/jobsapplies topart_count.machine_group: the machine capability the operation is routed to, ornull.quantity_made,quantity_scrapped: counted on this operation.jobs: the jobs run against the operation, oldest first:id(evt_…, forGET /api/v1/jobs/:id),machine_foreign_id,machine_display_name,from, andto(nullwhile running). Deleted jobs are left out.
GET /api/v1/work_orders/:id
One work order by its wo_… id, in the same shape as an element of the list. To look one up by its number, use GET /api/v1/work_orders?wo_numbers[]=WO1820505.
Error responses
404 Not Found—{ "error": "WorkOrder not found" }422 Unprocessable Entity—{ "error": "Unknown parameter: colour. GET /work_orders takes: …" }422 Unprocessable Entity—{ "error": "Unknown status: shipped. Statuses are: planned, released, in_progress, completed, cancelled." }422 Unprocessable Entity—{ "error": "no machine with foreign id 'MAZA-L9'" }