Queue
Read live truck-queue depth, congestion state, and historical wait patterns for your own delivery locations. Requires the queue.read scope. Payloads are privacy-stripped — truck identifier and commodity only, never driver identity.
These endpoints are livemode-only: queue entries are not sandbox-partitioned, so sandbox tokens receive a 400 sandbox_unsupported error rather than a misleading empty queue.
Prefer push over polling? Subscribe to the queue.congestion_started and queue.congestion_cleared webhook events — they fire when a yard crosses (and later clears) its configured congestion threshold.
Live queue snapshot
Real-time queue for one queue-enabled location you own. estimated_wait_minutes_low/_high is the join-the-line-now estimate; both are null until the location has enough completed unloads to model (3+).
- Name
id- Type
- integer
- Description
- Delivery location id, from GET /delivery-locations (path).
Request
curl "https://api.mygrainexchange.com/v1/delivery-locations/184/queue" \
-H "Authorization: Bearer {token}"
Response
{
"data": {
"id": 184,
"name": "Rosetown",
"timezone": "America/Regina",
"open_now": true,
"congested": false,
"trucks_waiting": 6,
"trucks_called": 1,
"estimated_wait_minutes_low": 40,
"estimated_wait_minutes_high": 60,
"entries": [
{
"truck_identifier": "SK 442-KLM",
"commodity": "Feed Barley",
"status": "waiting",
"position": 4,
"checked_in_at": "2026-08-04T15:12:00Z"
}
]
}
}
Historical wait patterns
Trailing averages plus a day-of-week × hour matrix of average wait and truck volume — the same numbers behind the elevator's Insights page and the public "best times to deliver" hints. Hours are local to the location's timezone; day_of_week is 1 (Monday) through 7 (Sunday). Buckets with fewer than 3 samples return null averages with the fields present, so generated types stay stable.
- Name
id- Type
- integer
- Description
- Delivery location id (path).
- Name
days- Type
- integer
- Description
- Trailing window in days. Default 56, max 180.
Request
curl "https://api.mygrainexchange.com/v1/delivery-locations/184/queue/wait-times?days=56" \
-H "Authorization: Bearer {token}"
Response
{
"data": {
"id": 184,
"timezone": "America/Regina",
"avg_wait_minutes": 32,
"avg_unload_minutes": 11,
"sample_count": 384,
"by_hour": [
{
"day_of_week": 2,
"hour": 10,
"avg_wait_minutes": 18,
"trucks": 41
}
]
}
}