List and filter batches
/v2/batchesAuthorization
api_key API key for authentication. Use format: Bearer YOUR_API_KEY
In: header
Query Parameters
Filter by specific batch IDs.
Filter by batch numbers.
Filter for batches created at or after this timestamp.
^(?:(?:\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 batches created at or before this timestamp.
^(?:(?:\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-timeMaximum number of batches to return. Use cursor to fetch additional results.
501 <= value <= 100Cursor for pagination (offset-based). Use with limit to fetch results in batches.
0 <= value <= 9007199254740991Search query to filter batches by batch number or unit serial number.
length <= 100Filter batches by part number of contained units.
Filter batches by revision number of contained units.
Field to sort results by.
"created_at""number" | "created_at"Sort order direction.
"desc""asc" | "desc"Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v2/batches"{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"number": "BATCH-2024-001",
"created_at": "2024-01-15T10:30:00Z",
"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"
},
"unit_count": 150
}
],
"meta": {
"has_more": true,
"next_cursor": 50
}
}{
"message": "Bad request",
"code": "BAD_REQUEST",
"issues": []
}{
"message": "Unauthorized",
"code": "UNAUTHORIZED",
"issues": []
}{
"message": "Request timeout",
"code": "TIMEOUT",
"issues": []
}{
"message": "Internal server error",
"code": "INTERNAL_SERVER_ERROR",
"issues": []
}How is this guide?
Get batch GET
Get a batch by number, with its units, serial numbers, and part revisions. TofuPilot REST API reference with its parameters, response schema, and status codes.
Update batch PATCH
Rename a batch. The current number matches case-insensitively. TofuPilot REST API reference with its parameters, response schema, and status codes.