Saltar al contenido

Webhooks

Webhook endpoints

Manage the URLs Tablezio POSTs events to. The signing_secret is returned at creation and on rotation only — store it immediately.

List webhook endpoints

GET /v1/webhook_endpoints Scope: webhooks:read

Returns all webhook subscriptions for this restaurant.

Request

curl https://api.tablezio.com/v1/webhook_endpoints -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "list", "data": [ /* webhook_endpoint without signing_secret */ ], "has_more": false, "next_cursor": null, "previous_cursor": null, "url": "/v1/webhook_endpoints" }

Retrieve a webhook endpoint

GET /v1/webhook_endpoints/{id} Scope: webhooks:read

Fetch a single endpoint. The signing_secret is omitted — it's only returned on creation and rotation.

Path parameters

idstringRequired

Endpoint ID (we_…).

Request

curl https://api.tablezio.com/v1/webhook_endpoints/we_… -H 'X-API-Key: tbz_…'

Response

application/json
{
  "id": "we_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "webhook_endpoint",
  "created": 1716730000,
  "updated": 1716730000,
  "url": "https://example.com/webhooks/tablezio",
  "enabled_events": ["order.created", "reservation.created"],
  "description": "Production handler",
  "is_active": true,
  "success_count": 1240,
  "failure_count": 3,
  "last_success_at": 1716730000,
  "last_failure_at": 1716729000,
  "last_failure_message": null
}

Create a webhook endpoint

POST /v1/webhook_endpoints Scope: webhooks:write

Registers a new URL to receive events. The response includes the signing_secret — store it now; it's never shown again.

Body parameters

urlstringRequired

HTTPS URL that will receive POST events.

enabled_eventsstring[]Optional

Event types to subscribe to. Use ["*"] for all. Default ["*"].

descriptionstringOptional

Internal description (e.g. "production handler").

Request

curl -X POST https://api.tablezio.com/v1/webhook_endpoints \
  -H 'X-API-Key: tbz_…' -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com/webhooks/tablezio",
    "enabled_events": ["order.created", "order.cancelled"],
    "description": "Production handler"
  }'

Response

application/json
{
  "id": "we_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "webhook_endpoint",
  "created": 1716730000,
  "updated": 1716730000,
  "url": "https://example.com/webhooks/tablezio",
  "enabled_events": ["order.created", "reservation.created"],
  "description": "Production handler",
  "is_active": true,
  "success_count": 1240,
  "failure_count": 3,
  "last_success_at": 1716730000,
  "last_failure_at": 1716729000,
  "last_failure_message": null,
  "signing_secret": "whsec_8b2c3d…"   // returned only on create + rotate
}

Update a webhook endpoint

PATCH /v1/webhook_endpoints/{id} Scope: webhooks:write

Edit the URL, subscribed events, description, or active state.

Path parameters

idstringRequired

Endpoint ID.

Body parameters

urlstringOptional

New URL.

enabled_eventsstring[]Optional

New event subscription list.

descriptionstringOptional

Updated description.

is_activebooleanOptional

Pause/resume deliveries.

Request

curl -X PATCH https://api.tablezio.com/v1/webhook_endpoints/we_… \
  -H 'X-API-Key: tbz_…' -H 'Content-Type: application/json' \
  -d '{ "is_active": false }'

Response

application/json
{
  "id": "we_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "webhook_endpoint",
  "created": 1716730000,
  "updated": 1716730000,
  "url": "https://example.com/webhooks/tablezio",
  "enabled_events": ["order.created", "reservation.created"],
  "description": "Production handler",
  "is_active": true,
  "success_count": 1240,
  "failure_count": 3,
  "last_success_at": 1716730000,
  "last_failure_at": 1716729000,
  "last_failure_message": null
}

Rotate the signing secret

POST /v1/webhook_endpoints/{id}/rotate_secret Scope: webhooks:write

Generates a new signing_secret. Old signatures stop verifying immediately, so be ready to deploy the new secret in lock-step.

Path parameters

idstringRequired

Endpoint ID.

Request

curl -X POST https://api.tablezio.com/v1/webhook_endpoints/we_…/rotate_secret -H 'X-API-Key: tbz_…'

Response

application/json
{
  "id": "we_8b2c3d4e5f6a7b8c9d0e1f20",
  "object": "webhook_endpoint",
  "created": 1716730000,
  "updated": 1716730000,
  "url": "https://example.com/webhooks/tablezio",
  "enabled_events": ["order.created", "reservation.created"],
  "description": "Production handler",
  "is_active": true,
  "success_count": 1240,
  "failure_count": 3,
  "last_success_at": 1716730000,
  "last_failure_at": 1716729000,
  "last_failure_message": null,
  "signing_secret": "whsec_8b2c3d…"   // returned only on create + rotate
}

Delete a webhook endpoint

DELETE /v1/webhook_endpoints/{id} Scope: webhooks:write

Permanently removes the subscription. In-flight retries continue but no new events fire.

Path parameters

idstringRequired

Endpoint ID.

Request

curl -X DELETE https://api.tablezio.com/v1/webhook_endpoints/we_… -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "webhook_endpoint", "id": "we_…", "deleted": true }

List supported event types

GET /v1/webhook_event_types Scope: webhooks:read

Returns every event type the API can emit. Useful for building a subscription UI.

Request

curl https://api.tablezio.com/v1/webhook_event_types -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "list", "data": [ { "object": "event_type", "type": "*" }, { "object": "event_type", "type": "order.created" }, … ], "has_more": false, "next_cursor": null, "previous_cursor": null }