Add contacts to a campaign
curl --request POST \
--url https://api.pineyard.ai/campaigns/{id}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"phone": "<string>",
"name": "<string>",
"metadata": {}
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contacts: [{phone: '<string>', name: '<string>', metadata: {}}]})
};
fetch('https://api.pineyard.ai/campaigns/{id}/contacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/campaigns/{id}/contacts"
payload = { "contacts": [
{
"phone": "<string>",
"name": "<string>",
"metadata": {}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"added": 123,
"total": 123
}Contacts
Add contacts to a campaign
Add up to 10,000 contacts to a DRAFT campaign. Phones must be E.164. Duplicates in the request and phones already in the campaign are skipped. For phones that already exist in your workspace, the existing contact’s name and metadata are kept. added counts new contacts; total counts valid unique phones in this request.
POST
/
campaigns
/
{id}
/
contacts
Add contacts to a campaign
curl --request POST \
--url https://api.pineyard.ai/campaigns/{id}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"phone": "<string>",
"name": "<string>",
"metadata": {}
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contacts: [{phone: '<string>', name: '<string>', metadata: {}}]})
};
fetch('https://api.pineyard.ai/campaigns/{id}/contacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/campaigns/{id}/contacts"
payload = { "contacts": [
{
"phone": "<string>",
"name": "<string>",
"metadata": {}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"added": 123,
"total": 123
}Required scope:
campaigns.edit
