POST
/api/v1/webhooks/subscriptions
Auth: Bearer token
Create Subscription
Creates a webhook subscription for selected event types.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | HTTPS destination for webhook deliveries. |
| event | string | No | Single event key (legacy payload format from Postman). |
| events | string[] | No | List of event keys to subscribe to. |
Example response
<?php
return [
'success' => true,
'data' => [
'subscription_id' => 'wh_22',
'status' => 'active',
'url' => 'https://example.com/webhooks/pickndrop',
'events' => [
'shipment.created',
'booking.updated'
],
'createdAt' => '2026-02-17T10:45:00Z'
]
];
Request examples
curl -X POST \
"https://api.spaces.za.com/api/v1/webhooks/subscriptions" \
-H "Authorization: Bearer <token>" \\
-H "Content-Type: application/json" \\
--data '{
"url": "https://example.com/webhooks/pickndrop",
"event": "shipment.updated",
"events": [
"shipment.created",
"booking.updated"
]
}'