Skip to main content

Unsubscribe from a webhook

warning

This is a V1 legacy endpoint. It uses a different path /rest/v1 and may return different error codes and response formats compared to V2. While it remains functional, consider handling errors accordingly.

Use this endpoint to stop receiving webhook notifications for a specific event and target URL.

Unsubscribing deletes any events still queued for the subscription. If your target URL has been unavailable or you may have a large queue of pending events, set safe to true. This checks for queued events and keeps the subscription active if any are found.

Woodpecker retries failed webhook deliveries. See webhook error handling for details.

Request​

Endpoint​

POST https://api.woodpecker.co/rest/v1/webhooks/unsubscribe

Headers​

x-api-key: {YOUR_API_KEY}
Content-type: application/json

For details on how to authenticate your requests, please see the authentication guide.

Body​

Specify both target_url and event. The request selects every subscription for that URL that includes the event. Removing a subscription that covers multiple events stops delivery for all of them.

{
"target_url": "https://receiving-url.com/unique_target_url",
"event": "EVENT_NAME",
"safe": true
}

Body schema​

FieldTypeRequiredDescription
target_urlstringYesWebhook URL as registered in the subscription
eventstringYesAvailable event, matched case-insensitively
safebooleanNoWhen true, checks the selected subscriptions for queued events before removing them. Defaults to false

Request samples​

Unsubscribe from a webhook​

These examples check for queued events before unsubscribing.

curl --request POST \
--url "https://api.woodpecker.co/rest/v1/webhooks/unsubscribe" \
--header "Content-Type: application/json" \
--header "x-api-key: {YOUR_API_KEY}" \
--data '{
"target_url": "https://receiving-url.com/unique_target_url",
"event": "EVENT_NAME",
"safe": true
}'

Response​

Response examples​

The request removed the matching subscriptions.

Body: empty