Skip to main content
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>"
}
'
{
  "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.

Authentication

X-Api-Key
string
required
Your API key with Write scope
X-Api-Key: daya_sk_YOUR_API_KEY

Path Parameters

id
string
required
Webhook ID (UUID)Example: 770e8400-e29b-41d4-a716-446655440000

Request Body

url
string
New webhook endpoint URL (must be HTTPS)
events
array
New events to subscribe toAllowed values: order.created, order.filled, order.partially_filled, order.cancelled, order.rejected, trade.executed
status
string
Webhook statusAllowed values: active, paused
description
string
New 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"]
  }'

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"
  }'

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

success
boolean
required
Indicates if the request was successful
message
string
required
Human-readable response message
data
object
required
Updated webhook object

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"
  }
}

Rate Limits

  • 100 requests per minute per API key

Next Steps

Delete Webhook

Delete a webhook

Rotate Secret

Generate a new signing secret