Update Webhook
Update a webhook by ID. All body fields are optional; only provided fields will be updated. When updating events, the full list replaces the existing events.
PATCH
/webhooks/{webhook_id}Resend Compatibility: Compatible
Requires a full_access API key.
Path Parameters
webhook_idstringrequiredThe ID of the webhook to update.
Body Parameters
endpointstringNew endpoint URL.
eventsstring[]New list of event types to subscribe to. Replaces all existing events.
statusstringWebhook status: enabled or disabled.
Response Fields
objectstringAlways "webhook".
idstringThe webhook ID.
curl -X PATCH 'https://api.postflare.app/webhooks/wh_a1b2c3d4-e5f6-7890-abcd-ef1234567890' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"events": ["email.sent", "email.delivered"],
"status": "enabled"
}'const response = await fetch(
'https://api.postflare.app/webhooks/wh_a1b2c3d4-e5f6-7890-abcd-ef1234567890',
{
method: 'PATCH',
headers: {
'Authorization': 'Bearer re_xxxxxxxxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({
events: ['email.sent', 'email.delivered'],
status: 'enabled',
}),
}
);
const data = await response.json();Response
{
"object": "webhook",
"id": "wh_a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}