Skip to main content
POST
/
v1
/
campaigns
curl --request POST \
  --url https://api.topcalls.ai/v1/campaigns \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Spring outreach"
}
'
{
  "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"
}

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"

Body

application/json

Request body for creating a campaign. The campaign is always created with status draft; use the lifecycle endpoints (start/pause/resume/ stop) to change its status.

name
string
required
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>[]

Lead lists to attach to this campaign. Every id must belong to your account.

config
object

Call configuration applied to every call dispatched by this campaign. Same shape as the CreateCallRequest call-configuration fields, applied at the campaign level instead of per-call. Unknown keys are rejected.

Response

Campaign created

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>[]