List and filter units
/v2/unitsAuthorization
api_key API key for authentication. Use format: Bearer YOUR_API_KEY
In: header
Query Parameters
Search query to filter units by serial number.
Filter by specific unit IDs.
Filter by unit serial numbers.
Filter by component part numbers.
Filter by revision numbers.
Filter by batch numbers. Use empty string ("") alone to filter for units without a batch.
Filter by procedure IDs of runs on the unit.
Filter by outcomes of runs on the unit.
Filter for units with runs started at or after this time.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$date-timeFilter for units with runs started at or before this time.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$date-timeWhen true, procedure/outcome/started filters apply only to the latest run per unit.
falseFilter for units with at least this many test runs.
0 <= value <= 9007199254740991Filter for units with at most this many test runs.
0 <= value <= 9007199254740991Filter for units created at or after this time.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$date-timeFilter for units created at or before this time.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$date-timeFilter by user IDs who created the units.
Filter by station IDs that created the units.
Exclude sub-units (units that have a parent). Shows only top-level units.
falseFilter by reference-sample classification. Omit to include all units (production + references). Pass ['golden'] for known-good references only, ['failing'] for known-faulty references only, or any combination.
Maximum number of units to return.
501 <= value <= 100Cursor for pagination. Use next_cursor from previous response to fetch next page.
-9007199254740991 <= value <= 9007199254740991Field to sort results by. last_run_at sorts by most recent test run date. last_run_procedure sorts by procedure name of the last run.
"created_at""serial_number" | "created_at" | "last_run_at" | "part_number" | "last_run_procedure"Sort order direction.
"desc""asc" | "desc"Filter units by custom metadata. Supports up to 5 keys per request. Per-key operators: string {in: [...]}/{contains: "..."}, number {gte, lte, gt, lt, eq}, bool {eq: true|false}.
When true, includes the unit metadata array in the response. Defaults to false to keep payloads small.
falseResponse Body
application/json
application/json
application/json
curl -X GET "https://example.com/v2/units"{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"serial_number": "SN-2024-001234",
"created_at": "2024-01-15T10:30:00Z",
"sample": null,
"created_by_user": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "John Doe"
},
"created_by_station": {
"id": "550e8400-e29b-41d4-a716-446655440002",
"name": "Assembly Station 01"
},
"batch": {
"id": "550e8400-e29b-41d4-a716-446655440005",
"number": "BATCH-2024-Q1-001"
},
"parent": {
"id": "550e8400-e29b-41d4-a716-446655440004",
"serial_number": "SN-2024-001233"
},
"children": [
{
"id": "550e8400-e29b-41d4-a716-446655440006",
"serial_number": "SN-2024-001235"
}
],
"part": {
"id": "550e8400-e29b-41d4-a716-446655440008",
"number": "PCB-MAIN-001",
"name": "Main Control Board",
"revision": {
"id": "550e8400-e29b-41d4-a716-446655440007",
"number": "REV-A"
}
},
"last_run": {
"id": "550e8400-e29b-41d4-a716-446655440009",
"outcome": "PASS",
"started_at": "2024-01-15T10:25:00Z",
"ended_at": "2024-01-15T10:30:00Z",
"procedure": {
"id": "550e8400-e29b-41d4-a716-446655440010",
"name": "PCB Assembly Test"
}
},
"metadata": {
"vendor": "Acme",
"lot_size": 500,
"qualified": true
}
}
],
"meta": {
"has_more": true,
"next_cursor": 100
}
}{
"message": "Unauthorized",
"code": "UNAUTHORIZED",
"issues": []
}{
"message": "Internal server error",
"code": "INTERNAL_SERVER_ERROR",
"issues": []
}How is this guide?