Pagination & Filtering
All list endpoints support pagination and field selection to efficiently retrieve data.
Pagination Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number (1-indexed) |
limit | number | 100 | Items per page (max 500) |
Example Request
curl -X GET "https://orchestrator.assemblyline.sh/api/v1/stations?page=2&limit=50" \
-H "api-key: al_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx"
Response Format
All list responses include a page_context object with pagination metadata:
{
"data": [...],
"page_context": {
"count": 50,
"page": 2,
"per_page": 50,
"total": 142,
"has_more": true
}
}
| Field | Description |
|---|---|
count | Number of items in this page |
page | Current page number |
per_page | Items requested per page |
total | Total number of items matching the query |
has_more | Whether more pages are available |
Field Selection
Use the fields parameter to request only specific fields:
curl -X GET "https://orchestrator.assemblyline.sh/api/v1/stations?fields=id,short_code,name" \
-H "api-key: al_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx"
This returns only the requested fields:
{
"data": [
{
"id": "abc123",
"short_code": "P1",
"name": "Invoice Validation"
}
],
"page_context": { ... }
}
Filtering
Each endpoint supports specific filter parameters. Common patterns include:
| Filter | Example | Description |
|---|---|---|
is_enabled | ?is_enabled=true | Filter by enabled stations |
tag | ?tag=monthly | Filter by tag name |
station_id | ?station_id=def456 | Filter work records by station |
status | ?status=completed | Filter work records by status |
See individual endpoint documentation for available filters.
Iterating Through All Results
To retrieve all results, iterate through pages until has_more is false:
let page = 1;
let has_more = true;
const all_results = [];
while (has_more) {
const response = await fetch(
`https://orchestrator.assemblyline.sh/api/v1/stations?page=${page}&limit=100`,
{ headers: { 'api-key': key, 'api-secret': secret } }
);
const data = await response.json();
all_results.push(...data.data);
has_more = data.page_context.has_more;
page++;
}