Trigger a CRM lead import into a campaign
curl --request POST \
--url https://api.pineyard.ai/campaigns/{id}/import-from-crm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectionId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connectionId: '<string>'})
};
fetch('https://api.pineyard.ai/campaigns/{id}/import-from-crm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/campaigns/{id}/import-from-crm"
payload = { "connectionId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"import": {
"id": "<string>",
"status": "PENDING",
"fetched": 123,
"added": 123,
"skipped": 123,
"startedAt": "<string>",
"finishedAt": "<string>",
"errors": null
}
}CRM
Trigger a CRM lead import into a campaign
POST
/
campaigns
/
{id}
/
import-from-crm
Trigger a CRM lead import into a campaign
curl --request POST \
--url https://api.pineyard.ai/campaigns/{id}/import-from-crm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectionId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connectionId: '<string>'})
};
fetch('https://api.pineyard.ai/campaigns/{id}/import-from-crm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/campaigns/{id}/import-from-crm"
payload = { "connectionId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"import": {
"id": "<string>",
"status": "PENDING",
"fetched": 123,
"added": 123,
"skipped": 123,
"startedAt": "<string>",
"finishedAt": "<string>",
"errors": null
}
}Required scope:
crm.edit, and API keys additionally need campaigns.edit.
