Section 1 Official Documentation

Table Hooks & Automation

Automate emails, push notifications, and signed webhooks on table events, and dispatch background jobs via API.

Table Hooks & Automation

Table Hooks (Job Hooks) in HosteDay let you connect any table in your App's database to the three data events (insert, update, delete) to trigger automated background actions immediately with zero code.


Step 1: Create a Table Hook from the Dashboard

  1. Open your App dashboard at dash.hosteday.com.
  2. From API Workspace, open Data Manager and select your target table (for example, orders).
  3. Switch to the Job Hooks tab.
  4. Select the trigger event:
    • insert: When a new record is created.
    • update: When an existing record is updated.
    • delete: When a record is deleted.
  5. Choose one of the three supported actions below and save the hook.

The Three Supported Table Hook Actions

1. Send Formatted Email

Automatically sends an email when the event occurs, with:

  • Recipient (to): One or more email addresses.
  • Subject (subject): Email subject line.
  • Content (body / html / text): Message body supporting dynamic placeholders such as {{event}}.

2. Send Push Notification

Automatically dispatches a mobile push notification via FCM v1:

  • Automatically resolves the target user's registered device tokens (from user_id or the configured record field) or sends to a topic.
  • Supports custom Title (title), Body (body), and custom data payload.

3. Send External HTTP Request (Webhook)

Sends an HTTP request (POST, PUT, or PATCH) to your external endpoint with a JSON payload containing:

{
    "environment_id": "app-uuid",
    "event": "insert",
    "table": "orders",
    "record": {
        "id": 105,
        "status": "paid",
        "total": 250.00
    },
    "old_record": null,
    "occurred_at": "2026-11-23T10:30:00+00:00"
}

Security Headers & Signature Verification (X-Hosteday-Signature)

Every webhook request includes:

  • X-Hosteday-Event: Event name (insert, update, delete).
  • X-Hosteday-Table: Target table name.
  • X-Hosteday-Signature: HMAC-SHA256 signature formatted as sha256=<hash> (when an HMAC Secret is configured).

Example Signature Verification on Your Receiving Server (PHP / Laravel):

$rawBody = $request->getContent();
$signatureHeader = $request->header('X-Hosteday-Signature', '');
$expected = 'sha256=' . hash_hmac('sha256', $rawBody, $yourWebhookSecret);

if (! hash_equals($expected, $signatureHeader)) {
    abort(401, 'Invalid webhook signature.');
}

Next Step

To dispatch background jobs programmatically via HTTP requests from your client app or backend, continue to the next guide: