Webhooks endpoint¶
Manage webhooks under the https://*.recras.nl/api2/webhooks
namespace.
Permissions:
viewWebhooks
to read,editWebhooks
to create/update/delete.For the complete list of webhook event names and payload examples, see: Alpha: Webhooks.
Read¶
- GET /api2/webhooks¶
List configured webhooks
Example request:
GET /api2/webhooks HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": 1, "name": "Boeking::postInsert", "url": "https://example.com/hooks/recras", "active": true, "created_at": "2025-01-20T12:34:56+00:00", "updated_at": "2025-01-20T12:34:56+00:00" } ]
- Query Parameters:
id (integer) – Filter by webhook id
created_at< (datetime) – Return items created before this ISO 8601 datetime
created_at> (datetime) – Return items created after this ISO 8601 datetime
page (integer) – Page number (optional)
- Status Codes:
200 OK – OK
403 Forbidden – Missing
viewWebhooks
permission406 Not Acceptable – Invalid query parameter
- GET /api2/webhooks/(int: id)¶
Retrieve a single webhook
Example request:
GET /api2/webhooks/1 HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "name": "Boeking::postInsert", "url": "https://example.com/hooks/recras", "active": true, "created_at": "2025-01-20T12:34:56+00:00", "updated_at": "2025-01-20T12:34:56+00:00" }
- Status Codes:
200 OK – OK
403 Forbidden – Missing
editWebhooks
permission404 Not Found – Not found
Create¶
- POST /api2/webhooks¶
Create a webhook subscription
name
must be a valid webhook name: - A custom name listed under “Available custom webhooks (Names)” in Alpha: Webhooks. - Or a standard name in the formObjectName::EventName
whereEventName
is one ofpostInsert
,postUpdate
,postSave
,postDelete
.
Example request:
POST /api2/webhooks HTTP/1.1 Host: demo.recras.nl Content-Type: application/json Accept: application/json { "name": "Boeking::postUpdate", "url": "https://example.com/hooks/recras", "active": true }
Example response:
HTTP/1.1 201 Created Content-Type: application/json Location: /api2/webhooks/2 { "id": 2, "name": "Boeking::postUpdate", "url": "https://example.com/hooks/recras", "active": true, "created_at": "2025-01-20T12:40:03+00:00", "updated_at": "2025-01-20T12:40:03+00:00" }
- JSON Parameters:
name (string) – Required. Webhook identifier (see above)
url (string) – Required. Target URL to POST payloads to
active (boolean) – Optional (default: true). Whether deliveries are active
- Status Codes:
201 Created – Created
403 Forbidden – Missing
editWebhooks
permission406 Not Acceptable – Invalid body (unknown
name
or invalid fields)
Batch Create¶
- POST /api2/webhooks/batch¶
Create multiple webhook subscriptions in one request
Example request:
POST /api2/webhooks/batch HTTP/1.1 Host: demo.recras.nl Content-Type: application/json Accept: application/json [ { "name": "Boeking::postInsert", "url": "https://example.com/hook1" }, { "name": "InvoiceDefinitive", "url": "https://example.com/hook2", "active": false } ]
Example response:
HTTP/1.1 201 Created Content-Type: application/json []
- Status Codes:
201 Created – Created
403 Forbidden – Missing
editWebhooks
permission406 Not Acceptable – Invalid body (any item invalid)
Update¶
- PUT /api2/webhooks/(int: id)¶
Update a webhook subscription
The following fields cannot be changed:
id
,created_by
,created_at
,updated_by
,updated_at
.
Example request:
PUT /api2/webhooks/2 HTTP/1.1 Host: demo.recras.nl Content-Type: application/json Accept: application/json { "id": 2, "name": "Boeking::postSave", "url": "https://example.com/hooks/recras", "active": false }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 2, "name": "Boeking::postSave", "url": "https://example.com/hooks/recras", "active": false, "created_at": "2025-01-20T12:40:03+00:00", "updated_at": "2025-01-20T12:45:10+00:00" }
- Status Codes:
200 OK – Updated
403 Forbidden – Missing
editWebhooks
permission404 Not Found – Not found
406 Not Acceptable – Invalid body
Delete¶
- DELETE /api2/webhooks/(int: id)¶
Delete a webhook subscription
Example request:
DELETE /api2/webhooks/2 HTTP/1.1 Host: demo.recras.nl
Example response:
HTTP/1.1 200 OK
- Status Codes:
200 OK – Deleted
403 Forbidden – Missing
editWebhooks
permission404 Not Found – Not found
406 Not Acceptable – Not deletable