Update a webhook endpoint
curl --request PATCH \
--url https://api.centaur.io/v2/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>",
"description": "<string>",
"eventTypes": [],
"filters": {
"traderIds": [
123
],
"sourceIdentityIds": [
"<string>"
],
"assetIds": [
123
],
"assetClasses": []
},
"maxInFlight": 25
}
'import requests
url = "https://api.centaur.io/v2/webhooks/{id}"
payload = {
"url": "<string>",
"description": "<string>",
"eventTypes": [],
"filters": {
"traderIds": [123],
"sourceIdentityIds": ["<string>"],
"assetIds": [123],
"assetClasses": []
},
"maxInFlight": 25
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
description: '<string>',
eventTypes: [],
filters: {
traderIds: [123],
sourceIdentityIds: ['<string>'],
assetIds: [123],
assetClasses: []
},
maxInFlight: 25
})
};
fetch('https://api.centaur.io/v2/webhooks/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'description' => '<string>',
'eventTypes' => [
],
'filters' => [
'traderIds' => [
123
],
'sourceIdentityIds' => [
'<string>'
],
'assetIds' => [
123
],
'assetClasses' => [
]
],
'maxInFlight' => 25
]),
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}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"eventTypes\": [],\n \"filters\": {\n \"traderIds\": [\n 123\n ],\n \"sourceIdentityIds\": [\n \"<string>\"\n ],\n \"assetIds\": [\n 123\n ],\n \"assetClasses\": []\n },\n \"maxInFlight\": 25\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.centaur.io/v2/webhooks/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"eventTypes\": [],\n \"filters\": {\n \"traderIds\": [\n 123\n ],\n \"sourceIdentityIds\": [\n \"<string>\"\n ],\n \"assetIds\": [\n 123\n ],\n \"assetClasses\": []\n },\n \"maxInFlight\": 25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centaur.io/v2/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"eventTypes\": [],\n \"filters\": {\n \"traderIds\": [\n 123\n ],\n \"sourceIdentityIds\": [\n \"<string>\"\n ],\n \"assetIds\": [\n 123\n ],\n \"assetClasses\": []\n },\n \"maxInFlight\": 25\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"trade_event.created"
],
"filters": {
"traderIds": [
123
],
"sourceIdentityIds": [
"<string>"
],
"assetIds": [
123
],
"assetClasses": [
"crypto"
]
},
"status": "ACTIVE",
"statusChangedAt": "2023-11-07T05:31:56Z",
"disabledReason": "<string>",
"maxInFlight": 123,
"consecutiveFailures": 123,
"lastSuccessAt": "2023-11-07T05:31:56Z",
"lastFailureAt": "2023-11-07T05:31:56Z",
"lastSequence": 123,
"secretRotatedAt": "2023-11-07T05:31:56Z",
"previousSecretExpiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"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": "UNSAFE_URL",
"message": "The URL host resolves to a private, loopback, link-local or metadata address."
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "AUTHENTICATION_UNAVAILABLE",
"message": "Authentication is temporarily unavailable"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}Webhooks
Update a webhook endpoint
Changes the URL, description, event types, filters or concurrency of an endpoint. A new URL is checked like on create and resets consecutiveFailures. Use the pause, resume, disable and enable actions to change its status.
PATCH
/
webhooks
/
{id}
Update a webhook endpoint
curl --request PATCH \
--url https://api.centaur.io/v2/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>",
"description": "<string>",
"eventTypes": [],
"filters": {
"traderIds": [
123
],
"sourceIdentityIds": [
"<string>"
],
"assetIds": [
123
],
"assetClasses": []
},
"maxInFlight": 25
}
'import requests
url = "https://api.centaur.io/v2/webhooks/{id}"
payload = {
"url": "<string>",
"description": "<string>",
"eventTypes": [],
"filters": {
"traderIds": [123],
"sourceIdentityIds": ["<string>"],
"assetIds": [123],
"assetClasses": []
},
"maxInFlight": 25
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
description: '<string>',
eventTypes: [],
filters: {
traderIds: [123],
sourceIdentityIds: ['<string>'],
assetIds: [123],
assetClasses: []
},
maxInFlight: 25
})
};
fetch('https://api.centaur.io/v2/webhooks/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'description' => '<string>',
'eventTypes' => [
],
'filters' => [
'traderIds' => [
123
],
'sourceIdentityIds' => [
'<string>'
],
'assetIds' => [
123
],
'assetClasses' => [
]
],
'maxInFlight' => 25
]),
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}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"eventTypes\": [],\n \"filters\": {\n \"traderIds\": [\n 123\n ],\n \"sourceIdentityIds\": [\n \"<string>\"\n ],\n \"assetIds\": [\n 123\n ],\n \"assetClasses\": []\n },\n \"maxInFlight\": 25\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.centaur.io/v2/webhooks/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"eventTypes\": [],\n \"filters\": {\n \"traderIds\": [\n 123\n ],\n \"sourceIdentityIds\": [\n \"<string>\"\n ],\n \"assetIds\": [\n 123\n ],\n \"assetClasses\": []\n },\n \"maxInFlight\": 25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centaur.io/v2/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"eventTypes\": [],\n \"filters\": {\n \"traderIds\": [\n 123\n ],\n \"sourceIdentityIds\": [\n \"<string>\"\n ],\n \"assetIds\": [\n 123\n ],\n \"assetClasses\": []\n },\n \"maxInFlight\": 25\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"trade_event.created"
],
"filters": {
"traderIds": [
123
],
"sourceIdentityIds": [
"<string>"
],
"assetIds": [
123
],
"assetClasses": [
"crypto"
]
},
"status": "ACTIVE",
"statusChangedAt": "2023-11-07T05:31:56Z",
"disabledReason": "<string>",
"maxInFlight": 123,
"consecutiveFailures": 123,
"lastSuccessAt": "2023-11-07T05:31:56Z",
"lastFailureAt": "2023-11-07T05:31:56Z",
"lastSequence": 123,
"secretRotatedAt": "2023-11-07T05:31:56Z",
"previousSecretExpiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"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": "UNSAFE_URL",
"message": "The URL host resolves to a private, loopback, link-local or metadata address."
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}{
"success": false,
"error": {
"code": "AUTHENTICATION_UNAVAILABLE",
"message": "Authentication is temporarily unavailable"
},
"requestId": "c8e2c6e4-80dd-4ffc-9d66-4e31bf64c6b8"
}Authorizations
API key issued by Centaur.
Path Parameters
Endpoint ID.
Body
application/json
Fields to change. Omitted fields keep their value.
New delivery URL, checked like on create. Changing it resets consecutiveFailures.
Maximum string length:
2048New label, or null to clear it.
Maximum string length:
256Event types the endpoint subscribes to. At least one, no duplicates.
Minimum array length:
1Available options:
trade_event.created, trade_event.deleted, feed_item.created, feed_item.updated, feed_item.deleted, positioning.trending.updated, positioning.specialist_ideas.updated, positioning.early_opportunities.updated, positioning.crowd_fade.updated, positioning.smart_money.updated, positioning.leaders_book.updated Replacement subscription filters. {} removes every filter.
Show child attributes
Show child attributes
Maximum deliveries sent to this endpoint at the same time, 1 to 50. Defaults to 5.
Required range:
1 <= x <= 50