cURL
curl -sS -X POST "https://dashboard.ondial.ai/api/v1/leads/validate" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-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/validate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
},
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/validate",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
},
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/validate");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ONDIAL_API_KEY"),
"Content-Type: application/json",
],
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/validate"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.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/validate");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
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/validate", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ONDIAL_API_KEY"))
req.Header.Set("Content-Type", "application/json")
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))
}{
"ok": true,
"campaignId": "6a7afae1e1cf2999568febc4",
"channels": [
"email"
]
}{
"leadId": 177,
"error": "<string>",
"reasonCode": "<string>",
"missing": [
"<string>"
]
}{
"error": "Invalid or inactive API key",
"reasonCode": "unauthorized"
}{
"error": "Not found",
"reasonCode": "not_found"
}{
"ok": false,
"campaignId": "6a7afae1e1cf2999568febc4",
"channels": [
"email"
],
"missing": [
"email"
],
"issues": [
{
"field": "email",
"error": "Valid email is required for email channel"
}
]
}Validate lead (dry run)
Dry-run POST /leads - campaign profile/template exist? required fields filled? Nothing is created.
POST
https://dashboard.ondial.ai
/
api
/
v1
/
leads
/
validate
cURL
curl -sS -X POST "https://dashboard.ondial.ai/api/v1/leads/validate" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-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/validate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
},
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/validate",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
},
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/validate");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ONDIAL_API_KEY"),
"Content-Type: application/json",
],
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/validate"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.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/validate");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
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/validate", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ONDIAL_API_KEY"))
req.Header.Set("Content-Type", "application/json")
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))
}{
"ok": true,
"campaignId": "6a7afae1e1cf2999568febc4",
"channels": [
"email"
]
}{
"leadId": 177,
"error": "<string>",
"reasonCode": "<string>",
"missing": [
"<string>"
]
}{
"error": "Invalid or inactive API key",
"reasonCode": "unauthorized"
}{
"error": "Not found",
"reasonCode": "not_found"
}{
"ok": false,
"campaignId": "6a7afae1e1cf2999568febc4",
"channels": [
"email"
],
"missing": [
"email"
],
"issues": [
{
"field": "email",
"error": "Valid email is required for email channel"
}
]
}Use Lead setup first to copy a body, fill it, then Try it here.
ok: true→ safe toPOST /api/v1/leadsok: false→ readchecks(severity: errorblocks create)- Email needs
emailProfileId,emailTemplateId, andtemplateVariables(object). WhatsApp needswhatsappProfileId,whatsappTemplateId, andwhatsappParams(array).
Authorizations
Paste only your API key (ond_live_… or ond_test_…). Do not type the word Bearer - the playground adds it.
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" }

