Criar webhook
Cria um webhook inscrito em UM número de WhatsApp. O número vem do escopo da key (key de número), do cabeçalho x-whatsapp-number-id ou do campo whatsappNumberId no body — se o body contradisser o escopo da key → 400 NUMBER_MISMATCH; sem número resolvível → 400 NUMBER_REQUIRED; número de outro tenant → 404 NUMBER_NOT_FOUND. events escolhe o que será entregue: lista vazia/omitida NÃO dispara nada (não há “assinar tudo” implícito; use ”*” para todos) e eventos que o provedor do número não emite são descartados silenciosamente. O segredo de assinatura NUNCA é retornado.
curl --request POST \
--url https://pilotstatus.com.br/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "https://hooks.acme.com/whatsapp",
"name": "n8n",
"events": [
"message.received",
"message.delivered"
],
"whatsappNumberId": "num_01HZX..."
}
'import requests
url = "https://pilotstatus.com.br/v1/webhooks"
payload = {
"url": "https://hooks.acme.com/whatsapp",
"name": "n8n",
"events": ["message.received", "message.delivered"],
"whatsappNumberId": "num_01HZX..."
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://hooks.acme.com/whatsapp',
name: 'n8n',
events: ['message.received', 'message.delivered'],
whatsappNumberId: 'num_01HZX...'
})
};
fetch('https://pilotstatus.com.br/v1/webhooks', 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://pilotstatus.com.br/v1/webhooks",
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([
'url' => 'https://hooks.acme.com/whatsapp',
'name' => 'n8n',
'events' => [
'message.received',
'message.delivered'
],
'whatsappNumberId' => 'num_01HZX...'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://pilotstatus.com.br/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://hooks.acme.com/whatsapp\",\n \"name\": \"n8n\",\n \"events\": [\n \"message.received\",\n \"message.delivered\"\n ],\n \"whatsappNumberId\": \"num_01HZX...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/webhooks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://hooks.acme.com/whatsapp\",\n \"name\": \"n8n\",\n \"events\": [\n \"message.received\",\n \"message.delivered\"\n ],\n \"whatsappNumberId\": \"num_01HZX...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://hooks.acme.com/whatsapp\",\n \"name\": \"n8n\",\n \"events\": [\n \"message.received\",\n \"message.delivered\"\n ],\n \"whatsappNumberId\": \"num_01HZX...\"\n}"
response = http.request(request)
puts response.read_body{
"id": "wh_01HZX...",
"tenantId": "tenant_01HZX...",
"name": "n8n",
"url": "https://hooks.acme.com/whatsapp",
"environment": "LIVE",
"active": true,
"events": [
"message.received"
],
"createdAt": "2026-07-03T12:00:00.000Z",
"updatedAt": "2026-07-03T12:00:00.000Z"
}{
"error": "Validation error"
}{
"error": "Unauthorized"
}{
"error": "Too many requests"
}Autorizações
Sua chave de API ps_
Cabeçalhos
Restringe ao contexto de um número (obrigatório em concessões OAuth por número).
Corpo
Endpoint HTTPS que receberá os eventos.
"https://hooks.acme.com/whatsapp"
Nome de exibição (padrão: hostname da URL).
"n8n"
Eventos a assinar (ex.: ["message.received"]); "*" = todos. Vazio/omitido = não dispara nada.
["message.received", "message.delivered"]
Número alvo — necessário só com key de tenant sem cabeçalho de número; com key de número deve coincidir com o escopo (400 NUMBER_MISMATCH).
"num_01HZX..."
Resposta
Criar webhook
Esta página foi útil?
curl --request POST \
--url https://pilotstatus.com.br/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "https://hooks.acme.com/whatsapp",
"name": "n8n",
"events": [
"message.received",
"message.delivered"
],
"whatsappNumberId": "num_01HZX..."
}
'import requests
url = "https://pilotstatus.com.br/v1/webhooks"
payload = {
"url": "https://hooks.acme.com/whatsapp",
"name": "n8n",
"events": ["message.received", "message.delivered"],
"whatsappNumberId": "num_01HZX..."
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://hooks.acme.com/whatsapp',
name: 'n8n',
events: ['message.received', 'message.delivered'],
whatsappNumberId: 'num_01HZX...'
})
};
fetch('https://pilotstatus.com.br/v1/webhooks', 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://pilotstatus.com.br/v1/webhooks",
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([
'url' => 'https://hooks.acme.com/whatsapp',
'name' => 'n8n',
'events' => [
'message.received',
'message.delivered'
],
'whatsappNumberId' => 'num_01HZX...'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://pilotstatus.com.br/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://hooks.acme.com/whatsapp\",\n \"name\": \"n8n\",\n \"events\": [\n \"message.received\",\n \"message.delivered\"\n ],\n \"whatsappNumberId\": \"num_01HZX...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/webhooks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://hooks.acme.com/whatsapp\",\n \"name\": \"n8n\",\n \"events\": [\n \"message.received\",\n \"message.delivered\"\n ],\n \"whatsappNumberId\": \"num_01HZX...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://hooks.acme.com/whatsapp\",\n \"name\": \"n8n\",\n \"events\": [\n \"message.received\",\n \"message.delivered\"\n ],\n \"whatsappNumberId\": \"num_01HZX...\"\n}"
response = http.request(request)
puts response.read_body{
"id": "wh_01HZX...",
"tenantId": "tenant_01HZX...",
"name": "n8n",
"url": "https://hooks.acme.com/whatsapp",
"environment": "LIVE",
"active": true,
"events": [
"message.received"
],
"createdAt": "2026-07-03T12:00:00.000Z",
"updatedAt": "2026-07-03T12:00:00.000Z"
}{
"error": "Validation error"
}{
"error": "Unauthorized"
}{
"error": "Too many requests"
}