List Hooks
curl --request GET \
--url https://api.posthook.io/v1/hooks \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.posthook.io/v1/hooks"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.posthook.io/v1/hooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.posthook.io/v1/hooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.posthook.io/v1/hooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.posthook.io/v1/hooks")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.posthook.io/v1/hooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"path": "<string>",
"domain": "<string>",
"data": {},
"postAt": "2023-11-07T05:31:56Z",
"status": "pending",
"postDurationSeconds": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attempts": 123,
"failureError": "<string>",
"tryAt": "2023-11-07T05:31:56Z",
"wasNotified": true,
"sequenceData": {
"sequenceID": "<string>",
"stepName": "<string>",
"sequenceLastRunAt": "2023-11-07T05:31:56Z"
}
}
],
"meta": {
"totalItems": 123
}
}Endpoints
List Hooks
Retrieve a paginated list of hooks for the current project. Supports cursor-based pagination and filtering by status.
GET
/
hooks
List Hooks
curl --request GET \
--url https://api.posthook.io/v1/hooks \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.posthook.io/v1/hooks"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.posthook.io/v1/hooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.posthook.io/v1/hooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.posthook.io/v1/hooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.posthook.io/v1/hooks")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.posthook.io/v1/hooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"path": "<string>",
"domain": "<string>",
"data": {},
"postAt": "2023-11-07T05:31:56Z",
"status": "pending",
"postDurationSeconds": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attempts": 123,
"failureError": "<string>",
"tryAt": "2023-11-07T05:31:56Z",
"wasNotified": true,
"sequenceData": {
"sequenceID": "<string>",
"stepName": "<string>",
"sequenceLastRunAt": "2023-11-07T05:31:56Z"
}
}
],
"meta": {
"totalItems": 123
}
}List your webhooks with cursor-based pagination.
The
Cursor-Based Pagination
Results are paginated using an opaque cursor. Pass thecursor from the previous response to fetch the next page. When no more results are available, no cursor is returned.
The
offset parameter has been removed. Use cursor for pagination instead.SDK Methods
| Language | Single Page | Auto-Paginate |
|---|---|---|
| TypeScript | posthook.hooks.list({ status, limit }) | posthook.hooks.listAll({ status }) |
| Python | client.hooks.list(status, limit) | client.hooks.list_all(status) |
| Go | client.Hooks.List(ctx, &HookListParams{}) | client.Hooks.ListAll(ctx, &HookListAllParams{}) |
listAll / list_all / ListAll methods return an iterator that handles cursor pagination automatically.
Usage Patterns
Common patterns for this endpoint include:- Dead Letter Queue: Process failures within a specific time window.
- Bulk Retry: Batch retry failed hooks.
- Auditing: Reconcile Posthook delivery logs with your internal records.
Authorizations
Query Parameters
Cursor for pagination. Use the value from the previous response to get the next page.
Field to sort results by
Available options:
postAt, createdAt Sort direction
Available options:
asc, desc Available options:
pending, completed, failed, retry Filter hooks scheduled before this timestamp
Filter hooks scheduled after this timestamp
Filter hooks created before this timestamp
Filter hooks created after this timestamp
Was this page helpful?