Skip to main content

Unsubscribe from a Slack webhook

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

Unsubscribing discards any notifications still queued for the subscription. If delivery has been interrupted or you expect notifications to be queued, set safe to true. Woodpecker checks the queue and keeps the subscription active if any notifications are pending.

Request​

Endpoint​

POST https://api.woodpecker.co/rest/v1/slack_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 notifications for all of them.

{
"target_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"event": "prospect_replied",
"safe": true
}

Body schema​

FieldTypeRequiredDescription
target_urlstringYesSlack incoming webhook URL obtained from your Slack app
eventstringYesSupported event, matched case-insensitively
safebooleanNoWhen true, checks the selected subscriptions for queued events before removing them. Defaults to false

Request samples​

Unsubscribe from prospect replies after checking the queue​

curl --request POST \
--include \
--url "https://api.woodpecker.co/rest/v1/slack_webhooks/unsubscribe" \
--header "Content-Type: application/json" \
--header "x-api-key: {YOUR_API_KEY}" \
--data '{
"target_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"event": "prospect_replied",
"safe": true
}'

Response​

Response examples​

The request removed the matching subscriptions.

Body: empty