Sphere Paysphere
Webhook

Create Webhook

POST
/v1/webhook

Authorization

AuthorizationRequiredBearer <token>

In: header

Request Body

application/jsonOptional
nameRequiredstring

A name or identifier of the webhook.

Maximum length: 500
descriptionstring

A description of the webhook purpose and event's subscribed.

Maximum length: 500
urlRequiredstring

The HTTP URL endpoint that SpherePay will send notifications of event to.

Format: "uri"
eventsRequiredarray<string>

The names of the events that the webhook will listen for. All events are listed under here. Use '*' to listen to all events.

curl -X POST "https://api.sandbox.spherepay.co/v1/webhook" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example Webhook",
    "description": "An example webhook",
    "url": "https://webhook.site/e0459019-e68f-446f-9eb0-b96ead041430",
    "events": [
      "*"
    ]
  }'

OK

{
  "ok": true,
  "object": "object",
  "statusCode": 200,
  "error": null,
  "message": "success",
  "data": {
    "webhook": {
      "id": "webhook_868e8a70c8f24aed9e56405429790307",
      "name": "Example Webhook",
      "description": "An example webhook",
      "active": true,
      "deliveryRate": "1",
      "status": "healthy",
      "events": [
        "customer.create",
        "customer.update",
        "customer.tos.pending",
        "customer.tos.successful",
        "customer.kyc.successful",
        "bankAccount.create",
        "wallet.create"
      ],
      "url": "https://webhook.site/b14a90e9-42b6-4f99-b9f3-371538104646",
      "secret": "secret_9e0c4371b49a4662ba91d232297f5873",
      "updated": "2025-04-10T21:21:33.705Z",
      "created": "2025-04-10T21:21:33.705Z"
    }
  },
  "ts": "2025-04-10T21:21:33.718Z",
  "request": "request_64985247b39345a6914813bab01c09b7"
}