Skip to main content

Update Webhook

PATCH /v1/webhook_endpoints/:id

Overview

Updates the details of a specific webhook endpoint using its unique identifier. This endpoint allows modification of the webhook URL.

Authorization

  • Header: Authorization: Bearer sk_test_907...de66
Request Details

Request

curl https://api-prod.paybytoken.io/v1/webhook_endpoints/we_1ZbSVMF8KXuhmXpKPXkt \
-X PATCH \
-H "Authorization: Bearer sk_test_907...de66" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhook2"
}'

Request Parameters

ParameterTypeDescription
idstringUnique identifier of the webhook endpoint (e.g., we_1ZbSVMF8KXuhmXpKPXkt).
urlstringThe new URL where webhook events will be sent (e.g., https://example.com/webhook2).
Response Details

Response

The response returns a WebhookEndpoint object containing the updated details of the webhook endpoint.

Example Response

{
"id": "we_1ZbSVMF8KXuhmXpKPXkt",
"account_id": "acct_1",
"url": "https://example.com/webhook2",
"enabled_events": [],
"description": null,
"secret": "whsec_67f8c3677abd4063da64ca3b11f1fe87",
"metadata": {},
"status": "enabled",
"created_at": "2025-09-05T14:32:30.000Z",
"updated_at": "2025-09-05T14:36:42.000Z"
}