Skip to main content
POST
/
CampaignItem
/
{campaignId}
Add a new campaign item to a campaign
curl --request POST \
  --url https://api.starleads.co/CampaignItem/{campaignId} \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <x-api-key>' \
  --data '{
  "phoneNumber": "<string>",
  "dataBag": {},
  "nextTryDate": "<string>"
}'
{
  "id": "<string>",
  "campaignId": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "processedAt": "2023-11-07T05:31:56Z",
  "lastCallDate": "2023-11-07T05:31:56Z",
  "runningStatus": "Pending",
  "attemptCount": 123,
  "phoneNumber": "<string>",
  "nextTryDate": "2023-11-07T05:31:56Z",
  "dataBag": {},
  "result": {
    "tag": {
      "id": "<string>",
      "name": "<string>",
      "color": "<string>"
    },
    "conversation": {
      "id": "<string>",
      "messages": [
        {
          "timestamp": "2023-11-07T05:31:56Z",
          "role": "<string>",
          "text": "<string>",
          "intent": "<string>"
        }
      ]
    },
    "summary": "<string>",
    "isSystem": true,
    "metadata": {}
  },
  "isArchived": true,
  "eventList": [
    {
      "type": "LaunchCall",
      "date": "2023-11-07T05:31:56Z",
      "description": "<string>"
    }
  ]
}

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

Path Parameters

campaignId
string
required

ID of the campaign.

Body

phoneNumber
string
required

Phone number of the campaign item. It must be unique.

Minimum length: 1
dataBag
object | null

The databag refer to the campaign fields. The Databag needs one key / entry per mandatory fields of the targeted campaign.<br>If one mandatory field is missing from the databag, an error will be returned.<br>Databag's keys that aren't properties of the targeted campaign will be ignored.<br>If the campaign has no mandatory fields, this property can be ommited

nextTryDate
string<DateTime format eg : 2023-11-17T12:44:50.809Z> | null

The next date when the number will be called again by Starleads.<br>If this property is not set (or set to null), it will be setted by default to today.

Response

Created

id
string | null
campaignId
string | null
createdAt
string<date-time> | null
processedAt
string<date-time> | null
lastCallDate
string<date-time> | null
runningStatus
enum<string>
Available options:
Pending,
Calling,
Processed,
ProcessingResult,
Error
attemptCount
integer
phoneNumber
string | null
nextTryDate
string<date-time>
dataBag
object | null
result
object
isArchived
boolean
eventList
object[] | null