Skip to content
WhatsMarketingDeveloper Hub

Webhooks

Subscribe and unsubscribe webhooks from your system, the way Zapier and Make triggers do. Needs webhooks:write on a key created by an administrator. Each event also needs the permission for the data it carries (for example, contact.created needs contacts:read; message.status, messages:send). A key only sees and unsubscribes the webhooks it created, and they are deleted when the key is revoked. Pausing, viewing deliveries and retrying are done in the panel. See the Webhooks guide.

Available events

GET/webhooks/events

The events a webhook can subscribe to, with their readable name.

Scopes: webhooks:write

curl
curl "https://micuenta.whatsmarketing.es/api/v1/webhooks/events" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
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();
Python
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
<?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);
Response 200
[
  {
    "key": "message.status",
    "label": "Un mensaje enviado por API se entregó, se leyó o falló"
  }
]

List webhooks

GET/webhooks

The webhooks this key subscribed, with the secret masked and the deliveries of the last 7 days.

Scopes: webhooks:write

curl
curl "https://micuenta.whatsmarketing.es/api/v1/webhooks" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/webhooks', {
  headers: {
    Authorization: `Bearer ${process.env.WM_API_KEY}`,
  },
});
const data = await res.json();
Python
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
<?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);
Response 200
[
  {
    "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"
  }
]

Subscribe a webhook

POST/webhooks

A public https URL and the events. Responds with the webhook and its secret (whsec_…), returned only here: keep it to verify the signature. Up to 10 per organization and 10 subscriptions per minute.

Scopes: webhooks:write

Request body CreateWebhook

NameTypeValues
url requiredstring0–500 characters
events requiredstring[]≤ 20

Common errors

  • 400 WEBHOOK_URL_NOT_PUBLIC The URL points to a private or local address.
  • 403 The key lacks webhooks:write or was not created by an administrator.
  • 403 WEBHOOK_EVENT_SCOPE_MISSING The key cannot read the data of one of the events.
  • 409 WEBHOOKS_LIMIT There are already 10 webhooks: unsubscribe one.
curl
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"
  ]
}'
Node.js
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();
Python
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
<?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);
Response 201
{
  "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_…"
}

View a webhook

GET/webhooks/{id}

A webhook with its secret masked. 404 if this key did not subscribe it.

Scopes: webhooks:write

Parameters

NameWhereTypeValues
id requiredpathstring
curl
curl "https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
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();
Python
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
<?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);
Response 200
{
  "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"
}

Unsubscribe a webhook

DELETE/webhooks/{id}

Deletes it along with its delivery history. It is what Zapier or Make call when a trigger is turned off.

Scopes: webhooks:write

Parameters

NameWhereTypeValues
id requiredpathstring
curl
curl -X DELETE "https://micuenta.whatsmarketing.es/api/v1/webhooks/{id}" \
  -H "Authorization: Bearer $WM_API_KEY"
Node.js
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();
Python
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
<?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);
Response 200
{
  "id": "8c7b6a5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
  "deleted": true
}