Crear webhook
Crea un webhook suscrito a UN número de WhatsApp. El número viene del alcance de la clave (clave de número), del header x-whatsapp-number-id o del campo whatsappNumberId del cuerpo; si el cuerpo contradice el alcance de la clave → 400 NUMBER_MISMATCH; sin número resoluble → 400 NUMBER_REQUIRED; número de otro workspace → 404 NUMBER_NOT_FOUND. events elige qué se entrega: una lista vacía/omitida NO despacha NADA (no hay un “suscribirse a todo” implícito; usa "*" para todo, es decir, todos los eventos excepto el opcional lead.received, que debe listarse por nombre) y los eventos que el proveedor del número no puede emitir se descartan en silencio. Los campos desconocidos del cuerpo se ignoran.
El 201 trae el secret de firma en claro, junto con hasSecret: true: la única respuesta que lo hace, aparte de rotate-secret. Guárdalo de inmediato (la respuesta se envía con Cache-Control: no-store). Por OAuth/MCP la creación se registra primero en la registro de auditoría; si ese registro no se puede escribir, el webhook se crea igual, pero secret vuelve null con secretWithheld: true, secretWithheldReason y secretWithheldCode: "OAUTH_SECRET_AUDIT_UNAVAILABLE"; rótalo para obtener uno.
Límites: la misma url dos veces en el mismo número → 409 WEBHOOK_DUPLICATE; como máximo 50 webhooks por workspace → 409 WEBHOOK_LIMIT_REACHED.
Permisos: webhooks:manage (Owner o Admin con una clave de cuenta o token OAuth/MCP).
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...",
"deliveryTimeoutMs": 8000
}
'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...",
"deliveryTimeoutMs": 8000
}
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...',
deliveryTimeoutMs: 8000
})
};
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...',
'deliveryTimeoutMs' => 8000
]),
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 \"deliveryTimeoutMs\": 8000\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 \"deliveryTimeoutMs\": 8000\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 \"deliveryTimeoutMs\": 8000\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",
"deliveryTimeoutMs": null,
"active": true,
"events": [
"message.received"
],
"createdAt": "2026-07-03T12:00:00.000Z",
"updatedAt": "2026-07-03T12:00:00.000Z",
"hasSecret": true,
"secret": "9f2c4e6a8b0d1f3a5c7e9b1d3f5a7c9e2b4d6f8a0c1e3b5d7f9a1c3e5b7d9f1a"
}Encabezados
Cuerpo
URL de destino, http o https. Algo que no es una URL → 400 Validation error; otro esquema, localhost, una IP de loopback o privada, o un host sin punto → 400 INVALID_WEBHOOK_URL. La misma URL dos veces en el mismo número → 409 WEBHOOK_DUPLICATE.
"https://hooks.acme.com/whatsapp"
Solo para el equipo de Pilot Status. Plazo de entrega por webhook en ms, entero 1000–15000; null lo borra (vuelve al predeterminado de 10 s). Enviar la clave en absoluto (null incluido) con cualquier otra credencial → 403 DELIVERY_TIMEOUT_STAFF_ONLY. Las claves ps_ clásicas nunca son del equipo.
1000 <= x <= 15000Respuesta
Crear webhook
¿Esta página le ayudó?
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...",
"deliveryTimeoutMs": 8000
}
'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...",
"deliveryTimeoutMs": 8000
}
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...',
deliveryTimeoutMs: 8000
})
};
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...',
'deliveryTimeoutMs' => 8000
]),
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 \"deliveryTimeoutMs\": 8000\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 \"deliveryTimeoutMs\": 8000\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 \"deliveryTimeoutMs\": 8000\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",
"deliveryTimeoutMs": null,
"active": true,
"events": [
"message.received"
],
"createdAt": "2026-07-03T12:00:00.000Z",
"updatedAt": "2026-07-03T12:00:00.000Z",
"hasSecret": true,
"secret": "9f2c4e6a8b0d1f3a5c7e9b1d3f5a7c9e2b4d6f8a0c1e3b5d7f9a1c3e5b7d9f1a"
}