Skip to main content
POST
/
Campaign
Create a campaign
curl --request POST \
  --url https://api.starleads.co/Campaign \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "name": "My prospecting campaign",
  "agentId": "agent-123-abc",
  "phoneNumber": "+33123456789",
  "maxRetries": 3,
  "delayBetweenRetries": 2,
  "webhookUrl": "https://example.com/webhook",
  "timezone": "Europe/Paris",
  "schedule": [
    {
      "day": "Monday",
      "timeRanges": [
        {
          "startTime": "09:00:00",
          "endTime": "12:00:00"
        },
        {
          "startTime": "14:00:00",
          "endTime": "17:00:00"
        }
      ]
    }
  ]
}
'
{
  "id": "<string>",
  "name": "<string>",
  "agentId": "<string>",
  "phoneNumber": "<string>",
  "maxRetries": 123,
  "delayBetweenRetries": 123,
  "webhookUrl": "<string>",
  "country": "<string>",
  "timezone": "<string>",
  "schedule": [
    {
      "day": "Sunday",
      "timeRanges": [
        {
          "startTime": "09:00:00",
          "endTime": "12:00:00"
        }
      ]
    }
  ],
  "isActive": true
}

Authorizations

X-Api-Key
string
header
required

Headers

X-Api-Key
string
required

Api key to pass as a X-Api-Key request header. You can get yours in your profile when authenticated in Starleads

Body

application/json

Request payload to create a new campaign

name
string
required

Name of the campaign

agentId
string
required

ID of the AI agent to associate with the campaign

phoneNumber
string | null

Outbound phone number. Required if the agent channel is Phone. Must belong to the company's phone number list

maxRetries
integer<int32> | null

Maximum number of call retries (default: 3, min: 1, max: 4)

Required range: 1 <= x <= 4
delayBetweenRetries
number<double> | null

Delay between retries in hours (default: 2). Must be greater than 0

webhookUrl
string | null

Webhook URL to receive campaign events. Must be a valid HTTP/HTTPS URL

timezone
string | null

Timezone identifier (default: "Europe/Paris")

schedule
object[] | null

Campaign schedule. Defaults to Monday-Friday 09:00-12:00 / 14:00-17:00 if not provided

Response

Campaign created successfully

Response returned after a campaign is successfully created

id
string

Unique identifier of the created campaign

name
string

Name of the campaign

agentId
string

ID of the AI agent associated with the campaign

phoneNumber
string | null

Outbound phone number (null for web agents)

maxRetries
integer<int32>

Maximum number of retry attempts (between 1 and 4)

delayBetweenRetries
number<double>

Delay between retry attempts in hours

webhookUrl
string | null

Webhook URL for campaign event notifications

country
string

Country code (always FR)

timezone
string

Timezone identifier (e.g. Europe/Paris)

schedule
object[]

Weekly schedule defining the calling time slots

isActive
boolean

Whether the campaign is active (always false at creation)