Push up to 100 leads
curl --request POST \
--url https://api.pineyard.ai/v1/campaigns/{campaignId}/leads/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leads": [
null
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({leads: [null]})
};
fetch('https://api.pineyard.ai/v1/campaigns/{campaignId}/leads/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/v1/campaigns/{campaignId}/leads/batch"
payload = { "leads": [None] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"summary": {
"queued": 123,
"duplicate": 123,
"rejected": 123
},
"results": [
{
"index": 1,
"status": "queued",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"phone": "<string>",
"leadId": "<string>",
"resultUrl": "<string>",
"warnings": {
"undeclaredVariables": [
"<string>"
]
},
"error": "<string>",
"reason": "<string>",
"issues": [
null
],
"retryable": true
}
]
}Leads & results
Push up to 100 leads
Push up to 100 leads into a standing API campaign in one request. Each item has exactly the single-push body () and gets the same treatment: idempotencyKey is required per lead, and a reused key (in this batch or an earlier request) is reported as a duplicate with no second dial. Campaign-level problems reject the whole batch; problems with one lead are reported in that lead’s result and do not affect the others. A rejected lead with retryable: true (journey live cap, or a failure on our side) was not accepted and should be resent later with the same idempotencyKey. Results are returned in request order. A batch counts as one request against the per-key rate limit.
POST
/
v1
/
campaigns
/
{campaignId}
/
leads
/
batch
Push up to 100 leads
curl --request POST \
--url https://api.pineyard.ai/v1/campaigns/{campaignId}/leads/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leads": [
null
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({leads: [null]})
};
fetch('https://api.pineyard.ai/v1/campaigns/{campaignId}/leads/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/v1/campaigns/{campaignId}/leads/batch"
payload = { "leads": [None] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"summary": {
"queued": 123,
"duplicate": 123,
"rejected": 123
},
"results": [
{
"index": 1,
"status": "queued",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"phone": "<string>",
"leadId": "<string>",
"resultUrl": "<string>",
"warnings": {
"undeclaredVariables": [
"<string>"
]
},
"error": "<string>",
"reason": "<string>",
"issues": [
null
],
"retryable": true
}
]
}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
Required array length:
1 - 100 elements
