Webhooks
Suscribir y dar de baja webhooks desde tu sistema, como hacen los disparadores de Zapier y Make. Necesita webhooks:write en una clave creada por un administrador. Cada evento pide además el permiso de lo que entrega (por ejemplo, contact.created pide contacts:read; message.status, messages:send). Una clave solo ve y da de baja los webhooks que dio de alta ella, y al anularla se borran. Pausar, ver entregas y reintentar se hace en el panel. Ver la guía Webhooks.
Eventos disponibles
GET/webhooks/events
La lista de eventos a los que se puede suscribir un webhook, con su nombre legible.
Permisos: webhooks:write
curl "https://micuenta.whatsmarketing.es/api/v1/webhooks/events" \
-H "Authorization: Bearer $WM_API_KEY"const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/webhooks/events', {
headers: {
Authorization: `Bearer ${process.env.WM_API_KEY}`,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://micuenta.whatsmarketing.es/api/v1/webhooks/events",
headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
timeout=30,
)
r.raise_for_status()
data = r.json()<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/webhooks/events');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('WM_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);[
{
"key": "message.status",
"label": "Un mensaje enviado por API se entregó, se leyó o falló"
}
]Listar webhooks
GET/webhooks
Los webhooks que dio de alta esta clave, con el secreto enmascarado y las entregas de los últimos 7 días.
Permisos: webhooks:write
curl "https://micuenta.whatsmarketing.es/api/v1/webhooks" \
-H "Authorization: Bearer $WM_API_KEY"const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/webhooks', {
headers: {
Authorization: `Bearer ${process.env.WM_API_KEY}`,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://micuenta.whatsmarketing.es/api/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
timeout=30,
)
r.raise_for_status()
data = r.json()<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/webhooks');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('WM_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);[
{
"sent7d": 42,
"failed7d": 0,
"id": "8c7b6a5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
"url": "https://hooks.zapier.com/hooks/catch/123/abc/",
"maskedSecret": "whsec_1a2b…",
"events": [
"message.status"
],
"eventLabels": [
"Un mensaje enviado por API se entregó, se leyó o falló"
],
"status": "ACTIVE",
"failureStreak": 0,
"lastDeliveryAt": "2026-11-11T10:05:00.000Z",
"lastSuccessAt": "2026-11-11T10:05:00.000Z",
"createdAt": "2026-11-11T10:00:00.000Z"
}
]Suscribir un webhook
POST/webhooks
Una URL https pública y los eventos. Responde con el webhook y su secret (whsec_…), que solo se devuelve aquí: guárdalo para verificar la firma. Hasta 10 por organización y 10 altas por minuto.
Permisos: webhooks:write
Cuerpo de la petición CreateWebhook
| Nombre | Tipo | Valores |
|---|---|---|
url obligatorio | string | 0–500 caracteres |
events obligatorio | string[] | ≤ 20 |
Errores frecuentes
- 400
WEBHOOK_URL_NOT_PUBLICLa URL apunta a una dirección privada o local. - 403 La clave no tiene
webhooks:writeo no la creó un administrador. - 403
WEBHOOK_EVENT_SCOPE_MISSINGLa clave no puede leer los datos de alguno de los eventos. - 409
WEBHOOKS_LIMITYa hay 10 webhooks: da de baja alguno.
curl -X POST "https://micuenta.whatsmarketing.es/api/v1/webhooks" \
-H "Authorization: Bearer $WM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://hooks.zapier.com/hooks/catch/123/abc/",
"events": [
"message.status"
]
}'const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/webhooks', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WM_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"url": "https://hooks.zapier.com/hooks/catch/123/abc/",
"events": [
"message.status"
]
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://micuenta.whatsmarketing.es/api/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
json={
"url": "https://hooks.zapier.com/hooks/catch/123/abc/",
"events": [
"message.status"
]
},
timeout=30,
)
r.raise_for_status()
data = r.json()<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/webhooks');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('WM_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://hooks.zapier.com/hooks/catch/123/abc/',
'events' => [
'message.status'
]
]),
]);
$data = json_decode(curl_exec($ch), true);{
"sent7d": 42,
"failed7d": 0,
"id": "8c7b6a5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
"url": "https://hooks.zapier.com/hooks/catch/123/abc/",
"maskedSecret": "whsec_1a2b…",
"events": [
"message.status"
],
"eventLabels": [
"Un mensaje enviado por API se entregó, se leyó o falló"
],
"status": "ACTIVE",
"failureStreak": 0,
"lastDeliveryAt": "2026-11-11T10:05:00.000Z",
"lastSuccessAt": "2026-11-11T10:05:00.000Z",
"createdAt": "2026-11-11T10:00:00.000Z",
"secret": "whsec_…"
}Ver un webhook
GET/webhooks/{id}
Un webhook con su secreto enmascarado. 404 si no lo dio de alta esta clave.
Permisos: webhooks:write
Parámetros
| Nombre | Dónde | Tipo | Valores |
|---|---|---|---|
id obligatorio | ruta | string |
curl "https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}" \
-H "Authorization: Bearer $WM_API_KEY"const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}', {
headers: {
Authorization: `Bearer ${process.env.WM_API_KEY}`,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}",
headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
timeout=30,
)
r.raise_for_status()
data = r.json()<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('WM_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);{
"sent7d": 42,
"failed7d": 0,
"id": "8c7b6a5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
"url": "https://hooks.zapier.com/hooks/catch/123/abc/",
"maskedSecret": "whsec_1a2b…",
"events": [
"message.status"
],
"eventLabels": [
"Un mensaje enviado por API se entregó, se leyó o falló"
],
"status": "ACTIVE",
"failureStreak": 0,
"lastDeliveryAt": "2026-11-11T10:05:00.000Z",
"lastSuccessAt": "2026-11-11T10:05:00.000Z",
"createdAt": "2026-11-11T10:00:00.000Z"
}Dar de baja un webhook
DELETE/webhooks/{id}
Lo elimina con su historial de entregas. Es lo que llama Zapier o Make al apagar un disparador.
Permisos: webhooks:write
Parámetros
| Nombre | Dónde | Tipo | Valores |
|---|---|---|---|
id obligatorio | ruta | string |
curl -X DELETE "https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}" \
-H "Authorization: Bearer $WM_API_KEY"const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.WM_API_KEY}`,
},
});
const data = await res.json();import os, requests
r = requests.delete(
"https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}",
headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
timeout=30,
)
r.raise_for_status()
data = r.json()<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('WM_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);{
"id": "8c7b6a5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
"deleted": true
}