Skip to main content
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
targets
Add Targets
curl --request POST \
  --url https://api.example.com/api/v1/campaigns/{campaign_id}/targets \
  --header 'Content-Type: application/json' \
  --data '
{
  "targets": [
    {
      "fallback_phone_number": "+19876543210",
      "input_data": {
        "patient_age": 30,
        "patient_gender": "Male",
        "patient_name": "John Doe"
      },
      "phone_number": "+1234567890",
      "pre_call_data": {
        "patient_age": 30,
        "patient_gender": "Male",
        "patient_name": "John Doe"
      }
    }
  ],
  "launch": false,
  "allow_duplicates": true
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Path Parameters

campaign_id
string
required

The ID of the campaign to add targets to.

Body

application/json
targets
TargetInput · object[] | null

The list of targets as TargetInputs

Example:
[
{
"fallback_phone_number": "+19876543210",
"input_data": {
"patient_age": 30,
"patient_gender": "Male",
"patient_name": "John Doe"
},
"phone_number": "+1234567890",
"pre_call_data": {
"patient_age": 30,
"patient_gender": "Male",
"patient_name": "John Doe"
}
}
]
launch
boolean
default:false

Whether to launch the targets immediately or only add them to the campaign

allow_duplicates
boolean
default:true

When set to True all targets with and external ID already contained in the campaign will be ignored

Response

Successful Response