Criar lead
curl --request POST \
--url https://api.example.com/user/lead \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "<string>",
"campaign_id": 123,
"variables": {
"customer_name": "<string>",
"email": "<string>"
},
"allow_dupplicate": true,
"secondary_contacts": [
{
"phone_number": "<string>",
"variables": {
"customer_name": "<string>",
"email": "<string>"
}
}
]
}
'import requests
url = "https://api.example.com/user/lead"
payload = {
"phone_number": "<string>",
"campaign_id": 123,
"variables": {
"customer_name": "<string>",
"email": "<string>"
},
"allow_dupplicate": True,
"secondary_contacts": [
{
"phone_number": "<string>",
"variables": {
"customer_name": "<string>",
"email": "<string>"
}
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
campaign_id: 123,
variables: {customer_name: '<string>', email: '<string>'},
allow_dupplicate: true,
secondary_contacts: [
{
phone_number: '<string>',
variables: {customer_name: '<string>', email: '<string>'}
}
]
})
};
fetch('https://api.example.com/user/lead', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/user/lead",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phone_number' => '<string>',
'campaign_id' => 123,
'variables' => [
'customer_name' => '<string>',
'email' => '<string>'
],
'allow_dupplicate' => true,
'secondary_contacts' => [
[
'phone_number' => '<string>',
'variables' => [
'customer_name' => '<string>',
'email' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/user/lead"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"campaign_id\": 123,\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"allow_dupplicate\": true,\n \"secondary_contacts\": [\n {\n \"phone_number\": \"<string>\",\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/user/lead")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"campaign_id\": 123,\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"allow_dupplicate\": true,\n \"secondary_contacts\": [\n {\n \"phone_number\": \"<string>\",\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/user/lead")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"campaign_id\": 123,\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"allow_dupplicate\": true,\n \"secondary_contacts\": [\n {\n \"phone_number\": \"<string>\",\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Lead created successfully",
"data": {
"id": 1,
"campaign_id": 1,
"phone_number": "+1234567890",
"variables": {
"customer_name": "John Doe",
"email": "john.doe@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20",
"campaign": {
"id": 1,
"name": "Minha nova campanha"
},
"secondary_contacts": [
{
"id": 2,
"phone_number": "+1234567891",
"variables": {
"customer_name": "Jane Doe Secondary",
"email": "jane.doe.secondary@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20"
},
{
"id": 3,
"phone_number": "+1234567892",
"variables": {
"customer_name": "Bob Doe Office",
"email": "bob.doe.office@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20"
}
]
}
}
Leads
Criar lead
Cria um novo lead no sistema OmniTech para uso em campanhas outbound, com dados de contato e variáveis personalizadas que alimentam o prompt.
POST
/
user
/
lead
Criar lead
curl --request POST \
--url https://api.example.com/user/lead \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "<string>",
"campaign_id": 123,
"variables": {
"customer_name": "<string>",
"email": "<string>"
},
"allow_dupplicate": true,
"secondary_contacts": [
{
"phone_number": "<string>",
"variables": {
"customer_name": "<string>",
"email": "<string>"
}
}
]
}
'import requests
url = "https://api.example.com/user/lead"
payload = {
"phone_number": "<string>",
"campaign_id": 123,
"variables": {
"customer_name": "<string>",
"email": "<string>"
},
"allow_dupplicate": True,
"secondary_contacts": [
{
"phone_number": "<string>",
"variables": {
"customer_name": "<string>",
"email": "<string>"
}
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '<string>',
campaign_id: 123,
variables: {customer_name: '<string>', email: '<string>'},
allow_dupplicate: true,
secondary_contacts: [
{
phone_number: '<string>',
variables: {customer_name: '<string>', email: '<string>'}
}
]
})
};
fetch('https://api.example.com/user/lead', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/user/lead",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phone_number' => '<string>',
'campaign_id' => 123,
'variables' => [
'customer_name' => '<string>',
'email' => '<string>'
],
'allow_dupplicate' => true,
'secondary_contacts' => [
[
'phone_number' => '<string>',
'variables' => [
'customer_name' => '<string>',
'email' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/user/lead"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"campaign_id\": 123,\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"allow_dupplicate\": true,\n \"secondary_contacts\": [\n {\n \"phone_number\": \"<string>\",\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/user/lead")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"campaign_id\": 123,\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"allow_dupplicate\": true,\n \"secondary_contacts\": [\n {\n \"phone_number\": \"<string>\",\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/user/lead")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"campaign_id\": 123,\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"allow_dupplicate\": true,\n \"secondary_contacts\": [\n {\n \"phone_number\": \"<string>\",\n \"variables\": {\n \"customer_name\": \"<string>\",\n \"email\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Lead created successfully",
"data": {
"id": 1,
"campaign_id": 1,
"phone_number": "+1234567890",
"variables": {
"customer_name": "John Doe",
"email": "john.doe@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20",
"campaign": {
"id": 1,
"name": "Minha nova campanha"
},
"secondary_contacts": [
{
"id": 2,
"phone_number": "+1234567891",
"variables": {
"customer_name": "Jane Doe Secondary",
"email": "jane.doe.secondary@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20"
},
{
"id": 3,
"phone_number": "+1234567892",
"variables": {
"customer_name": "Bob Doe Office",
"email": "bob.doe.office@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20"
}
]
}
}
Este endpoint permite criar um novo lead no sistema OmniTech.
Corpo da Requisição
Número de telefone do lead no formato E.164 (ex.: +1234567890)
ID da campanha para a qual o lead será criado
Define se leads duplicados são permitidos em uma campanha
Array de contatos secundários a serem criados junto com o lead principal
Show propriedades de secondary_contacts
Show propriedades de secondary_contacts
Número de telefone do contato secundário no formato E.164
Resposta
Mensagem da resposta
Objeto de dados do lead
Show propriedades de data
Show propriedades de data
ID único do lead criado
ID da campanha à qual este lead pertence
Número de telefone do lead no formato E.164
Status do lead
Data e hora de criação do lead
Data e hora da última atualização do lead
Array de contatos secundários associados a este lead
Show propriedades de secondary_contacts
Show propriedades de secondary_contacts
ID do contato secundário
Número de telefone do contato secundário no formato E.164
Variáveis associadas ao contato secundário
Status do contato secundário
Data e hora de criação do contato secundário
Data e hora da última atualização do contato secundário
{
"message": "Lead created successfully",
"data": {
"id": 1,
"campaign_id": 1,
"phone_number": "+1234567890",
"variables": {
"customer_name": "John Doe",
"email": "john.doe@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20",
"campaign": {
"id": 1,
"name": "Minha nova campanha"
},
"secondary_contacts": [
{
"id": 2,
"phone_number": "+1234567891",
"variables": {
"customer_name": "Jane Doe Secondary",
"email": "jane.doe.secondary@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20"
},
{
"id": 3,
"phone_number": "+1234567892",
"variables": {
"customer_name": "Bob Doe Office",
"email": "bob.doe.office@example.com"
},
"status": "created",
"created_at": "2025-06-30 11:53:20",
"updated_at": "2025-06-30 11:53:20"
}
]
}
}
⌘I