curl --request POST \
--url https://{instancia}/api/webhooks/receive/{token} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Maria Silva",
"email": "maria@empresa.com.br",
"phone": "11987654321"
}
'import requests
url = "https://{instancia}/api/webhooks/receive/{token}"
payload = {
"name": "Maria Silva",
"email": "maria@empresa.com.br",
"phone": "11987654321"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Maria Silva', email: 'maria@empresa.com.br', phone: '11987654321'})
};
fetch('https://{instancia}/api/webhooks/receive/{token}', 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://{instancia}/api/webhooks/receive/{token}",
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([
'name' => 'Maria Silva',
'email' => 'maria@empresa.com.br',
'phone' => '11987654321'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{instancia}/api/webhooks/receive/{token}"
payload := strings.NewReader("{\n \"name\": \"Maria Silva\",\n \"email\": \"maria@empresa.com.br\",\n \"phone\": \"11987654321\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{instancia}/api/webhooks/receive/{token}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Maria Silva\",\n \"email\": \"maria@empresa.com.br\",\n \"phone\": \"11987654321\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instancia}/api/webhooks/receive/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Maria Silva\",\n \"email\": \"maria@empresa.com.br\",\n \"phone\": \"11987654321\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"leadId": "clx8k2p9a0001qw3r5t7y9u1i",
"message": "Lead created successfully"
}{
"error": "Valid email is required"
}{
"error": "Valid email is required"
}{
"error": "Valid email is required"
}{
"error": "Valid email is required"
}Criar contato
Cria um contato no funil. O token no caminho autoriza criar contato e nada além disso: não lê, não lista e não altera o que já existe.
O corpo pode ser JSON, formulário codificado ou multipart, o que permite apontar um formulário HTML direto para esta URL sem código no meio. Os nomes de campo são aceitos em português e em inglês.
A entrada não é idempotente: duas requisições iguais criam dois contatos.
curl --request POST \
--url https://{instancia}/api/webhooks/receive/{token} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Maria Silva",
"email": "maria@empresa.com.br",
"phone": "11987654321"
}
'import requests
url = "https://{instancia}/api/webhooks/receive/{token}"
payload = {
"name": "Maria Silva",
"email": "maria@empresa.com.br",
"phone": "11987654321"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Maria Silva', email: 'maria@empresa.com.br', phone: '11987654321'})
};
fetch('https://{instancia}/api/webhooks/receive/{token}', 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://{instancia}/api/webhooks/receive/{token}",
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([
'name' => 'Maria Silva',
'email' => 'maria@empresa.com.br',
'phone' => '11987654321'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{instancia}/api/webhooks/receive/{token}"
payload := strings.NewReader("{\n \"name\": \"Maria Silva\",\n \"email\": \"maria@empresa.com.br\",\n \"phone\": \"11987654321\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{instancia}/api/webhooks/receive/{token}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Maria Silva\",\n \"email\": \"maria@empresa.com.br\",\n \"phone\": \"11987654321\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instancia}/api/webhooks/receive/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Maria Silva\",\n \"email\": \"maria@empresa.com.br\",\n \"phone\": \"11987654321\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"leadId": "clx8k2p9a0001qw3r5t7y9u1i",
"message": "Lead created successfully"
}{
"error": "Valid email is required"
}{
"error": "Valid email is required"
}{
"error": "Valid email is required"
}{
"error": "Valid email is required"
}Obrigatório
email. O resto entra quando vier, e cada campo aceita variações de nome em
português e em inglês.{
"email": "maria@empresa.com.br"
}
{
"name": "Maria Silva",
"email": "maria@empresa.com.br",
"phone": "11987654321",
"company": "Empresa Ltda",
"value": 15000,
"observation": "Pediu proposta para 20 licenças",
"source": "Landing de agosto"
}
{
"name": "Maria Silva",
"email": "maria@empresa.com.br",
"campaignId": "23851234567890",
"campaignName": "Prospecção agosto",
"adsetId": "23851234567891",
"adsetName": "Lookalike 1%",
"adId": "23851234567892",
"adName": "Criativo vídeo 30s",
"formId": "1234567890123456"
}
<form action="https://crm.suaempresa.com/api/webhooks/receive/SEU_TOKEN" method="POST">
<input name="name" />
<input name="email" type="email" required />
<button>Enviar</button>
</form>
leadId da primeira resposta bem-sucedida
e não repita.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Token do webhook, 48 caracteres hexadecimais.
"SEU_TOKEN"
Body
Só o email é obrigatório. Cada campo aceita variações de nome, em português e em inglês, porque o sistema do outro lado raramente deixa escolher.
Também aceito como e_mail ou emailAddress.
"maria@empresa.com.br"
Também aceito como nome, full_name ou fullName.
"Maria Silva"
Também aceito como telefone, celular, whatsapp ou phoneNumber.
"11987654321"
Também aceito como empresa ou organization.
Valor do negócio. Também aceito como valor ou amount.
Também aceito como observacao, message, mensagem ou notes.
Origem do contato. Também aceito como origem ou platform. O webhook pode ter origem padrão, definida no app, que vence este campo.