メインコンテンツへ移動
tablezio

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 スコープ: webhooks:read

Returns all webhook subscriptions for this restaurant.

リクエスト

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

レスポンス

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} スコープ: webhooks:read

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

パスパラメータ

idstring必須

Endpoint ID (we_…).

リクエスト

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

レスポンス

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 スコープ: webhooks:write

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

ボディパラメータ

urlstring必須

HTTPS URL that will receive POST events.

enabled_eventsstring[]任意

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

descriptionstring任意

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

リクエスト

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"
  }'

レスポンス

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} スコープ: webhooks:write

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

パスパラメータ

idstring必須

Endpoint ID.

ボディパラメータ

urlstring任意

New URL.

enabled_eventsstring[]任意

New event subscription list.

descriptionstring任意

Updated description.

is_activeboolean任意

Pause/resume deliveries.

リクエスト

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 }'

レスポンス

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 スコープ: webhooks:write

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

パスパラメータ

idstring必須

Endpoint ID.

リクエスト

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

レスポンス

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} スコープ: webhooks:write

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

パスパラメータ

idstring必須

Endpoint ID.

リクエスト

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

レスポンス

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

List supported event types

GET /v1/webhook_event_types スコープ: webhooks:read

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

リクエスト

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

レスポンス

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