List and filter batches
GET
/v2/batchesAuthorization
api_key AuthorizationBearer <token>
API key for authentication. Use format: Bearer YOUR_API_KEY
In: header
Query Parameters
ids?array<>
Filter by specific batch IDs.
numbers?array<string>
Filter by batch numbers.
created_after?string
Filter for batches created at or after this time.
Match
^(?:(?:\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)))$Format
date-timecreated_before?string
Filter for batches created at or before this time.
Match
^(?:(?:\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)))$Format
date-timelimit?integer
Maximum number of batches to return. Use cursor to fetch additional results.
Default
50Range
1 <= value <= 100cursor?integer
Cursor for pagination (offset-based). Use with limit to fetch results in batches.
Range
0 <= value <= 9007199254740991search_query?string
Search query to filter batches by batch number or unit serial number.
Length
length <= 100part_numbers?array<string>
Filter batches by part number of contained units.
revision_numbers?array<string>
Filter batches by revision number of contained units.
sort_by?string
Field to sort results by.
Default
"created_at"Value in
"number" | "created_at"sort_order?string
Sort order direction.
Default
"desc"Value in
"asc" | "desc"Response Body
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": "Internal server error",
"code": "INTERNAL_SERVER_ERROR",
"issues": []
}How is this guide?