Schedule Hook
curl --request POST \
--url https://api.posthook.io/v1/hooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"path": "/webhooks/reminder",
"data": {
"user_id": "123"
},
"postAt": "2026-03-14T12:00:00Z",
"postAtLocal": "2026-03-15T13:00:00",
"timezone": "America/New_York",
"postIn": "1h30m"
}
'import requests
url = "https://api.posthook.io/v1/hooks"
payload = {
"path": "/webhooks/reminder",
"data": { "user_id": "123" },
"postAt": "2026-03-14T12:00:00Z",
"postAtLocal": "2026-03-15T13:00:00",
"timezone": "America/New_York",
"postIn": "1h30m"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
path: '/webhooks/reminder',
data: {user_id: '123'},
postAt: '2026-03-14T12:00:00Z',
postAtLocal: '2026-03-15T13:00:00',
timezone: 'America/New_York',
postIn: '1h30m'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'path' => '/webhooks/reminder',
'data' => [
'user_id' => '123'
],
'postAt' => '2026-03-14T12:00:00Z',
'postAtLocal' => '2026-03-15T13:00:00',
'timezone' => 'America/New_York',
'postIn' => '1h30m'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.posthook.io/v1/hooks"
payload := strings.NewReader("{\n \"path\": \"/webhooks/reminder\",\n \"data\": {\n \"user_id\": \"123\"\n },\n \"postAt\": \"2026-03-14T12:00:00Z\",\n \"postAtLocal\": \"2026-03-15T13:00:00\",\n \"timezone\": \"America/New_York\",\n \"postIn\": \"1h30m\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.posthook.io/v1/hooks")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"/webhooks/reminder\",\n \"data\": {\n \"user_id\": \"123\"\n },\n \"postAt\": \"2026-03-14T12:00:00Z\",\n \"postAtLocal\": \"2026-03-15T13:00:00\",\n \"timezone\": \"America/New_York\",\n \"postIn\": \"1h30m\"\n}")
.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::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"path\": \"/webhooks/reminder\",\n \"data\": {\n \"user_id\": \"123\"\n },\n \"postAt\": \"2026-03-14T12:00:00Z\",\n \"postAtLocal\": \"2026-03-15T13:00:00\",\n \"timezone\": \"America/New_York\",\n \"postIn\": \"1h30m\"\n}"
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"
}
}
}Endpoints
Schedule Hook
Schedule a new hook for delivery at a specific time. Supports UTC, local-time, and relative-delay scheduling modes.
POST
/
hooks
Schedule Hook
curl --request POST \
--url https://api.posthook.io/v1/hooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"path": "/webhooks/reminder",
"data": {
"user_id": "123"
},
"postAt": "2026-03-14T12:00:00Z",
"postAtLocal": "2026-03-15T13:00:00",
"timezone": "America/New_York",
"postIn": "1h30m"
}
'import requests
url = "https://api.posthook.io/v1/hooks"
payload = {
"path": "/webhooks/reminder",
"data": { "user_id": "123" },
"postAt": "2026-03-14T12:00:00Z",
"postAtLocal": "2026-03-15T13:00:00",
"timezone": "America/New_York",
"postIn": "1h30m"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
path: '/webhooks/reminder',
data: {user_id: '123'},
postAt: '2026-03-14T12:00:00Z',
postAtLocal: '2026-03-15T13:00:00',
timezone: 'America/New_York',
postIn: '1h30m'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'path' => '/webhooks/reminder',
'data' => [
'user_id' => '123'
],
'postAt' => '2026-03-14T12:00:00Z',
'postAtLocal' => '2026-03-15T13:00:00',
'timezone' => 'America/New_York',
'postIn' => '1h30m'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.posthook.io/v1/hooks"
payload := strings.NewReader("{\n \"path\": \"/webhooks/reminder\",\n \"data\": {\n \"user_id\": \"123\"\n },\n \"postAt\": \"2026-03-14T12:00:00Z\",\n \"postAtLocal\": \"2026-03-15T13:00:00\",\n \"timezone\": \"America/New_York\",\n \"postIn\": \"1h30m\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.posthook.io/v1/hooks")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"/webhooks/reminder\",\n \"data\": {\n \"user_id\": \"123\"\n },\n \"postAt\": \"2026-03-14T12:00:00Z\",\n \"postAtLocal\": \"2026-03-15T13:00:00\",\n \"timezone\": \"America/New_York\",\n \"postIn\": \"1h30m\"\n}")
.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::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"path\": \"/webhooks/reminder\",\n \"data\": {\n \"user_id\": \"123\"\n },\n \"postAt\": \"2026-03-14T12:00:00Z\",\n \"postAtLocal\": \"2026-03-15T13:00:00\",\n \"timezone\": \"America/New_York\",\n \"postIn\": \"1h30m\"\n}"
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"
}
}
}Schedule a new webhook to be sent at a specific time in the future (or immediately).
Pro Tip: To verify immediate delivery, use a timestamp in the past (e.g. yesterday).
URL Resolution
When you schedule a hook, you provide apath (e.g. /webhooks/remind).
Posthook constructs the full destination URL by combining your Project Domain with this path.
Destination URL =For example, if your Project Domain isProject Domain+path
api.myapp.com and you schedule a hook with path /webhooks/payment, we will POST to https://api.myapp.com/webhooks/payment (Posthook enforces HTTPS).
Usage Patterns
- User Engagement: Schedule event reminders and abandoned cart recovery emails.
- Auto-Expiry (TTL): Schedule the deletion of temporary resources (e.g. shared links) at the moment of creation.
- Recursive Polling: Periodically check a long-running job (e.g. video encoding) until it completes.
- Debouncing: Prevent duplicate processing by verifying event freshness.
Body
application/json
Was this page helpful?