Create Campaign
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/campaign/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workflow_id": 123,
"circuit_breaker": {
"enabled": true,
"failure_threshold": 0.5,
"min_calls_in_window": 5,
"window_seconds": 120
},
"manual_contacts": [
{
"name": "<string>",
"phone_number": "<string>"
}
],
"max_concurrency": 50,
"retry_config": {
"enabled": true,
"max_retries": 2,
"retry_delay_seconds": 120,
"retry_on_busy": true,
"retry_on_no_answer": true,
"retry_on_voicemail": true
},
"schedule_config": {
"slots": [
{
"day_of_week": 3,
"end_time": "<string>",
"start_time": "<string>"
}
],
"enabled": true,
"timezone": "UTC"
},
"source_id": "<string>",
"telephony_configuration_id": 123
}
'import requests
url = "https://agents.labs.bandwidth.com/api/v1/campaign/create"
payload = {
"name": "<string>",
"workflow_id": 123,
"circuit_breaker": {
"enabled": True,
"failure_threshold": 0.5,
"min_calls_in_window": 5,
"window_seconds": 120
},
"manual_contacts": [
{
"name": "<string>",
"phone_number": "<string>"
}
],
"max_concurrency": 50,
"retry_config": {
"enabled": True,
"max_retries": 2,
"retry_delay_seconds": 120,
"retry_on_busy": True,
"retry_on_no_answer": True,
"retry_on_voicemail": True
},
"schedule_config": {
"slots": [
{
"day_of_week": 3,
"end_time": "<string>",
"start_time": "<string>"
}
],
"enabled": True,
"timezone": "UTC"
},
"source_id": "<string>",
"telephony_configuration_id": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
workflow_id: 123,
circuit_breaker: {
enabled: true,
failure_threshold: 0.5,
min_calls_in_window: 5,
window_seconds: 120
},
manual_contacts: [{name: '<string>', phone_number: '<string>'}],
max_concurrency: 50,
retry_config: {
enabled: true,
max_retries: 2,
retry_delay_seconds: 120,
retry_on_busy: true,
retry_on_no_answer: true,
retry_on_voicemail: true
},
schedule_config: {
slots: [{day_of_week: 3, end_time: '<string>', start_time: '<string>'}],
enabled: true,
timezone: 'UTC'
},
source_id: '<string>',
telephony_configuration_id: 123
})
};
fetch('https://agents.labs.bandwidth.com/api/v1/campaign/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"failed_rows": 123,
"id": 123,
"name": "<string>",
"processed_rows": 123,
"retry_config": {
"enabled": true,
"max_retries": 123,
"retry_delay_seconds": 123,
"retry_on_busy": true,
"retry_on_no_answer": true,
"retry_on_voicemail": true
},
"source_id": "<string>",
"source_type": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"state": "<string>",
"total_rows": 123,
"workflow_id": 123,
"workflow_name": "<string>",
"circuit_breaker": {
"enabled": false,
"failure_threshold": 0.5,
"min_calls_in_window": 5,
"window_seconds": 120
},
"executed_count": 0,
"logs": [
{
"event": "<string>",
"level": "<string>",
"message": "<string>",
"ts": "<string>",
"details": {}
}
],
"max_concurrency": 123,
"parent_campaign_id": 123,
"redialed_campaign_id": 123,
"schedule_config": {
"enabled": true,
"slots": [
{
"day_of_week": 123,
"end_time": "<string>",
"start_time": "<string>"
}
],
"timezone": "<string>"
},
"telephony_configuration_id": 123,
"telephony_configuration_name": "<string>",
"total_queued_count": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Campaigns
Create Campaign
Create a new outbound calling campaign
POST
/
api
/
v1
/
campaign
/
create
Create Campaign
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/campaign/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workflow_id": 123,
"circuit_breaker": {
"enabled": true,
"failure_threshold": 0.5,
"min_calls_in_window": 5,
"window_seconds": 120
},
"manual_contacts": [
{
"name": "<string>",
"phone_number": "<string>"
}
],
"max_concurrency": 50,
"retry_config": {
"enabled": true,
"max_retries": 2,
"retry_delay_seconds": 120,
"retry_on_busy": true,
"retry_on_no_answer": true,
"retry_on_voicemail": true
},
"schedule_config": {
"slots": [
{
"day_of_week": 3,
"end_time": "<string>",
"start_time": "<string>"
}
],
"enabled": true,
"timezone": "UTC"
},
"source_id": "<string>",
"telephony_configuration_id": 123
}
'import requests
url = "https://agents.labs.bandwidth.com/api/v1/campaign/create"
payload = {
"name": "<string>",
"workflow_id": 123,
"circuit_breaker": {
"enabled": True,
"failure_threshold": 0.5,
"min_calls_in_window": 5,
"window_seconds": 120
},
"manual_contacts": [
{
"name": "<string>",
"phone_number": "<string>"
}
],
"max_concurrency": 50,
"retry_config": {
"enabled": True,
"max_retries": 2,
"retry_delay_seconds": 120,
"retry_on_busy": True,
"retry_on_no_answer": True,
"retry_on_voicemail": True
},
"schedule_config": {
"slots": [
{
"day_of_week": 3,
"end_time": "<string>",
"start_time": "<string>"
}
],
"enabled": True,
"timezone": "UTC"
},
"source_id": "<string>",
"telephony_configuration_id": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
workflow_id: 123,
circuit_breaker: {
enabled: true,
failure_threshold: 0.5,
min_calls_in_window: 5,
window_seconds: 120
},
manual_contacts: [{name: '<string>', phone_number: '<string>'}],
max_concurrency: 50,
retry_config: {
enabled: true,
max_retries: 2,
retry_delay_seconds: 120,
retry_on_busy: true,
retry_on_no_answer: true,
retry_on_voicemail: true
},
schedule_config: {
slots: [{day_of_week: 3, end_time: '<string>', start_time: '<string>'}],
enabled: true,
timezone: 'UTC'
},
source_id: '<string>',
telephony_configuration_id: 123
})
};
fetch('https://agents.labs.bandwidth.com/api/v1/campaign/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"failed_rows": 123,
"id": 123,
"name": "<string>",
"processed_rows": 123,
"retry_config": {
"enabled": true,
"max_retries": 123,
"retry_delay_seconds": 123,
"retry_on_busy": true,
"retry_on_no_answer": true,
"retry_on_voicemail": true
},
"source_id": "<string>",
"source_type": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"state": "<string>",
"total_rows": 123,
"workflow_id": 123,
"workflow_name": "<string>",
"circuit_breaker": {
"enabled": false,
"failure_threshold": 0.5,
"min_calls_in_window": 5,
"window_seconds": 120
},
"executed_count": 0,
"logs": [
{
"event": "<string>",
"level": "<string>",
"message": "<string>",
"ts": "<string>",
"details": {}
}
],
"max_concurrency": 123,
"parent_campaign_id": 123,
"redialed_campaign_id": 123,
"schedule_config": {
"enabled": true,
"slots": [
{
"day_of_week": 123,
"end_time": "<string>",
"start_time": "<string>"
}
],
"timezone": "<string>"
},
"telephony_configuration_id": 123,
"telephony_configuration_name": "<string>",
"total_queued_count": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Requires a Labs OAuth user access token with the
Replace
super_user role and Editor or higher workspace access. API keys are not accepted for this endpoint. See authentication.
Use source_type: "manual" with manual_contacts, or source_type: "csv" with the file_key returned by upload contacts as source_id.
This request creates the campaign; start it separately when ready. Starting places real calls.
{
"name": "Appointment confirmations",
"workflow_id": 123,
"source_type": "manual",
"manual_contacts": [{"name": "Jane", "phone_number": "+14155550100"}],
"max_concurrency": 1,
"retry_config": {"enabled": false},
"schedule_config": {
"enabled": true,
"timezone": "Europe/Dublin",
"slots": [{"day_of_week": 0, "start_time": "09:00", "end_time": "17:00"}]
}
}
workflow_id and the contact with your tested agent and destination. day_of_week uses 0 for Monday through 6 for Sunday. Each slot’s start must be earlier than its end.
Set telephony_configuration_id to select a specific configuration. When omitted, the workspace default is used. Manual campaigns accept up to 100 contacts.Authorizations
Body
application/json
Response
Successful Response