Get webhook subscriptions
Retrieve a list of all subscribed webhooks for the authenticated account. Each webhook consists of a target_url
and event
To manage your existing subscriptions or subscribe to new events, please refer to this guide.
Request
Endpoint
GET https://api.woodpecker.co/rest/v2/webhooks
Headers
x-api-key: {YOUR_API_KEY}
For details on how to authenticate your requests, please see the authentication guide.
Request sample
Retrieve a list of webhook subscriptions
- cURL
- Java
- Node.js
curl --request GET \
--url "https://api.woodpecker.co/rest/v2/webhooks" \
--header "x-api-key: {YOUR_API_KEY}"
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class WoodpeckerApiClient {
public static void main(String[] args) {
String apiKey = "YOUR_API_KEY";
String endpoint = "https://api.woodpecker.co/rest/v2/webhooks";
try {
URL url = new URL(endpoint);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("x-api-key", apiKey);
int responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println("Response: " + response.toString());
} else {
System.out.println("GET request failed with response code: " + responseCode);
}
connection.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
const axios = require("axios");
const apiKey = "YOUR_API_KEY";
const url = "https://api.woodpecker.co/rest/v2/webhooks";
axios
.get(url, {
headers: {
"x-api-key": apiKey,
},
})
.then((response) => {
console.log("Response:", response.data);
})
.catch((error) => {
console.error("Error:", error.response ? error.response.data : error.message);
});
Response
Response examples
- 200
- 200 (no subscriptions)
- 401
- 404
- 500
Returns a list of webhooks associated with the account, if any are subscribed. The results include all webhooks under the account, regardless of which user created the subscription.
{
"webhooks": [
{
"target_url": "https://myurl.com/woodpeckerwebhooks",
"event": "PROSPECT_INTERESTED"
},
{
"target_url": "https://hooks.zapier.com/hooks/catch/123456/",
"event": "PROSPECT_REPLIED"
},
{
"target_url": "https://hook.eu1.make.com/abcd123",
"event": "PROSPECT_REPLIED"
}
]
}
Body schema
Field | Type | Description |
---|---|---|
webhooks[] | array | A list of webhook objects, each containing the target URL and the event type |
└─target_url | string | The URL to which the webhook is sent |
└─event | string | The type of event in Woodpecker that will trigger the webhook. Available webhooks |
A response if your account is not subscribed to any webhooks.
{
"message": "You haven't subscribed to any webhooks."
}
Body schema
Field | Type | Description |
---|---|---|
message | string | A message describing the response |
An issue with authorization. Please review the authorization guide
{
"title": "Unauthorized",
"status": 401,
"detail": "Invalid api key",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Please review the request URL.
{
"title": "Not Found",
"status": 404,
"detail": "Requested resource does not exist",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Unknown error, please try again later
{
"title": "Internal server error",
"status": 500,
"detail": "An unexpected error has occurred. Please try again later.",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |