Update Webhook
curl --request PATCH \
--url https://api.pro.daya.co/public/v1/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"url": "<string>",
"events": [
{}
],
"status": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.pro.daya.co/public/v1/webhooks/{id}"
payload = {
"url": "<string>",
"events": [{}],
"status": "<string>",
"description": "<string>"
}
headers = {
"X-Api-Key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [{}], status: '<string>', description: '<string>'})
};
fetch('https://api.pro.daya.co/public/v1/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.pro.daya.co/public/v1/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>',
'events' => [
[
]
],
'status' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-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.pro.daya.co/public/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"status\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<x-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.pro.daya.co/public/v1/webhooks/{id}")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"status\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"status\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Webhook updated successfully",
"data": {
"id": "770e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/webhooks/daya",
"description": "Order notifications",
"events": ["order.filled", "trade.executed"],
"status": "active",
"failure_count": 0,
"last_success_at": "2024-01-15T10:30:00Z",
"last_failure_at": null,
"last_failure_reason": null,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T12:00:00Z"
},
"timestamp": "2024-01-15T12:00:00Z"
}
Webhooks API
Update Webhook
Update a webhook’s configuration
PATCH
/
public
/
v1
/
webhooks
/
{id}
Update Webhook
curl --request PATCH \
--url https://api.pro.daya.co/public/v1/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"url": "<string>",
"events": [
{}
],
"status": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.pro.daya.co/public/v1/webhooks/{id}"
payload = {
"url": "<string>",
"events": [{}],
"status": "<string>",
"description": "<string>"
}
headers = {
"X-Api-Key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [{}], status: '<string>', description: '<string>'})
};
fetch('https://api.pro.daya.co/public/v1/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.pro.daya.co/public/v1/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>',
'events' => [
[
]
],
'status' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-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.pro.daya.co/public/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"status\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<x-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.pro.daya.co/public/v1/webhooks/{id}")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"status\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"status\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Webhook updated successfully",
"data": {
"id": "770e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/webhooks/daya",
"description": "Order notifications",
"events": ["order.filled", "trade.executed"],
"status": "active",
"failure_count": 0,
"last_success_at": "2024-01-15T10:30:00Z",
"last_failure_at": null,
"last_failure_reason": null,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T12:00:00Z"
},
"timestamp": "2024-01-15T12:00:00Z"
}
Overview
Update a webhook’s URL, events, status, or description. All fields are optional - only include the fields you want to update.Pro webhook setup and configuration changes are support-managed. Contact support@daya.co if you need to add or change webhook endpoints for your Pro account.
Authentication
Your API key with Write scope
X-Api-Key: daya_sk_YOUR_API_KEY
Path Parameters
Webhook ID (UUID)Example:
770e8400-e29b-41d4-a716-446655440000Request Body
New webhook endpoint URL (must be HTTPS)
New events to subscribe toAllowed values:
order.created, order.filled, order.partially_filled, order.cancelled, order.rejected, trade.executed, deposit.completed, crypto.deposit.completedWebhook statusAllowed values:
active, pausedNew description for the webhook
Request Examples
Update Events
curl --request PATCH \
--url 'https://api.pro.daya.co/public/v1/webhooks/770e8400-e29b-41d4-a716-446655440000' \
--header 'X-Api-Key: daya_sk_YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"events": ["order.filled", "trade.executed"]
}'
const webhookId = '770e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.pro.daya.co/public/v1/webhooks/${webhookId}`,
{
method: 'PATCH',
headers: {
'X-Api-Key': 'daya_sk_YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: ['order.filled', 'trade.executed']
})
}
);
const data = await response.json();
console.log('Updated webhook:', data.data);
Pause Webhook
curl --request PATCH \
--url 'https://api.pro.daya.co/public/v1/webhooks/770e8400-e29b-41d4-a716-446655440000' \
--header 'X-Api-Key: daya_sk_YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"status": "paused"
}'
const webhookId = '770e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.pro.daya.co/public/v1/webhooks/${webhookId}`,
{
method: 'PATCH',
headers: {
'X-Api-Key': 'daya_sk_YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'paused'
})
}
);
Resume Webhook
curl --request PATCH \
--url 'https://api.pro.daya.co/public/v1/webhooks/770e8400-e29b-41d4-a716-446655440000' \
--header 'X-Api-Key: daya_sk_YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"status": "active"}'
Response
Indicates if the request was successful
Human-readable response message
Updated webhook object
Show webhook properties
Show webhook properties
Unique webhook identifier (UUID)
Webhook endpoint URL
Webhook description
Events this webhook is subscribed to
Webhook status:
active, paused, disabledNumber of consecutive delivery failures
ISO 8601 creation timestamp
ISO 8601 last update timestamp
Success Response
{
"success": true,
"message": "Webhook updated successfully",
"data": {
"id": "770e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/webhooks/daya",
"description": "Order notifications",
"events": ["order.filled", "trade.executed"],
"status": "active",
"failure_count": 0,
"last_success_at": "2024-01-15T10:30:00Z",
"last_failure_at": null,
"last_failure_reason": null,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T12:00:00Z"
},
"timestamp": "2024-01-15T12:00:00Z"
}
Error Responses
{
"success": false,
"message": "Validation error",
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid status. Allowed values: active, paused"
}
}
{
"success": false,
"message": "Validation error",
"error": {
"code": "VALIDATION_ERROR",
"message": "URL must be a valid HTTPS URL"
}
}
{
"success": false,
"message": "Webhook not found",
"error": {
"code": "WEBHOOK_NOT_FOUND",
"message": "No webhook found with the specified ID"
}
}
{
"success": false,
"message": "Unauthorized",
"error": {
"code": "API_KEY_INVALID",
"message": "The provided API key is invalid"
}
}
Rate Limits
- 100 requests per minute per API key
Next Steps
Delete Webhook
Delete a webhook
Rotate Secret
Generate a new signing secret
⌘I