# Zapier

Instant triggers (no polling delay) and actions with your Ogave SMS API key.

## Set up {#setup}

1. In Zapier, add the **Ogave SMS** app and connect it with an API key from **Portal › Developers › API keys**. Use a `test_` key while you build the Zap: messages are simulated, never sent and never charged.
2. Pick a trigger. Zapier subscribes a REST hook for you (you will see it in **Portal › Integrations**) and removes it when the Zap is turned off.
3. Pick an action, map the fields, test, publish the Zap.

## Triggers {#triggers}

| Trigger | Event |
| --- | --- |
| Message Delivered | `message.delivered` |
| Link Clicked | `message.clicked` |
| New Inbound Message | `message.inbound` |
| Contact Opted Out | `contact.opted_out` |

Fields arrive flat: the event's `data` plus `event`, `event_id` and `mode`. See [Events](https://app.ogave.co/docs/integrations#events).

## Actions {#actions}

| Action | API |
| --- | --- |
| Send SMS | `POST /v1/messages` (links shortened and tracked by default; idempotent per Zap run) |
| Add or Update Contact | `POST /v1/contacts` (list chosen from a dropdown) |

## Ideas {#examples}

- New Typeform / Google Form entry → Add or Update Contact → Send SMS (welcome).
- New Inbound Message → Slack message to the sales channel.
- Contact Opted Out → update the CRM or mailing tool.
- Link Clicked → add a tag in your CRM.

## For developers {#dev}

The Zapier CLI app lives in the repository under `integrations/zapier/` (authentication, 4 hook triggers + a hidden list trigger, 2 actions). `npm install && npm test` validates it against the Zapier schema offline; `zapier push` (with a Zapier developer account) uploads it. Set `API_URL` to test against a sandbox.
