Skip to main content

Endpoint

GET https://api.graine.ai/api/v1/batches/ Returns batches with live contact-status counters per batch.

Headers

HeaderRequiredDescription
AuthorizationYesBearer gat_<token>

Query Parameters

ParameterTypeRequiredDescription
organization_idstringNoFilter by org. Defaults to token’s org
campaign_idstringNoFilter batches to a specific campaign
statusstringNoFilter by batch status: pending · in_progress · paused · completed · cancelled · expired
skipintegerNoOffset. Default: 0
limitintegerNoPage size. Default: 50

Example Request

curl "https://api.graine.ai/api/v1/batches/?organization_id=org_xyz&status=in_progress&limit=50" \
  -H "Authorization: Bearer gat_your_token"

Response

200 OK

[
  {
    "batch_id": "btc_xyz001",
    "campaign_id": "cmp_abc123",
    "organization_id": "org_xyz",
    "status": "in_progress",
    "total_contacts": 100,
    "concurrency_limit": 10,
    "scheduled_start": null,
    "counters": {
      "pending": 22,
      "dispatched": 3,
      "in_flight": 5,
      "retrying": 4,
      "completed": 58,
      "failed": 3,
      "busy": 5,
      "no_answer": 0
    },
    "created_at": "2026-05-08T09:00:00Z",
    "updated_at": "2026-05-10T08:30:00Z"
  }
]

Code Examples

import requests

url = "https://api.graine.ai/api/v1/batches/"
headers = { "Authorization": "Bearer gat_your_token" }
params = {
    "organization_id": "org_xyz",
    "campaign_id": "cmp_abc123",
    "status": "in_progress",
    "skip": 0,
    "limit": 50
}

response = requests.get(url, headers=headers, params=params)
batches = response.json()
for b in batches:
    print(b["batch_id"], b["status"], b["counters"]["completed"])