Upsert event route
curl --request POST \
--url https://dashboard.ondial.ai/api/v1/event-routes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventType": "lead.created",
"campaignId": "6a7acc769198505873b9c0b0",
"defaultChannels": [
"call"
],
"enabled": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
eventType: 'lead.created',
campaignId: '6a7acc769198505873b9c0b0',
defaultChannels: ['call'],
enabled: true
})
};
fetch('https://dashboard.ondial.ai/api/v1/event-routes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dashboard.ondial.ai/api/v1/event-routes"
payload = {
"eventType": "lead.created",
"campaignId": "6a7acc769198505873b9c0b0",
"defaultChannels": ["call"],
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"route": {
"id": "<string>",
"_id": "<string>",
"eventType": "<string>",
"campaignId": "<string>",
"defaultChannels": [
"<string>"
],
"enabled": true
}
}{
"error": "Invalid or inactive API key",
"reasonCode": "unauthorized"
}{
"error": "Not found",
"reasonCode": "not_found"
}{
"error": "<string>",
"reasonCode": "<string>",
"missing": [
"<string>"
]
}Upsert event route
Map an eventType to a campaign and default channels.
POST
/
api
/
v1
/
event-routes
Upsert event route
curl --request POST \
--url https://dashboard.ondial.ai/api/v1/event-routes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventType": "lead.created",
"campaignId": "6a7acc769198505873b9c0b0",
"defaultChannels": [
"call"
],
"enabled": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
eventType: 'lead.created',
campaignId: '6a7acc769198505873b9c0b0',
defaultChannels: ['call'],
enabled: true
})
};
fetch('https://dashboard.ondial.ai/api/v1/event-routes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dashboard.ondial.ai/api/v1/event-routes"
payload = {
"eventType": "lead.created",
"campaignId": "6a7acc769198505873b9c0b0",
"defaultChannels": ["call"],
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"route": {
"id": "<string>",
"_id": "<string>",
"eventType": "<string>",
"campaignId": "<string>",
"defaultChannels": [
"<string>"
],
"enabled": true
}
}{
"error": "Invalid or inactive API key",
"reasonCode": "unauthorized"
}{
"error": "Not found",
"reasonCode": "not_found"
}{
"error": "<string>",
"reasonCode": "<string>",
"missing": [
"<string>"
]
}campaignId must be an API campaign you own. Example eventType: lead.created, invoice.overdue.Authorizations
Paste only your API key (ond_live_… or ond_test_…). Do not type the word Bearer — the playground adds it.
Body
application/json

