Skip to main content

Subscribe to a Slack webhook

Receive Woodpecker notifications about events in your account directly in a Slack channel. First, create a Slack incoming webhook for your chosen channel, then use its URL to subscribe to the events you want to receive.

Request​

Endpoint​

POST https://api.woodpecker.co/rest/v1/slack_webhooks/subscribe

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​

Each account can register up to five distinct Slack webhook URLs per event. Custom webhook subscriptions are counted separately.

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

Body schema​

FieldTypeRequiredDescription
target_urlstringYesSlack incoming webhook URL obtained from your Slack app
eventstringYesOne of the supported events

Request samples​

Subscribe to prospect replies​

curl --request POST \
--url "https://api.woodpecker.co/rest/v1/slack_webhooks/subscribe" \
--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"
}'

Response​

Response examples​

The subscription was created.

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

Body schema​

FieldTypeDescription
target_urlstringSlack incoming webhook URL as sent in the request
eventstringEvent name as sent in the request
messagestringConfirmation message, Subscribed.