Register a webhook endpoint
curl --request POST \
--url https://api.kordio.io/ledger/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://acme.example.com/webhooks/kordio",
"enabled_events": [
"transaction.created",
"transaction.reversed"
]
}
'import requests
url = "https://api.kordio.io/ledger/v1/webhook_endpoints"
payload = {
"url": "https://acme.example.com/webhooks/kordio",
"enabled_events": ["transaction.created", "transaction.reversed"]
}
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: 'https://acme.example.com/webhooks/kordio',
enabled_events: ['transaction.created', 'transaction.reversed']
})
};
fetch('https://api.kordio.io/ledger/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://api.kordio.io/ledger/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' => 'https://acme.example.com/webhooks/kordio',
'enabled_events' => [
'transaction.created',
'transaction.reversed'
]
]),
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://api.kordio.io/ledger/v1/webhook_endpoints"
payload := strings.NewReader("{\n \"url\": \"https://acme.example.com/webhooks/kordio\",\n \"enabled_events\": [\n \"transaction.created\",\n \"transaction.reversed\"\n ]\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://api.kordio.io/ledger/v1/webhook_endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://acme.example.com/webhooks/kordio\",\n \"enabled_events\": [\n \"transaction.created\",\n \"transaction.reversed\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/ledger/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\": \"https://acme.example.com/webhooks/kordio\",\n \"enabled_events\": [\n \"transaction.created\",\n \"transaction.reversed\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "446ea1a3-3bcc-4c8c-9f4f-9ef8e1468c4e",
"url": "https://acme.example.com/webhooks/kordio",
"description": null,
"mode": "test",
"active": true,
"enabled_events": [
"transaction.created",
"transaction.reversed"
],
"last_delivered_at": null,
"created_at": "2026-05-14T15:55:13.114492Z",
"signing_secret": "whsec_test_4bSFH1YTkjwsgiMrHMwWJfJTIzsov60WxxsziZAE",
"signing_secret_note": "this is the only time the secret is shown. store it before discarding this response."
}{
"livemode": false,
"request_id": "req_3LhM8XKx9q4hQv",
"error": {
"code": "invalid_request",
"message": "<string>",
"hint": "<string>",
"param": "<string>",
"details": {},
"docs_url": "<string>",
"request_id": "<string>"
}
}The response includes signing_secret, the only time it is
returned. Store it before discarding the response.
POST
/
ledger
/
v1
/
webhook_endpoints
Register a webhook endpoint
curl --request POST \
--url https://api.kordio.io/ledger/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://acme.example.com/webhooks/kordio",
"enabled_events": [
"transaction.created",
"transaction.reversed"
]
}
'import requests
url = "https://api.kordio.io/ledger/v1/webhook_endpoints"
payload = {
"url": "https://acme.example.com/webhooks/kordio",
"enabled_events": ["transaction.created", "transaction.reversed"]
}
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: 'https://acme.example.com/webhooks/kordio',
enabled_events: ['transaction.created', 'transaction.reversed']
})
};
fetch('https://api.kordio.io/ledger/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://api.kordio.io/ledger/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' => 'https://acme.example.com/webhooks/kordio',
'enabled_events' => [
'transaction.created',
'transaction.reversed'
]
]),
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://api.kordio.io/ledger/v1/webhook_endpoints"
payload := strings.NewReader("{\n \"url\": \"https://acme.example.com/webhooks/kordio\",\n \"enabled_events\": [\n \"transaction.created\",\n \"transaction.reversed\"\n ]\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://api.kordio.io/ledger/v1/webhook_endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://acme.example.com/webhooks/kordio\",\n \"enabled_events\": [\n \"transaction.created\",\n \"transaction.reversed\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/ledger/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\": \"https://acme.example.com/webhooks/kordio\",\n \"enabled_events\": [\n \"transaction.created\",\n \"transaction.reversed\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "446ea1a3-3bcc-4c8c-9f4f-9ef8e1468c4e",
"url": "https://acme.example.com/webhooks/kordio",
"description": null,
"mode": "test",
"active": true,
"enabled_events": [
"transaction.created",
"transaction.reversed"
],
"last_delivered_at": null,
"created_at": "2026-05-14T15:55:13.114492Z",
"signing_secret": "whsec_test_4bSFH1YTkjwsgiMrHMwWJfJTIzsov60WxxsziZAE",
"signing_secret_note": "this is the only time the secret is shown. store it before discarding this response."
}{
"livemode": false,
"request_id": "req_3LhM8XKx9q4hQv",
"error": {
"code": "invalid_request",
"message": "<string>",
"hint": "<string>",
"param": "<string>",
"details": {},
"docs_url": "<string>",
"request_id": "<string>"
}
}Authorizations
Same flow; ledger:write is required for any mutation.
Body
application/json
Response
Endpoint created. Body includes one-time signing_secret.
Discriminator naming the shape of this resource (e.g. account, transaction).
Available options:
webhook_endpoint Example:
"account"
Available options:
live, test Returned only on create + rotate.
Hint to the integrator that the secret is shown once.