Skip to main content
Before you POST: Lead setup with your campaignId - copy call.lead / email.lead / whatsapp.lead. Optional Validate lead (nothing is created).

Direct lead push

Omit 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.
Accepted - leadId is returned next to contactId:
Rejected - 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/events and each lead of bulk (as results[].leadId).
  • metadata.leadId still works; the top-level leadId wins when both are sent.
  • If you don’t send one, leadId is simply left out. A leadId that is not a string or number is rejected with 422 invalid_lead_id.
  • leadId does 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.billed and call.outbound.analysis. See Webhook events.

Many leads at once

Have a list? Use POST /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

  1. Map eventType → campaign via Settings or POST /api/v1/event-routes
  2. POST /api/v1/events with eventType + phone (+ consent)
Full walkthrough (list templates → fill params → send): Send WhatsApp and email.

Direct WhatsApp or email (no dial)

Templates are resolved from the ids you pass (required). Copy them from Lead setup / Omni templates - wrong ids return 422. 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.
Without 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

  1. Save contactId from POST /leads (and listen for outbound.lead.created / outbound.lead.updated)
  2. Poll GET /api/v1/contacts/{id} (see lastCall) or listen for call webhooks: call.outbound.status, call.outbound.billed, credits.usage, call.outbound.analysis
  3. Optionally also poll GET /api/v1/calls for a unified inbound+outbound feed
  4. GET /api/v1/contacts/{id}/calls - dial list (hasAnalysis, optional summary)
  5. GET /api/v1/contacts/{id}/calls/{callId} - transcript/turns + normalized analysis (no internal blobs)
Analysis can lag call completion - poll until hasAnalysis: true, or wait for call.outbound.analysis. Optional: register HTTPS webhooks in API Access → Notifications (X-Ondial-Signature). See CRM & webhooks.