cURL
curl -sS -X POST "https://dashboard.ondial.ai/api/v1/leads" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: crm-12345" \
-d '{
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}'const res = await fetch("https://dashboard.ondial.ai/api/v1/leads", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "crm-12345",
},
body: JSON.stringify({
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.request(
"POST",
"https://dashboard.ondial.ai/api/v1/leads",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
"Idempotency-Key": "crm-12345",
},
json={
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": True,
"source": "crm",
},
"metadata": {
"leadId": "CRM-99",
},
},
timeout=30,
)
print(res.status_code, res.json())<?php
$ch = curl_init("https://dashboard.ondial.ai/api/v1/leads");
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([
'campaignId' => '6a7afae1e1cf2999568febc4',
'channel' => 'call',
'phone' => '+919876543210',
'name' => 'Asha',
'consent' => [
'outboundCall' => true,
'source' => 'crm',
],
'metadata' => [
'leadId' => 'CRM-99',
],
]),
]);
$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/leads"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "crm-12345")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}
"""))
.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/leads");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
request.Headers.Add("Idempotency-Key", "crm-12345");
request.Content = new StringContent("""
{
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}
""", 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(`{
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}`)
req, _ := http.NewRequest("POST", "https://dashboard.ondial.ai/api/v1/leads", 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))
}{
"contactId": "6a7acd39a82e957a556ff6b3",
"campaignId": "6a7acc769198505873b9c0b0",
"channels": [
"call"
],
"status": "sandbox_accepted",
"mode": "sandbox"
}Create lead
Pick a channel tab in Try it - only that channel’s fields appear.
POST
https://dashboard.ondial.ai
/
api
/
v1
/
leads
cURL
curl -sS -X POST "https://dashboard.ondial.ai/api/v1/leads" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: crm-12345" \
-d '{
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}'const res = await fetch("https://dashboard.ondial.ai/api/v1/leads", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "crm-12345",
},
body: JSON.stringify({
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.request(
"POST",
"https://dashboard.ondial.ai/api/v1/leads",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
"Idempotency-Key": "crm-12345",
},
json={
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": True,
"source": "crm",
},
"metadata": {
"leadId": "CRM-99",
},
},
timeout=30,
)
print(res.status_code, res.json())<?php
$ch = curl_init("https://dashboard.ondial.ai/api/v1/leads");
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([
'campaignId' => '6a7afae1e1cf2999568febc4',
'channel' => 'call',
'phone' => '+919876543210',
'name' => 'Asha',
'consent' => [
'outboundCall' => true,
'source' => 'crm',
],
'metadata' => [
'leadId' => 'CRM-99',
],
]),
]);
$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/leads"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "crm-12345")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}
"""))
.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/leads");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
request.Headers.Add("Idempotency-Key", "crm-12345");
request.Content = new StringContent("""
{
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}
""", 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(`{
"campaignId": "6a7afae1e1cf2999568febc4",
"channel": "call",
"phone": "+919876543210",
"name": "Asha",
"consent": {
"outboundCall": true,
"source": "crm"
},
"metadata": {
"leadId": "CRM-99"
}
}`)
req, _ := http.NewRequest("POST", "https://dashboard.ondial.ai/api/v1/leads", 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))
}{
"contactId": "6a7acd39a82e957a556ff6b3",
"campaignId": "6a7acc769198505873b9c0b0",
"channels": [
"call"
],
"status": "sandbox_accepted",
"mode": "sandbox"
}Pick the Call / Email / WhatsApp tab in Try it. Extra fields for other channels are hidden.
First: Lead setup with your
campaignId.Authorizations
Paste only your API key (ond_live_… or ond_test_…). Do not type the word Bearer - the playground adds it.
Headers
Optional. Same key + same body returns the same contact; same key + different body → 409.
Body
application/json
- Call
- Email
- WhatsApp
Example:
"6a7afae1e1cf2999568febc4"
Dial only. Email and WhatsApp fields are not used.
Available options:
call Example:
"+919876543210"
Your own lead id from your CRM (string or number). Returned unchanged in the response, in error responses and in call webhooks, so you can map every Ondial reply to your lead. Also accepted as metadata.leadId.
Maximum string length:
200Example:
177
Example:
"Asha"
Available options:
high, normal When to dial. Defaults to now.
Re-arm a finished contact.
Example:
{ "leadId": "CRM-99" }
Response
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 
