API Reference
Update Webhook
PATCH /webhooks/:id — update a webhook’s endpoint, events, or status.
PATCH
/webhooks/:idUpdates an existing webhook. Send any of endpoint, events, or status; omitted fields are left unchanged. Use status to pause delivery without deleting the webhook.
Path parameters
idstringrequiredThe webhook id as returned by Create Webhook or List Webhooks — a numeric string (e.g. 17), not a UUID. A non-numeric id returns not_found (404).
Body parameters
endpointstringoptionalThe HTTPS URL where webhook events will be sent.
eventsstring[]optionalArray of event types to subscribe to. Replaces the existing set. See Create Webhook for the available values.
statusstringoptionalThe webhook status. Either enabled or disabled.
import { Mailblastr } from 'mailblastr';
const mb = new Mailblastr('mb_xxxxxxxxx');
const { data, error } = await mb.webhooks.update('17', {
"endpoint": "https://new-webhook.example.com/handler",
"events": ["email.sent", "email.delivered"],
"status": "enabled"
});
console.log({ data, error });Response
{
"object": "webhook",
"id": "17"
}Errors: not_found if the webhook does not exist or is not yours. See Errors.