> ## Documentation Index
> Fetch the complete documentation index at: https://docs.offboard.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Zapier

> Connect Offboard.tech to 8,000+ apps with the Zapier app — triggers for finished interviews, weekly reports, and abnormal churn alerts.

Offboard.tech ships an official Zapier app with three triggers for completed exit interviews, weekly summary reports, and abnormal churn spike alerts. Zaps subscribe via REST hooks — events are pushed in real time, no polling.

## Setup

### 1. Generate an API key

**Dashboard → Settings → Zapier → Generate.**

The key is shown **once** — copy it and store it somewhere safe. Regenerating overwrites (revokes) the old key; Revoke disables Zapier access entirely.

### 2. Connect in Zapier

1. Create a Zap and choose the **Offboard.tech** app.
2. When prompted for credentials, paste your API key.
3. Zapier verifies the key against your workspace — the connection label shows your workspace name.

### 3. Pick a trigger

| Trigger                  | Fires when                                                                                                                                   |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **Interview Finished**   | An exit interview reaches a terminal state — `interview.completed`, `interview.saved`, or `interview.abandoned`                              |
| **Weekly Report**        | The Monday 09:00 UTC weekly summary is generated (`interview.weekly_report`)                                                                 |
| **Abnormal Churn Alert** | Finished interviews in the last 24h exceed 2× the rolling 7-day daily average (with a 5-interview volume floor) — `interview.abnormal_churn` |

## Trigger Output

Every trigger emits the same `WebhookPayload` shape documented in [Webhooks](/docs/webhooks), plus an `id` field Zapier uses for dedup (equal to `metadata.event_id`):

```typescript theme={null}
interface TriggerItem {
  id: string  // = metadata.event_id — stable idempotency key
  event:
    | 'interview.completed'
    | 'interview.saved'
    | 'interview.abandoned'
    | 'interview.weekly_report'
    | 'interview.abnormal_churn'
  workspace_id: string
  workspace_name: string
  interview_id: string | null  // null for aggregate events
  status: 'completed' | 'saved' | 'abandoned'
  sentiment: 'positive' | 'neutral' | 'negative' | null
  summary: string | null  // PII-scrubbed summary
  metadata: {
    // URL params from the magic link, plus:
    event_id: string
    aggregate?: object  // weekly report summary, or { finished_24h, daily_avg }
    [key: string]: unknown
  }
  created_at: string  // ISO 8601 timestamp
}
```

### Interview Finished — sample

```json theme={null}
{
  "id": "int_xyz789:webhook:completed",
  "event": "interview.completed",
  "workspace_id": "ws_abc123",
  "workspace_name": "Acme Inc",
  "interview_id": "int_xyz789",
  "status": "completed",
  "sentiment": "neutral",
  "summary": "Customer is leaving because the service is too expensive compared to competitors.",
  "metadata": { "plan": "pro", "val": "99", "event_id": "int_xyz789:webhook:completed" },
  "created_at": "2026-02-22T10:30:00Z"
}
```

### Weekly Report — sample

```json theme={null}
{
  "id": "ws_abc123:webhook:weekly:2026-02-16",
  "event": "interview.weekly_report",
  "workspace_id": "ws_abc123",
  "workspace_name": "Acme Inc",
  "interview_id": null,
  "status": "completed",
  "sentiment": null,
  "summary": null,
  "metadata": {
    "event_id": "ws_abc123:webhook:weekly:2026-02-16",
    "aggregate": {
      "period_start": "2026-02-09T00:00:00Z",
      "loads": 41,
      "engaged": 33,
      "finished": 28,
      "saved": 7,
      "sentiments": { "positive": 8, "neutral": 12, "negative": 8 }
    }
  },
  "created_at": "2026-02-23T09:00:00Z"
}
```

### Abnormal Churn — sample

```json theme={null}
{
  "id": "ws_abc123:webhook:abnormal:2026-02-22",
  "event": "interview.abnormal_churn",
  "workspace_id": "ws_abc123",
  "workspace_name": "Acme Inc",
  "interview_id": null,
  "status": "completed",
  "sentiment": null,
  "summary": null,
  "metadata": {
    "event_id": "ws_abc123:webhook:abnormal:2026-02-22",
    "aggregate": { "finished_24h": 9, "daily_avg": 3.1 }
  },
  "created_at": "2026-02-22T09:00:00Z"
}
```

## Delivery Semantics

| Behavior               | Detail                                                                                                                               |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Delivery               | **At-least-once** — if any delivery in a fan-out fails, the whole event retries and already-delivered subscriptions may see a repeat |
| Dedup                  | `metadata.event_id` / `id` is a stable idempotency key — Zapier dedupes on `id` automatically                                        |
| Signing                | Zapier trigger deliveries are **unsigned** (signature headers only apply to your own `webhookUrl` endpoint)                          |
| Multiple subscriptions | An event fans out to your `webhookUrl` (if configured) **and** every matching Zapier subscription                                    |

<Note>
  Abnormal Churn has no historical sample until the first alert fires — during Zap setup the editor falls back to the built-in sample. This is expected.
</Note>

## REST Hook API (for custom integrations)

The Zapier app is a thin client over a public hook-management API — you can drive it directly if you don't use Zapier:

```bash theme={null}
# Subscribe
curl -X POST https://offboard.tech/api/zapier/hooks \
  -H 'x-api-key: obk_…' -H 'content-type: application/json' \
  -d '{"trigger_key": "interview_finished", "target_url": "https://yourapp.com/hook"}'
# → {"id": "<hook-uuid>"}  (idempotent — same target_url returns existing id)

# List recent items (setup-time samples)
curl 'https://offboard.tech/api/zapier/list?trigger=interview_finished' \
  -H 'x-api-key: obk_…'

# Unsubscribe
curl -X DELETE https://offboard.tech/api/zapier/hooks/<hook-uuid> \
  -H 'x-api-key: obk_…'
```

Valid `trigger_key` values: `interview_finished`, `weekly_report`, `abnormal_churn`. Target URLs must be `https://` and pass the same SSRF rules as webhooks (no private IPs, localhost, or internal hostnames).
