campaignId - copy call.lead / email.lead / whatsapp.lead. Optional Validate lead (nothing is created).
Direct lead push
scheduledAt to dial immediately. ISO 8601 UTC. Scheduler picks up the contact once the clock reaches scheduledAt.
metadata is free-form - pass any CRM fields you need back on webhooks / contact records (city, product, owner, tags, etc.).
Your own lead id (leadId)
Send your CRM’s id with every lead as leadId (a string up to 200 characters, or a number). Ondial returns it unchanged in the response, in error responses and in call webhooks, so you can match every reply to the right lead in your CRM without storing contactId.
leadId is returned next to contactId:
leadId is returned in the error too, so a failed lead is easy to find:
- Works on
POST /api/v1/leads,POST /api/v1/leads/validate,POST /api/v1/eventsand each lead of bulk (asresults[].leadId). metadata.leadIdstill works; the top-levelleadIdwins when both are sent.- If you don’t send one,
leadIdis simply left out. AleadIdthat is not a string or number is rejected with422 invalid_lead_id. leadIddoes not affect duplicate detection: that still uses the phone number or email.- Webhooks that carry it:
outbound.lead.created,outbound.lead.updated,call.outbound.status,call.outbound.billedandcall.outbound.analysis. See Webhook events.
Many leads at once
Have a list? UsePOST /api/v1/leads/bulk: up to 100 leads per request (more on request), one result per lead, dry run and idempotency included.
ERP-style events
- Map
eventType→ campaign via Settings orPOST /api/v1/event-routes POST /api/v1/eventswitheventType+phone(+ consent)
Direct WhatsApp or email (no dial)
Templates are resolved from the ids you pass (required). Copy them from Lead setup / Omni templates - wrong ids return422.
Send one channel per request.
Email:
templateVariables keys come from your template’s {{placeholders}} (Lead setup). Example keys above are only if that template uses them - otherwise send {} or only the keys you need.
WhatsApp:
whatsappParams[0] → {{1}}, [1] → {{2}}, … (same order as Lead setup paramLabels).
Non-API campaigns, draft/testing, or closed campaigns return
422 at lead add (not_api_campaign / campaign_not_accepting / campaign_closed).
Omit the clocks to send as soon as Calling_system1 picks up the queue. Poll GET /api/v1/contacts/{id} for whatsappQueueStatus / emailStatus.
Requeue a finished contact
If the contact already completed (or otherwise finished), pass"requeue": true on POST /leads / /events to arm another dial.
requeue: true you get 422 / requeue_required. On success Ondial emits outbound.lead.updated with action: "requeued", then a new dial with a new callId and a fresh call webhook set. Details: CRM & webhooks.
Status + conversation back to CRM
- Save
contactIdfromPOST /leads(and listen foroutbound.lead.created/outbound.lead.updated) - Poll
GET /api/v1/contacts/{id}(seelastCall) or listen for call webhooks:call.outbound.status,call.outbound.billed,credits.usage,call.outbound.analysis - Optionally also poll
GET /api/v1/callsfor a unified inbound+outbound feed GET /api/v1/contacts/{id}/calls- dial list (hasAnalysis, optionalsummary)GET /api/v1/contacts/{id}/calls/{callId}- transcript/turns + normalized analysis (no internal blobs)
hasAnalysis: true, or wait for call.outbound.analysis.
Optional: register HTTPS webhooks in API Access → Notifications (X-Ondial-Signature). See CRM & webhooks.
