Push a lead
curl --request POST \
--url https://api.pineyard.ai/v1/campaigns/{campaignId}/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lead": {
"phone": "<string>",
"name": "<string>",
"fields": {}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({lead: {phone: '<string>', name: '<string>', fields: {}}})
};
fetch('https://api.pineyard.ai/v1/campaigns/{campaignId}/leads', 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"
payload = { "lead": {
"phone": "<string>",
"name": "<string>",
"fields": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"leadId": "<string>",
"status": "queued",
"deduplicated": true,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resultUrl": "<string>",
"warnings": {
"undeclaredVariables": [
"<string>"
]
}
}{
"leadId": "<string>",
"status": "queued",
"deduplicated": true,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resultUrl": "<string>",
"warnings": {
"undeclaredVariables": [
"<string>"
]
}
}Leads & results
Push a lead
Push one lead into a standing API campaign. Authenticate with a workspace API key. idempotencyKey is REQUIRED: it is the sole dedup key, so the same phone number can be dialed separately for each distributor/device/alert by sending a distinct, retry-stable key per call. Works for both campaign kinds. A CLASSIC campaign dials the lead on its dial ladder; a JOURNEY campaign (one built on a workflow) instead enrolls the lead into a per-lead run of that workflow, and `lead.fields` become the run's trigger fields — readable in the graph as {{start.fields.<name>}}. Send the field names the workflow's trigger contract lists; any key the graph never reads is echoed back in warnings.undeclaredVariables (the lead is still queued).
POST
/
v1
/
campaigns
/
{campaignId}
/
leads
Push a lead
curl --request POST \
--url https://api.pineyard.ai/v1/campaigns/{campaignId}/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lead": {
"phone": "<string>",
"name": "<string>",
"fields": {}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({lead: {phone: '<string>', name: '<string>', fields: {}}})
};
fetch('https://api.pineyard.ai/v1/campaigns/{campaignId}/leads', 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"
payload = { "lead": {
"phone": "<string>",
"name": "<string>",
"fields": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"leadId": "<string>",
"status": "queued",
"deduplicated": true,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resultUrl": "<string>",
"warnings": {
"undeclaredVariables": [
"<string>"
]
}
}{
"leadId": "<string>",
"status": "queued",
"deduplicated": true,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resultUrl": "<string>",
"warnings": {
"undeclaredVariables": [
"<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

