# Zapier (/integrations/zapier)

Send new feedback to Linear, Jira, a spreadsheet or anywhere else Zapier reaches. A [webhook](/integrations/webhooks/) starts the Zap; the REST API lets a Zap reply to a comment or resolve it.

<Callout>
  Zapier's **Webhooks by Zapier** is a premium app: it needs a paid Zapier plan.
</Callout>

## Start a Zap from new comments [#start-a-zap-from-new-comments]

<Steps>

1. In Zapier, create a Zap. For the trigger, pick **Webhooks by Zapier** → **Catch Hook** and copy the webhook URL it shows.

2. In the Annoty dashboard, open the project → **Integrations** → **Add** → **Webhook**. Paste the URL, name it "Zapier" and pick its events: **Comments → New** to start with.

3. Open the webhook's **⋯** menu → **Send test event**.

4. Back in Zapier, **Test trigger**. The sample comment shows up with every field to map.

5. Add a **Filter** step that continues only if `test` is false, so test events stay out of your tools.

6. Add your action, say **Linear** → **Create Issue**, and map the fields.

</Steps>

Fields worth mapping:

| Field                          | What it is                                       |
| ------------------------------ | ------------------------------------------------ |
| `data.comment.body`            | The comment                                      |
| `data.comment.number`          | The pin number reviewers see                     |
| `data.comment.pagePath`        | The page it's on                                 |
| `data.comment.authorName`      | Who wrote it                                     |
| `feedbackSession.label`        | The feedback session's name                      |
| `feedbackSession.dashboardUrl` | The feedback session in the dashboard            |
| `feedbackSession.proxyUrl`     | Its proxy link, for a link straight to the pages |

[Webhooks](/integrations/webhooks/) lists every event and field.

## Reply or resolve from a Zap [#reply-or-resolve-from-a-zap]

Create an API key in the dashboard (**Settings → API keys**) with **View**, **Reply** and **Resolve** under **Comments**. Then add a **Webhooks by Zapier** → **Custom Request** step:

| To      | Method  | URL                                                                                            | Data                        |
| ------- | ------- | ---------------------------------------------------------------------------------------------- | --------------------------- |
| Reply   | `POST`  | `https://api.annoty.app/v1/feedback-sessions/{feedbackSessionId}/comments/{commentId}/replies` | `{"body": "Thanks, on it"}` |
| Resolve | `PATCH` | `https://api.annoty.app/v1/feedback-sessions/{feedbackSessionId}/comments/{commentId}`         | `{"status": "resolved"}`    |

Map `feedbackSessionId` and `data.comment.id` from the trigger into the URL, and add the headers `Authorization: Bearer your_api_key_here` and `Content-Type: application/json`. The reply shows up on the reviewer's page right away, under the key's name.
