Skip to main content
PATCH
/
v1
/
campaigns
/
{campaign_id}
curl --request PATCH \
  --url https://api.topcalls.ai/v1/campaigns/{campaign_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Spring outreach v2"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "description": "<string>",
  "timezone": "<string>",
  "schedule_time": "2023-11-07T05:31:56Z",
  "dispatch_hours_start": "<string>",
  "dispatch_hours_end": "<string>",
  "dispatch_weekdays": [
    4
  ],
  "dispatch_hours_overrides": {},
  "max_attempts_per_lead": 123,
  "max_parallel_calls": 123,
  "conversion_outcomes": [
    "<string>"
  ],
  "outcome_mapping": {},
  "pause_reason": "<string>",
  "config": {},
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "lead_list_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ]
}
{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}
{
"status": 401,
"title": "Unauthorized",
"detail": "Invalid or missing API key"
}
{
"status": 403,
"title": "Forbidden",
"detail": "Missing required scope: calls:write"
}
{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}

Authorizations

Authorization
string
header
required

Use Authorization: Bearer tc_live_xxxxx

Headers

Idempotency-Key
string

Optional client-supplied idempotency key. When present, the gateway caches the response for 24 hours and returns the same response on retried requests with the same key (account-scoped). Safe for retries on network blips. Format: 8-255 ASCII characters from [A-Za-z0-9_-].

Required string length: 8 - 255
Pattern: ^[A-Za-z0-9_-]+$
Example:

"a1b2c3d4-e5f6-7890-abcd-ef0123456789"

Path Parameters

campaign_id
string<uuid>
required

Campaign UUID

Body

application/json

Request body for updating a campaign. Every field is optional, but the body must not be empty. status is never accepted here; use the lifecycle endpoints (start/pause/resume/stop) instead.

config is merged shallowly with the campaign's existing configuration: an included key overwrites the existing value, an omitted key is left as-is, and a key sent with value null deletes it from the stored configuration. Nested objects are replaced whole, not deep-merged. Non-null config values are validated the same way as POST /v1/campaigns.

lead_list_ids, when included, replaces the full set of lead lists attached to the campaign (send an empty array to detach all of them). Omit it to leave the current lists unchanged.

A configuration change takes effect on the campaign's next dispatch buffer fill, not on calls already queued.

name
string
Minimum string length: 1
description
string
timezone
string

IANA timezone name used to interpret dispatch hours and schedule_time.

dispatch_hours_start
string

Local time of day dispatch may begin. Accepts HH:MM or HH:MM:SS.

Pattern: ^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$
dispatch_hours_end
string

Local time of day dispatch must stop. Accepts HH:MM or HH:MM:SS.

Pattern: ^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$
dispatch_weekdays
integer[]

Weekdays dispatch is allowed, 1=Monday through 7=Sunday.

Required range: 1 <= x <= 7
dispatch_hours_overrides
object

Per-weekday overrides of the default dispatch hours, keyed by ISO weekday string ("1"-"7"). Each value is an array of time windows for that day; an empty array marks the day off entirely.

max_attempts_per_lead
integer
Required range: x >= 1
max_parallel_calls
integer
Required range: x >= 1
schedule_time
string<date-time>

When set to a future time, the campaign starts as scheduled instead of running immediately.

lead_list_ids
string<uuid>[]

Replaces the full set of lead lists attached to this campaign. Every id must belong to your account. Omit this field to leave the current lists unchanged; send an empty array to detach all of them.

config
object

Shallow merge with the campaign's existing configuration. Send null for a key to delete it. Non-null values follow the same fields and validation as CampaignConfig.

Response

Campaign updated

Campaign record. Returned by GET /v1/campaigns and GET /v1/campaigns/{campaign_id}. Projected to this documented field set; additional internal columns are never included.

id
string<uuid>
account_id
string<uuid>
name
string
description
string | null
status
enum<string>
Available options:
draft,
scheduled,
running,
paused,
completed,
failed,
cancelled
timezone
string | null

IANA timezone name used to interpret dispatch hours and schedule_time.

schedule_time
string<date-time> | null
dispatch_hours_start
string | null

Local time of day dispatch may begin, HH:MM:SS.

dispatch_hours_end
string | null

Local time of day dispatch must stop, HH:MM:SS.

dispatch_weekdays
integer[]

Weekdays dispatch is allowed, 1=Monday through 7=Sunday.

Required range: 1 <= x <= 7
dispatch_hours_overrides
object | null

Per-weekday overrides of the default dispatch hours.

max_attempts_per_lead
integer
max_parallel_calls
integer | null
conversion_outcomes
string[] | null
outcome_mapping
object | null
pause_reason
string | null
config
object

Call configuration applied to every call dispatched by this campaign.

created_at
string<date-time>
updated_at
string<date-time> | null
lead_list_ids
string<uuid>[]