# Zapier

> Remember what arrives in your Zaps, from forms, email and CRMs, and ask your memory from any Zap, with Webhooks by Zapier.

Connect Geniffy to the apps in your Zaps with **Webhooks by Zapier**: one step remembers what a trigger
brings in, and another asks what is known. Webhooks by Zapier isn't on Zapier's Free plan.

## Before you start

- **A key for Zapier.** Make one under **API keys** in the Geniffy app and call it `Zapier`, so you can
  revoke it on its own. Anyone who can edit the Zap can read it.
- **A space for each person.** To keep a memory for each customer, send a `space` named after them, such
  as `customer_1042`. A space name uses letters, digits, dots, dashes and underscores, so use an id rather
  than an email address. Leave `space` out to use your own memory.

## Remember what a trigger brings in

Add an action step with **Webhooks by Zapier** and the event **POST**, and fill it in:

| Field | Key | Value |
| --- | --- | --- |
| URL | | `https://api.geniffy.com/v1/memories` |
| Payload Type | | `json` |
| Data | `text` | The words to remember, mapped from your trigger |
| Data | `title` | What to call it in the Geniffy app (optional) |
| Data | `space` | One of your users, such as `customer_1042` (optional) |
| Headers | `Authorization` | `Bearer gnf_live_...`, with your key |

Test the step. Geniffy answers with the `source` it made, and learns from it within a few seconds.

## Ask what is known

Add another **Webhooks by Zapier** step with the event **POST**:

| Field | Key | Value |
| --- | --- | --- |
| URL | | `https://api.geniffy.com/v1/ask` |
| Payload Type | | `json` |
| Data | `question` | The question, typed in or mapped from your trigger |
| Data | `space` | The same space you remember into (optional) |
| Headers | `Authorization` | `Bearer gnf_live_...`, with your key |

The step returns `answer`, or no answer and a `message` saying that nothing remembered supports one. Map
`answer` into the steps after it. To go on only when there is an answer, add **Filter by Zapier** with
`Answer` and the condition **Exists**.

## Give an AI step what is known

To put what is known in front of an AI step, POST to `https://api.geniffy.com/v1/context` with `question`
set to the message the AI step will answer, and the same `space`. Map the `context` it returns into the
instructions or system message of the AI step that follows. When nothing is known, `context` says so in
one sentence, so the AI step doesn't guess.

## Ideas

- A new form response: remember the answers in that customer's space.
- A new email from a customer: give an AI step what is known about them, and draft the reply.
- A call note saved in your CRM: remember it, then ask before the next call what was promised.

Source: https://docs.geniffy.com/integrations/zapier
