Upgrade a webhook endpoint
curl --request POST \
--url https://api.centaur.io/v2/webhooks/{id}/upgrade \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"payloadSchemaVersion": 1
}
'import requests
url = "https://api.centaur.io/v2/webhooks/{id}/upgrade"
payload = { "payloadSchemaVersion": 1 }
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({payloadSchemaVersion: 1})
};
fetch('https://api.centaur.io/v2/webhooks/{id}/upgrade', 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.centaur.io/v2/webhooks/{id}/upgrade",
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([
'payloadSchemaVersion' => 1
]),
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.centaur.io/v2/webhooks/{id}/upgrade"
payload := strings.NewReader("{\n \"payloadSchemaVersion\": 1\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.centaur.io/v2/webhooks/{id}/upgrade")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payloadSchemaVersion\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centaur.io/v2/webhooks/{id}/upgrade")
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 \"payloadSchemaVersion\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3f0c8a52-6a7e-4d0b-9b5e-2f1c7d9e4a10",
"url": "https://hooks.example.com/centaur",
"description": "Production trade alerts",
"eventTypes": [
"trade_event.created",
"trade_view.created",
"feed_item.created"
],
"filters": {
"traderIds": [
7
],
"assetClasses": [
"crypto"
],
"kinds": [
"trade",
"view"
]
},
"status": "ACTIVE",
"statusChangedAt": "2026-10-05T10:00:00.000Z",
"disabledReason": null,
"maxInFlight": 5,
"consecutiveFailures": 0,
"lastSuccessAt": "2026-10-05T10:05:30.000Z",
"lastFailureAt": null,
"lastSequence": 42,
"secretRotatedAt": null,
"previousSecretExpiresAt": null,
"createdAt": "2026-10-05T10:00:00.000Z",
"updatedAt": "2026-10-05T10:00:00.000Z",
"payloadSchemaVersion": 2
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "API key lacks webhooks.manage permission"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Webhook endpoint not found"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "INVALID_ENDPOINT_STATE",
"message": "This endpoint receives payload schema version 2, which does not allow moving back to version 1. An upgrade cannot be undone."
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "AUTHENTICATION_UNAVAILABLE",
"message": "Authentication is temporarily unavailable"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}Webhooks
Upgrade a webhook endpoint
Moves an endpoint to payload schema version 2, keeping its URL, secret, event types and filters. New deliveries then carry schemaVersion: 2: feed_item.* payloads carry events and views instead of current, added and removed, and the endpoint can subscribe to trade_view.* and set filters.kinds. Feed item deliveries queued before the upgrade, and replays of them, keep their version 1 payload and schemaVersion: 1. An upgrade cannot be undone, and REST v1 no longer shows the endpoint. Upgrading a version 2 endpoint changes nothing.
POST
/
webhooks
/
{id}
/
upgrade
Upgrade a webhook endpoint
curl --request POST \
--url https://api.centaur.io/v2/webhooks/{id}/upgrade \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"payloadSchemaVersion": 1
}
'import requests
url = "https://api.centaur.io/v2/webhooks/{id}/upgrade"
payload = { "payloadSchemaVersion": 1 }
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({payloadSchemaVersion: 1})
};
fetch('https://api.centaur.io/v2/webhooks/{id}/upgrade', 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.centaur.io/v2/webhooks/{id}/upgrade",
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([
'payloadSchemaVersion' => 1
]),
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.centaur.io/v2/webhooks/{id}/upgrade"
payload := strings.NewReader("{\n \"payloadSchemaVersion\": 1\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.centaur.io/v2/webhooks/{id}/upgrade")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payloadSchemaVersion\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centaur.io/v2/webhooks/{id}/upgrade")
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 \"payloadSchemaVersion\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3f0c8a52-6a7e-4d0b-9b5e-2f1c7d9e4a10",
"url": "https://hooks.example.com/centaur",
"description": "Production trade alerts",
"eventTypes": [
"trade_event.created",
"trade_view.created",
"feed_item.created"
],
"filters": {
"traderIds": [
7
],
"assetClasses": [
"crypto"
],
"kinds": [
"trade",
"view"
]
},
"status": "ACTIVE",
"statusChangedAt": "2026-10-05T10:00:00.000Z",
"disabledReason": null,
"maxInFlight": 5,
"consecutiveFailures": 0,
"lastSuccessAt": "2026-10-05T10:05:30.000Z",
"lastFailureAt": null,
"lastSequence": 42,
"secretRotatedAt": null,
"previousSecretExpiresAt": null,
"createdAt": "2026-10-05T10:00:00.000Z",
"updatedAt": "2026-10-05T10:00:00.000Z",
"payloadSchemaVersion": 2
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "API key lacks webhooks.manage permission"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Webhook endpoint not found"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "INVALID_ENDPOINT_STATE",
"message": "This endpoint receives payload schema version 2, which does not allow moving back to version 1. An upgrade cannot be undone."
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "AUTHENTICATION_UNAVAILABLE",
"message": "Authentication is temporarily unavailable"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}Body
application/json
The payload schema version to move the endpoint to.