Endpoint
GEThttps://api.graine.ai/api/v1/batches/{batch_id}/debug
Returns diagnostic information about a batch’s internal state. Use this when a batch is in_progress but calls don’t seem to be going out.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
batch_id | string | Yes | Batch to inspect |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer gat_<token> |
Example Request
Response
200 OK — Healthy batch
200 OK — Stuck batch
Response Fields
| Field | Description |
|---|---|
status_breakdown | Per-status contact count and oldest_updated_at timestamp |
pending_sample | Up to 3 oldest contact_ids in PENDING state — useful for grepping worker logs |
diagnostics.stuck_pending | true if pending contacts have stale timestamps (>30 min with no progress) |
diagnostics.tip | Human-readable next step to fix the issue |
How to Interpret Results
stuck_pending: true — worker down
stuck_pending: true — worker down
Cause: The Apollo worker container is not running or not connected to Kafka, so
PENDING contacts are never being consumed and dispatched.Fix:- Restart the worker container
- Wait ~30 seconds for it to reconnect
- POST to
/batches/{id}/dispatchto re-publish pending contacts
All contacts stuck in dispatched (never complete)
All contacts stuck in dispatched (never complete)
Cause: The telephony provider (RotaryRouter / Jambonz) is accepting calls but not sending status webhooks back to Apollo.Fix:
- Check RotaryRouter logs for webhook delivery failures
- Verify the
APOLLO_WEBHOOK_URLenv var in RotaryRouter points to Apollo’s/webhooks/call-status - Check network connectivity between RotaryRouter and Apollo
High no_answer count
High no_answer count
Cause: Contacts aren’t answering. Could be time-of-day, invalid numbers, or carrier blocking.Fix:
- Review working_hours configuration — are you calling at the right time?
- Check if specific area codes or number ranges are failing
- Consider reducing concurrency to avoid appearing as spam
Batch completed but count looks wrong
Batch completed but count looks wrong
Cause: Counters might show stale data from the batch document.Fix: Counters in
GET /batches/{id} are always computed live. If they look wrong, compare with GET /batches/{id}/contacts status breakdown to see the ground-truth per-contact status.Next Steps
Force Dispatch
Re-publish pending contacts to Kafka
Get Batch
Check current batch status and counters