cURL
curl -sS -X POST "https://dashboard.ondial.ai/api/v1/events" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: crm-12345" \
-d '{
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}'const res = await fetch("https://dashboard.ondial.ai/api/v1/events", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "crm-12345",
},
body: JSON.stringify({
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.request(
"POST",
"https://dashboard.ondial.ai/api/v1/events",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
"Idempotency-Key": "crm-12345",
},
json={
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": True,
"source": "erp",
},
"metadata": {
"invoiceId": "INV-1",
},
},
timeout=30,
)
print(res.status_code, res.json())<?php
$ch = curl_init("https://dashboard.ondial.ai/api/v1/events");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ONDIAL_API_KEY"),
"Content-Type: application/json",
"Idempotency-Key: crm-12345",
],
CURLOPT_POSTFIELDS => json_encode([
'eventType' => 'lead.created',
'phone' => '+919876543210',
'name' => 'Asha',
'consent' => [
'outboundCall' => true,
'source' => 'erp',
],
'metadata' => [
'invoiceId' => 'INV-1',
],
]),
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . " " . $response;import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://dashboard.ondial.ai/api/v1/events"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "crm-12345")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}
"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://dashboard.ondial.ai/api/v1/events");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
request.Headers.Add("Idempotency-Key", "crm-12345");
request.Content = new StringContent("""
{
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}`)
req, _ := http.NewRequest("POST", "https://dashboard.ondial.ai/api/v1/events", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ONDIAL_API_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "crm-12345")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}{
"leadId": 177,
"contactId": "<string>",
"campaignId": "<string>",
"channels": [
"<string>"
],
"status": "<string>",
"mode": "live",
"reasonCode": "<string>",
"scheduledAt": "2023-11-07T05:31:56Z",
"emailScheduledAt": "2023-11-07T05:31:56Z",
"whatsappScheduledAt": "2023-11-07T05:31:56Z",
"emailTemplateId": "<string>",
"emailProfileId": "<string>",
"whatsappTemplateId": "<string>",
"whatsappProfileId": "<string>",
"templateVariables": {},
"whatsappParams": [
"<string>"
]
}{
"error": "Invalid or inactive API key",
"reasonCode": "unauthorized"
}{
"error": "No route for eventType",
"reasonCode": "event_unmapped"
}Post event
ERP-style eventType → mapped campaign lead ingest.
POST
https://dashboard.ondial.ai
/
api
/
v1
/
events
cURL
curl -sS -X POST "https://dashboard.ondial.ai/api/v1/events" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: crm-12345" \
-d '{
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}'const res = await fetch("https://dashboard.ondial.ai/api/v1/events", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "crm-12345",
},
body: JSON.stringify({
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.request(
"POST",
"https://dashboard.ondial.ai/api/v1/events",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
"Idempotency-Key": "crm-12345",
},
json={
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": True,
"source": "erp",
},
"metadata": {
"invoiceId": "INV-1",
},
},
timeout=30,
)
print(res.status_code, res.json())<?php
$ch = curl_init("https://dashboard.ondial.ai/api/v1/events");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ONDIAL_API_KEY"),
"Content-Type: application/json",
"Idempotency-Key: crm-12345",
],
CURLOPT_POSTFIELDS => json_encode([
'eventType' => 'lead.created',
'phone' => '+919876543210',
'name' => 'Asha',
'consent' => [
'outboundCall' => true,
'source' => 'erp',
],
'metadata' => [
'invoiceId' => 'INV-1',
],
]),
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . " " . $response;import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://dashboard.ondial.ai/api/v1/events"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "crm-12345")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}
"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://dashboard.ondial.ai/api/v1/events");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
request.Headers.Add("Idempotency-Key", "crm-12345");
request.Content = new StringContent("""
{
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"eventType": "lead.created",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "erp"
},
"metadata": {
"invoiceId": "INV-1"
}
}`)
req, _ := http.NewRequest("POST", "https://dashboard.ondial.ai/api/v1/events", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ONDIAL_API_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "crm-12345")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}{
"leadId": 177,
"contactId": "<string>",
"campaignId": "<string>",
"channels": [
"<string>"
],
"status": "<string>",
"mode": "live",
"reasonCode": "<string>",
"scheduledAt": "2023-11-07T05:31:56Z",
"emailScheduledAt": "2023-11-07T05:31:56Z",
"whatsappScheduledAt": "2023-11-07T05:31:56Z",
"emailTemplateId": "<string>",
"emailProfileId": "<string>",
"whatsappTemplateId": "<string>",
"whatsappProfileId": "<string>",
"templateVariables": {},
"whatsappParams": [
"<string>"
]
}{
"error": "Invalid or inactive API key",
"reasonCode": "unauthorized"
}{
"error": "No route for eventType",
"reasonCode": "event_unmapped"
}Requires a prior event route (
POST /api/v1/event-routes or API Access → Event routes).
Unknown eventType → 422 event_unmapped.
Same optional template fields as create-lead: emailTemplateId, whatsappTemplateId, templateVariables, whatsappParams, per-channel clocks. List ids via List Omni templates.Authorizations
Paste only your API key (ond_live_… or ond_test_…). Do not type the word Bearer - the playground adds it.
Headers
Body
application/json
Example:
"lead.created"
Response
Routed and accepted
Your own lead id, exactly as you sent it. Omitted when you did not send one.
Maximum string length:
200Example:
177
Available options:
live, sandbox 
