Create Webhook
POST /v1/webhook_endpoints
Overview
Creates a new webhook endpoint to receive event notifications. This endpoint registers a URL to which events will be sent.
Authorization
- Header:
Authorization: Bearer sk_test_907...de66
Request Details
Request
- cURL
curl https://api-prod.paybytoken.io/v1/webhook_endpoints \
-X POST \
-H "Authorization: Bearer sk_test_907...de66" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhook"
}'
Request Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | The URL where webhook events will be sent (e.g., https://example.com/webhook). |
Response Details
Response
The response returns a WebhookEndpoint object containing details about the created webhook endpoint. See Webhook Overview for the full object definition.
Example Response
- Success
{
"id": "we_1ZbSVMF8KXuhmXpKPXkt",
"account_id": "acct_1",
"url": "https://example.com/webhook",
"enabled_events": [],
"description": null,
"secret": "whsec_67f8c3677abd4063da64ca3b11f1fe87",
"metadata": {},
"status": "enabled",
"created_at": "2025-09-05T14:32:30.000Z",
"updated_at": "2025-09-05T14:32:30.000Z"
}