---
title: "Zapier"
description: "Connect Quire to Zapier with webhooks and the REST API."
image: "https://docs.quirelms.com/og.png"
---

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

# Zapier

<span id="zapier"></span>

Zapier connects to Quire through the same REST API, OAuth clients and
webhooks every integration uses. There is no Quire-specific code on either
side, so anything the [API reference](https://docs.quirelms.com/api/) offers, a Zap can do.

## Start a Zap when something happens in Quire <!--quire:start-a-zap-when-something-happens-in-quire-->

1. In Zapier, choose **Webhooks by Zapier** as the trigger, with the event
   **Catch Raw Hook**. Raw, because the signature is computed over the exact
   bytes Quire sent. Copy the address Zapier gives you.
2. In Quire, open `/admin/webhooks`, choose **Add subscription**, paste the
   address, and pick the events, for example `course_completion.changed`.
   Quire sends a test event first; the subscription starts once Zapier has
   received it.
3. Add a **Code by Zapier** step that verifies the signature using the
   subscription secret, as shown in the
   [developer guide](/developer/#webhooks). Stop the Zap when it does not
   verify.
4. Parse the body and continue with the steps you need.

## Act in Quire from a Zap <!--quire:act-in-quire-from-a-zap-->

Use **Webhooks by Zapier** with the **Custom Request** action, or **API
Request** in an app step:

- **URL**: `https://acme.quirelms.com/api/v1/...`, for example
  `/api/v1/enrolments` to enrol someone.
- **Headers**: `Authorization: Bearer qk_live_...` with a key made at
  `/admin/integrations/api-keys` for this Zap alone, and an
  `Idempotency-Key` built from the trigger's ID, so a Zap that Zapier replays
  does not enrol the same person twice.
- **Data**: JSON, as the API reference describes.

To act as a person rather than as the organisation, register an OAuth client
at `/admin/integrations/oauth-clients` with Zapier's redirect address and use
it from a private Zapier integration.

## Example: enrol a customer when a deal closes <!--quire:example-enrol-a-customer-when-a-deal-closes-->

1. Trigger: your CRM's "deal won".
2. Custom request `PUT /api/v1/users/ext:{customer id}` with the person's
   name and email: creates the user, or updates them if they exist.
3. Custom request `POST /api/v1/enrolments` with the user and the course,
   and `Idempotency-Key: deal-{deal id}`.

Source: https://docs.quirelms.com/integrations/zapier/index.mdx
