Skip to main content

Endpoint

GET https://api.graine.ai/api/v1/campaigns/

Headers

HeaderRequiredDescription
AuthorizationYesBearer gat_<token>

Query Parameters

ParameterTypeRequiredDescription
organization_idstringNoFilter by org. Defaults to the token’s org
statusstringNoFilter by status: draft · active · paused · cancelled · completed
skipintegerNoPagination offset. Default: 0
limitintegerNoPage size. Default: 50, max: 200

Example Request

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

Response

200 OK

[
  {
    "campaign_id": "cmp_abc123",
    "name": "Q2 Insurance Renewals",
    "status": "active",
    "organization_id": "org_xyz",
    "agent_id": "agent_abc123",
    "phone_numbers": ["+919876543210"],
    "created_at": "2026-05-01T09:00:00Z",
    "updated_at": "2026-05-10T08:30:00Z"
  },
  {
    "campaign_id": "cmp_def456",
    "name": "Customer Follow-up May",
    "status": "paused",
    "organization_id": "org_xyz",
    "agent_id": "agent_xyz789",
    "phone_numbers": ["+919876543211"],
    "created_at": "2026-05-05T10:00:00Z",
    "updated_at": "2026-05-09T14:00:00Z"
  }
]

Code Examples

import requests

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

response = requests.get(url, headers=headers, params=params)
campaigns = response.json()
for c in campaigns:
    print(c["campaign_id"], c["name"], c["status"])
const params = new URLSearchParams({
  organization_id: "org_xyz",
  status: "active",
  skip: 0,
  limit: 50
});

const response = await fetch(
  `https://api.graine.ai/api/v1/campaigns/?${params}`,
  { headers: { Authorization: "Bearer gat_your_token" } }
);
const campaigns = await response.json();
console.log(campaigns);