Endpoint
PATCH https://api.graine.ai/api/v1/campaigns/{campaign_id}
This is a partial update — only the fields you provide are changed. All Campaign fields are patchable.
Path Parameters
| Parameter | Type | Required | Description |
|---|
campaign_id | string | Yes | Campaign to update |
| Header | Required | Description |
|---|
Authorization | Yes | Bearer gat_<token> |
Content-Type | Yes | application/json |
Request Body
Send only the fields you want to change. Any subset of Campaign fields is accepted.
Common update patterns
Rename a campaign
{ "name": "Q2 Insurance Renewals (Updated)" }
Tighten the retry policy
{
"retry_policy": {
"max_retries": 5,
"strategy": "fixed",
"cooldown_minutes": 45
}
}
Switch phone number strategy
{ "phone_number_strategy": "least_loaded" }
Add a phone number
{ "phone_numbers": ["+919876543210", "+919876543211", "+919876543212"] }
Updating working_hours or timezone on a running campaign takes effect immediately — in-flight calls are not affected but newly dispatched contacts will use the new schedule.
Example Request
curl -X PATCH "https://api.graine.ai/api/v1/campaigns/cmp_abc123" \
-H "Authorization: Bearer gat_your_token" \
-H "Content-Type: application/json" \
-d '{"name": "Q2 Insurance Renewals (Updated)", "retry_policy": {"max_retries": 5, "strategy": "fixed", "cooldown_minutes": 45}}'
Response
200 OK
Returns the updated campaign object.
{
"campaign_id": "cmp_abc123",
"name": "Q2 Insurance Renewals (Updated)",
"retry_policy": {
"max_retries": 5,
"strategy": "fixed",
"cooldown_minutes": 45
},
"status": "active"
}
404 Not Found
{ "detail": "Campaign not found" }