Skip to main content
PUT
https://api.swiftpay.cx
/
api
/
webhooks
/
:id
# Update URL and events
curl -X PUT https://api.swiftpay.cx/api/webhooks/wh_abc123 \
  -H "Authorization: Bearer mp_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://new-url.yoursite.com/webhooks",
    "events": ["checkout.completed", "refund.completed"]
  }'

# Disable endpoint

curl -X PUT https://api.swiftpay.cx/api/webhooks/wh_abc123 \
 -H "Authorization: Bearer mp_live_your_api_key" \
 -H "Content-Type: application/json" \
 -d '{"isActive": false}'

{
  "success": true,
  "data": {
    "id": "wh_abc123",
    "url": "https://new-url.yoursite.com/webhooks",
    "events": [
      "checkout.completed",
      "refund.completed"
    ],
    "isActive": true,
    "description": "Production webhook handler",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-20T14:00:00Z"
  }
}

Update Webhook Endpoint

Updates the configuration of an existing webhook endpoint.

Request

Authorization
string
required
Bearer token with your API key
id
string
required
The unique identifier of the webhook endpoint
url
string
Updated HTTPS URL for webhook delivery
events
array
Updated array of event types to subscribe to
isActive
boolean
Enable or disable the endpoint
description
string
Updated description

Response

success
boolean
Whether the request was successful
data
object
Updated webhook endpoint object
# Update URL and events
curl -X PUT https://api.swiftpay.cx/api/webhooks/wh_abc123 \
  -H "Authorization: Bearer mp_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://new-url.yoursite.com/webhooks",
    "events": ["checkout.completed", "refund.completed"]
  }'

# Disable endpoint

curl -X PUT https://api.swiftpay.cx/api/webhooks/wh_abc123 \
 -H "Authorization: Bearer mp_live_your_api_key" \
 -H "Content-Type: application/json" \
 -d '{"isActive": false}'

{
  "success": true,
  "data": {
    "id": "wh_abc123",
    "url": "https://new-url.yoursite.com/webhooks",
    "events": [
      "checkout.completed",
      "refund.completed"
    ],
    "isActive": true,
    "description": "Production webhook handler",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-20T14:00:00Z"
  }
}

Common Updates

Disable an Endpoint

{ "isActive": false }

Add Events

{
   "events": [
      "checkout.completed",
      "checkout.failed",
      "refund.completed",
      "refund.failed"
   ]
}

Subscribe to All Events

{
   "events": ["*"]
}
Updating an endpoint does not change the signing secret. The original secret remains valid.