Create webhook endpoints
curl --request POST \
--url https://www.referly.so/api/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
"<string>"
],
"description": "",
"disabled": false
}
'import requests
url = "https://www.referly.so/api/v1/webhook-endpoints"
payload = {
"url": "<string>",
"events": ["<string>"],
"description": "",
"disabled": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: ['<string>'], description: '', disabled: false})
};
fetch('https://www.referly.so/api/v1/webhook-endpoints', 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://www.referly.so/api/v1/webhook-endpoints",
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>'
],
'description' => '',
'disabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://www.referly.so/api/v1/webhook-endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"\",\n \"disabled\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://www.referly.so/api/v1/webhook-endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"\",\n \"disabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.referly.so/api/v1/webhook-endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"\",\n \"disabled\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "ep_acme_events",
"url": "https://hooks.acme.example/referly",
"description": "Partner events",
"version": 1,
"disabled": false,
"channels": [
"ep_acme_events",
"default"
],
"filterTypes": [
"commission.created",
"payout.paid"
],
"createdAt": "2026-09-03T10:00:00.000Z",
"updatedAt": "2026-09-03T10:00:00.000Z"
}{
"error": {
"code": "invalid_json",
"message": "Invalid JSON body",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid, expired or revoked API key",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "webhooks_disabled",
"message": "Webhook access is disabled",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "concurrent_request",
"message": "Concurrent operation; retry the same request",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "body_too_large",
"message": "Request body must be at most 64 KiB",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "invalid_webhook_url",
"message": "Use a public HTTPS URL on port 443 without credentials or a fragment",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": "Too many requests. Please slow down.",
"retryAfter": 42
}{
"error": {
"code": "internal_error",
"message": "Request failed",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "webhook_provider_error",
"message": "Webhook provider request failed; retry with the same idempotency key",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}Webhook Endpoints
Create webhook endpoints
Requires webhook-endpoints:write. See Webhook endpoints behavior and common API rules.
POST
/
webhook-endpoints
Create webhook endpoints
curl --request POST \
--url https://www.referly.so/api/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
"<string>"
],
"description": "",
"disabled": false
}
'import requests
url = "https://www.referly.so/api/v1/webhook-endpoints"
payload = {
"url": "<string>",
"events": ["<string>"],
"description": "",
"disabled": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: ['<string>'], description: '', disabled: false})
};
fetch('https://www.referly.so/api/v1/webhook-endpoints', 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://www.referly.so/api/v1/webhook-endpoints",
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>'
],
'description' => '',
'disabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://www.referly.so/api/v1/webhook-endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"\",\n \"disabled\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://www.referly.so/api/v1/webhook-endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"\",\n \"disabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.referly.so/api/v1/webhook-endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"description\": \"\",\n \"disabled\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "ep_acme_events",
"url": "https://hooks.acme.example/referly",
"description": "Partner events",
"version": 1,
"disabled": false,
"channels": [
"ep_acme_events",
"default"
],
"filterTypes": [
"commission.created",
"payout.paid"
],
"createdAt": "2026-09-03T10:00:00.000Z",
"updatedAt": "2026-09-03T10:00:00.000Z"
}{
"error": {
"code": "invalid_json",
"message": "Invalid JSON body",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid, expired or revoked API key",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "webhooks_disabled",
"message": "Webhook access is disabled",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "concurrent_request",
"message": "Concurrent operation; retry the same request",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "body_too_large",
"message": "Request body must be at most 64 KiB",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "invalid_webhook_url",
"message": "Use a public HTTPS URL on port 443 without credentials or a fragment",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": "Too many requests. Please slow down.",
"retryAfter": 42
}{
"error": {
"code": "internal_error",
"message": "Request failed",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}{
"error": {
"code": "webhook_provider_error",
"message": "Webhook provider request failed; retry with the same idempotency key",
"requestId": "5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21"
}
}Requires
webhook-endpoints:write. See the webhook endpoints guide for behavior and examples.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional retry key, unique within the selected program. Reuse the same key, method, path and validated payload; a conflicting reuse returns 409.
Required string length:
8 - 200Pattern:
^[\x21-\x7e]+$Select the key's original program or a program provisioned by this exact key. Other owned programs remain inaccessible.
Body
application/json
Response
Success. Monetary amounts use program currency; see companion documentation for resource fields.
Last modified on October 23, 2026
⌘I