For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Webhook

POST /v1/api/webhooks

Required scope: webhooks:manage


Request body

Field
Type
Required
Description

url

string

Yes

HTTPS endpoint to receive webhook events

events

string[]

Yes

Event types to subscribe to (at least one required)


Example

curl -X POST https://apipay.byastra.ai/v1/api/webhooks \
  -H "X-Api-Key: ap_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://yourapp.com/webhooks/astrapay",
    "events": ["payment.completed", "payment.canceled"]
  }'

Response 201 Created

{
  "success": true,
  "statusCode": 201,
  "data": {
    "id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "url": "https://yourapp.com/webhooks/astrapay",
    "events": ["payment.completed", "payment.canceled"],
    "active": true,
    "secret": "whsec_a1b2c3d4e5f6...",
    "created_at": "2026-03-31T12:00:00.000Z"
  }
}

Last updated