Subscriptions
Create subscription
Register a new webhook subscription
POST
/
api
/
webhooks
/
subscriptions
Create subscription
curl --request POST \
--url https://api.example.com/api/webhooks/subscriptions \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
"<string>"
],
"label": "<string>"
}
'import requests
url = "https://api.example.com/api/webhooks/subscriptions"
payload = {
"url": "<string>",
"events": ["<string>"],
"label": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: ['<string>'], label: '<string>'})
};
fetch('https://api.example.com/api/webhooks/subscriptions', 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.example.com/api/webhooks/subscriptions",
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([
'url' => '<string>',
'events' => [
'<string>'
],
'label' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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.example.com/api/webhooks/subscriptions"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"label\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.example.com/api/webhooks/subscriptions")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"label\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/webhooks/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"label\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1c84203c-b4e3-40de-83a9-51bc0d9c991f",
"url": "https://hooks.example.com/teel",
"events": ["payout.created", "payout.status.updated"],
"status": "active",
"secretPrefix": "whsec_Pdt_BP",
"secret": "whsec_Pdt_BP3ft-nIDl86430kZrGEy8qd7zB4pCUmeU1GVB0",
"label": "Production receiver",
"lastSuccessAt": null,
"lastFailureAt": null,
"createdAt": "2026-05-27T09:30:00Z",
"updatedAt": "2026-05-27T09:30:00Z"
}
Register a delivery URL.
The other fields (
The response includes
secret (a whsec_… signing secret) once. Store it on receipt — only the secretPrefix is retrievable later.Scope
webhooks:write · rate-limitedHeaders
string
required
API key.
Request body
string
required
Endpoint URL. Must be
https://. Rejected with 400 if it’s a private IP, loopback, or metadata host.string[]
required
Non-empty list of event types. Allowed:
payout.created, payout.status.updated.string
Optional human-readable label for the dashboard. Never sent to your endpoint.
Response
string
Subscription UUID.
string
The signing secret in plaintext. Returned only on create — store it immediately.
string
First few characters of the secret for partner-side identification on subsequent reads.
string
Always
active on a new subscription.url, events, label, lastSuccessAt, lastFailureAt, createdAt, updatedAt) match the shape on List subscriptions.
{
"id": "1c84203c-b4e3-40de-83a9-51bc0d9c991f",
"url": "https://hooks.example.com/teel",
"events": ["payout.created", "payout.status.updated"],
"status": "active",
"secretPrefix": "whsec_Pdt_BP",
"secret": "whsec_Pdt_BP3ft-nIDl86430kZrGEy8qd7zB4pCUmeU1GVB0",
"label": "Production receiver",
"lastSuccessAt": null,
"lastFailureAt": null,
"createdAt": "2026-05-27T09:30:00Z",
"updatedAt": "2026-05-27T09:30:00Z"
}
Errors
| Status | Meaning |
|---|---|
400 | Invalid URL (not https, missing host, private IP, metadata host) or unknown event type. |
409 | You’ve reached the per-account limit (25). Delete or pause an existing one first. |
⌘I
Create subscription
curl --request POST \
--url https://api.example.com/api/webhooks/subscriptions \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
"<string>"
],
"label": "<string>"
}
'import requests
url = "https://api.example.com/api/webhooks/subscriptions"
payload = {
"url": "<string>",
"events": ["<string>"],
"label": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: ['<string>'], label: '<string>'})
};
fetch('https://api.example.com/api/webhooks/subscriptions', 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.example.com/api/webhooks/subscriptions",
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([
'url' => '<string>',
'events' => [
'<string>'
],
'label' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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.example.com/api/webhooks/subscriptions"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"label\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.example.com/api/webhooks/subscriptions")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"label\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/webhooks/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"label\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1c84203c-b4e3-40de-83a9-51bc0d9c991f",
"url": "https://hooks.example.com/teel",
"events": ["payout.created", "payout.status.updated"],
"status": "active",
"secretPrefix": "whsec_Pdt_BP",
"secret": "whsec_Pdt_BP3ft-nIDl86430kZrGEy8qd7zB4pCUmeU1GVB0",
"label": "Production receiver",
"lastSuccessAt": null,
"lastFailureAt": null,
"createdAt": "2026-05-27T09:30:00Z",
"updatedAt": "2026-05-27T09:30:00Z"
}