Create a campaign (v1)
curl --request POST \
--url https://api.pineyard.ai/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "INBOUND",
"phoneNumberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source: 'INBOUND',
phoneNumberId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '',
description: '<string>'
})
};
fetch('https://api.pineyard.ai/v1/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/v1/campaigns"
payload = {
"source": "INBOUND",
"phoneNumberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"campaignId": "<string>",
"contactsAdded": 123,
"contactsSkipped": 123,
"skippedReasons": [
"<string>"
]
}Campaigns
Create a campaign (v1)
Create a new campaign. The campaign is created in DRAFT status. Call /v1/campaigns//start to begin dialing.
POST
/
v1
/
campaigns
Create a campaign (v1)
curl --request POST \
--url https://api.pineyard.ai/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "INBOUND",
"phoneNumberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source: 'INBOUND',
phoneNumberId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '',
description: '<string>'
})
};
fetch('https://api.pineyard.ai/v1/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/v1/campaigns"
payload = {
"source": "INBOUND",
"phoneNumberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"campaignId": "<string>",
"contactsAdded": 123,
"contactsSkipped": 123,
"skippedReasons": [
"<string>"
]
}Required scope:
campaigns.edit
Scopes apply to scoped API keys. Keys issued without scopes can call every
/v1 endpoint.Authorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Body
application/json
- Option 1
- Option 2
Available options:
INBOUND Maximum string length:
100Maximum string length:
280Required range:
1 <= x <= 10Show child attributes
Show child attributes
Pattern:
^\+\d{1,3}$Maximum array length:
5Minimum string length:
1Pattern:
^\d{2}:\d{2}$Pattern:
^\d{2}:\d{2}$Required range:
0 <= x <= 10Required range:
5 <= x <= 43200Maximum array length:
10Required range:
1 <= x <= 43200Required range:
0 <= x <= 100Maximum array length:
40Show child attributes
Show child attributes
Required range:
1 <= x <= 10Required range:
1 <= x <= 10Required range:
1 <= x <= 2160Maximum array length:
10Required range:
1 <= x <= 2160Maximum string length:
500Maximum string length:
200000Maximum string length:
255Required range:
1 <= x <= 5Required range:
1 <= x <= 1440Maximum array length:
5Required range:
1 <= x <= 1440Required range:
5 <= x <= 300Required range:
0 <= x <= 3Required range:
1 <= x <= 10Required range:
1 <= x <= 604800Maximum array length:
10Required range:
1 <= x <= 604800Required range:
1 <= x <= 2592000Required range:
1 <= x <= 100Available options:
VOICE, WHATSAPP, VOICE_THEN_WHATSAPP, WHATSAPP_THEN_VOICE, CUSTOM, EMAIL - Option 1
- Option 2
Show child attributes
Show child attributes
Maximum array length:
20Show child attributes
Show child attributes
Required range:
1 <= x <= 100000Required range:
1 <= x <= 100000Required array length:
1 - 7 elementsRequired range:
0 <= x <= 6Maximum array length:
12Show child attributes
Show child attributes
Minimum string length:
1
