Contacts and results
Upload campaign contacts
Upload a contacts CSV to a campaign. A valid upload moves the campaign from draft to ready and detects custom columns as SIP headers.
POST
/
api
/
v1
/
account
/
{account_id}
/
campaigns
/
{campaign_id}
/
upload
Upload campaign contacts
curl --request POST \
--url https://api.vobiz.ai/api/v1/account/{account_id}/campaigns/{campaign_id}/upload \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <x-auth-id>' \
--header 'X-Auth-Token: <api-key>' \
--data '{}'import requests
url = "https://api.vobiz.ai/api/v1/account/{account_id}/campaigns/{campaign_id}/upload"
payload = {}
headers = {
"X-Auth-ID": "<x-auth-id>",
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Auth-ID': '<x-auth-id>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.vobiz.ai/api/v1/account/{account_id}/campaigns/{campaign_id}/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));POST https://api.vobiz.ai/api/v1/account/{account_id}/campaigns/{campaign_id}/upload
draft to ready.
Authentication required
X-Auth-ID— your Vobiz account IDX-Auth-Token— your Vobiz auth token
string
required
Your Vobiz account ID. Use the same value in
X-Auth-ID.string
required
Your Vobiz account ID, for example
MA_XXXXXXXX.string
required
The campaign that receives the contacts.
file
required
The contacts CSV, sent as
multipart/form-data in a field named file.Example
cURL
curl -X POST \
"https://api.vobiz.ai/api/v1/account/{account_id}/campaigns/{campaign_id}/upload" \
-H "X-Auth-ID: {account_id}" \
-H "X-Auth-Token: {auth_token}" \
-F "file=@contacts.csv"
CSV columns
| Column | Required | Behaviour |
|---|---|---|
to | Always | Destination number in E.164 format. |
from | For per_contact strategy | Caller ID for this contact. |
answer_url | No | Overrides the agent answer URL for this contact. |
hangup_url | No | Overrides the agent hangup URL for this contact. |
| Any other column | No | Sent as a custom SIP header on the call. |
Fixed strategy
to,CustomerID,LeadScore
+919876543210,CUST_001,High
+919876543211,CUST_002,Medium
Per-contact strategy
to,from,answer_url,CustomerID
+919876543210,+912234567890,https://example.com/answer?id=asha,CUST_001
+919876543211,+912234567891,,CUST_002
Response
200 OK
{
"valid_contacts": 980,
"invalid_rows": 20,
"total_rows": 1000,
"custom_headers_detected": ["CustomerID", "LeadScore"]
}
Re-uploading to a
ready campaign replaces every existing contact. Upload is blocked with 409 while a campaign is running, paused, or queued.Was this page helpful?
⌘I
Upload campaign contacts
curl --request POST \
--url https://api.vobiz.ai/api/v1/account/{account_id}/campaigns/{campaign_id}/upload \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <x-auth-id>' \
--header 'X-Auth-Token: <api-key>' \
--data '{}'import requests
url = "https://api.vobiz.ai/api/v1/account/{account_id}/campaigns/{campaign_id}/upload"
payload = {}
headers = {
"X-Auth-ID": "<x-auth-id>",
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Auth-ID': '<x-auth-id>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.vobiz.ai/api/v1/account/{account_id}/campaigns/{campaign_id}/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));