Webhook
Create Webhook
AuthorizationBearer <token>
JWT Bearer token authentication
In: header
namestring
A name or identifier of the webhook.
Length
length <= 500
description?string
A description of the webhook purpose and event's subscribed.
Length
length <= 500
urlstring
The HTTP URL endpoint that SpherePay will send notifications of event to.
Format
uri
eventsarray<string>
The names of the events that the webhook will listen for. All events are listed under here. Use '*'
to listen to all events.
Response Body
curl -X POST "https://api.sandbox.spherepay.co/v1/webhook" \
-H "Content-Type: application/json" \
-d '{
"name": "Example Webhook",
"description": "An example webhook",
"url": "https://webhook.site/e0459019-e68f-446f-9eb0-b96ead041430",
"events": [
"*"
]
}'
{
"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"
}
{
"ok": false,
"object": "error",
"statusCode": 400,
"error": {
"url": [
"String must contain at least 1 character(s)",
"Invalid url"
]
},
"message": "String must contain at least 1 character(s), Invalid url",
"data": null,
"ts": "2025-04-20T21:47:41.608Z",
"request": "request_886f5c7985734ea6b4e57411baa90e9a"
}