# Zapier, Make and n8n

> Connect Writ to automation tools with OAuth, HTTP calls and webhooks.

Source: https://usewrit.app/docs/integrations/

Zapier, Make and n8n can run your Writ APIs and react to what Writ finds. You connect them with
features they already have: an HTTP request step that calls Writ, and a webhook step that Writ
calls. For a reusable connector that each user signs in to, Writ also gives you OAuth credentials.

> **limit:** Writ has no app in the Zapier or Make directories and no n8n community node. Everything on this page uses the tools' built-in HTTP, webhook and OAuth features.

## Call Writ from a tool

-

1. **Publish the API and get a key**

On the API's **Call** tab, turn on **Publish REST endpoint** and copy the URL.
In **Developers → API Keys**, create a key for this tool that can only run workflows,
so you can revoke it on its own later.

-

2. **Add an HTTP request step**

Send a `POST` to the endpoint with the key as a Bearer token and the API's inputs as a JSON body. Map fields from earlier steps into the body.

```
Action: Webhooks by Zapier → Custom Request
Method:  POST
URL:     https://api.usewrit.app/v1/your-org/top-stories
Data:    {"limit": 3}
Headers: Authorization | Bearer wt_...
         Content-Type  | application/json
```

```
Module:       HTTP → Make a request
URL:          https://api.usewrit.app/v1/your-org/top-stories
Method:       POST
Headers:      Authorization = Bearer wt_...
Body type:    Raw, JSON (application/json)
Request content: {"limit": 3}
Parse response: Yes
```

```
Node:           HTTP Request
Method:         POST
URL:            https://api.usewrit.app/v1/your-org/top-stories
Authentication: Generic Credential Type → Header Auth
                Name: Authorization   Value: Bearer wt_...
Send Body:      JSON  {"limit": 3}
```

-

3. **Use the result**

The answer is JSON. Later steps read the collected data under `data`.

```json
{
  "success": true,
  "data": {
    "stories": [
      { "rank": 1, "title": "...", "points": 412, "url": "https://..." }
    ]
  }
}
```

The call waits until the run finishes, up to the endpoint's limit (120 seconds by default).
Automation tools often stop waiting sooner. For long runs, either send `Prefer: respond-async` and collect the result in a later step from the `status_url` it returns, or let Writ
post the result to the tool when it is ready (next section). Details: [Call your API](https://usewrit.app/docs/call).

## Trigger a tool from Writ

Each tool can give you a URL that starts a scenario when something posts to it. Point a Writ
automation at that URL and it runs whenever your trigger fires: a monitor change, a finished run,
a schedule.

-

4. **Create the catch URL in the tool**

- **Zapier**: trigger **Webhooks by Zapier → Catch Hook**, then copy the webhook URL.
- **Make**: module **Webhooks → Custom webhook**, add a webhook, then copy its address.
- **n8n**: a **Webhook** node with HTTP method `POST`; copy the production URL and activate the workflow.

-

5. **Send to it from Writ**

In **Automations**, pick your trigger, add a **Send Notification** step on
the **Outbound webhook** channel and paste the URL into **Webhook URL**.
Put the values the tool needs in the **Message** with placeholders such as `{{result.price}}`.

-

6. **Send a sample**

Fire the trigger once (for example, run the API) so the tool sees a real delivery and can map its fields.

```json
{
  "event": "notification",
  "title": "Price changed",
  "message": "Espresso machine is now 129.50",
  "context": {
    "workflow_name": "Shop prices",
    "result": { "price": 129.5, "in_stock": true }
  }
}
```

`context` carries the event's data, such as the run's result. A URL pasted into the step
is sent without a signature, so keep it private. To have deliveries signed, save the destination
with a secret; see [Schedules, triggers and webhooks](https://usewrit.app/docs/automations-webhooks).

The other direction works too: a tool can start a Writ automation by posting to its incoming
webhook. If the tool cannot compute Writ's signature, give the automation's trigger a **Friendly URL** and call it with an API key instead.

## Build a connector with OAuth

If you build a private Zapier integration, a Make custom app or an n8n OAuth2 credential for
several people, each person can sign in to Writ and approve access instead of pasting a key.
An owner or admin of the workspace creates the credentials.

-

7. **Start the application**

Open **Integrations → OAuth access**, click **Add an application** and pick **Zapier**, **Make**, **n8n** or **Your own app**.

-

8. **Paste the redirect URL**

In **OAuth redirect URLs**, paste the exact callback URL the tool shows, one per line.
Zapier shows it under Authentication → "Copy your OAuth Redirect URL". Make always uses `https://www.make.com/oauth/cb/app`, already filled in. n8n shows it on the OAuth2
credential screen.

-

9. **Choose the permissions**

Under **Permissions**, keep only what the connector needs. The preset for these tools
reads and runs workflows, reads runs, datasets and monitors, and manages triggers. People see this
list before they approve.

-

10. **Copy the credentials**

Click **Create credentials**, then copy the **Client ID**, the **Client Secret** and the **OAuth 2.0 Endpoints** into the tool. Copy the
secret right away: it is shown only once.

| Setting | Value |
| --- | --- |
| Authorization URL | https://app.usewrit.app/api/oauth/authorize |
| Token URL | https://app.usewrit.app/api/oauth/token |
| Revocation URL | https://app.usewrit.app/api/oauth/revoke |
| Grant type | Authorization code, with refresh tokens. PKCE (S256) is supported. |
| Client authentication | Client ID and secret in the request body or as HTTP Basic. |
| Scope | The permissions you chose, separated by spaces. |
| Discovery | https://api.usewrit.app/.well-known/oauth-authorization-server |

```json
{
  "access_token": "wto_...",
  "token_type": "bearer",
  "expires_in": 3600,
  "refresh_token": "wtr_...",
  "scope": "workflows:read workflows:execute runs:read datasets:read monitors:read triggers:read triggers:write"
}
```

Access tokens start with `wto_` and last one hour; refresh tokens start with `wtr_` and last 90 days. Each token can reach only the permissions that were approved.

A connector runs APIs with the token through the run route and reads the outcome from the task it
returns. Published endpoints (`/v1/your-org/...`) and `/api/v1/workflows/{id}/runs` accept API keys only.

```bash
# Start a run with the access token the tool received
curl -X POST https://api.usewrit.app/api/automation/workflows/42/run \
  -H "Authorization: Bearer wto_..." \
  -H "Content-Type: application/json" \
  -d '{"form_data": {"limit": 3}}'
# → {"task_id": 91834, ...}

# Read the result until "status" is success, failed or cancelled
curl https://api.usewrit.app/api/automation/tasks/91834 \
  -H "Authorization: Bearer wto_..."
# → {"id": 91834, "status": "success", "result_data": {"extracted_data": {...}}, ...}
```

Every authorization appears under **Integrations → OAuth access**, where you can revoke one
connection or all access for an application. More about tokens and scopes: [API keys and OAuth](https://usewrit.app/docs/authentication).

## Google Sheets

Writ has no built-in Google Sheets connection. Two simple ways to get data into a sheet:

- Download a dataset as CSV from **Outputs** and import it into Sheets.
- Have the sheet pull from your published endpoint with a short Apps Script on a timer.

```javascript
// In your sheet: Extensions → Apps Script. Save your key under
// Project Settings → Script Properties as WRIT_API_KEY.
function pullTopStories() {
  const key = PropertiesService.getScriptProperties().getProperty("WRIT_API_KEY");
  const res = UrlFetchApp.fetch("https://api.usewrit.app/v1/your-org/top-stories", {
    method: "post",
    contentType: "application/json",
    headers: { Authorization: "Bearer " + key, "Cache-Control": "max-age=600" },
    payload: JSON.stringify({ limit: 10 }),
    muteHttpExceptions: true,
  });
  const body = JSON.parse(res.getContentText());
  if (!body.success) throw new Error(body.error + ": " + (body.detail || ""));

  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Stories");
  const now = new Date();
  body.data.stories.forEach(function (s) {
    sheet.appendRow([now, s.rank, s.title, s.points, s.url]);
  });
}
```

Run it once from the editor to approve access, then add a time-driven trigger (the clock icon, **Triggers**) to run it every hour or every day. Apps Script stops waiting for a response
after a limit of its own, so this suits APIs that answer quickly; the `Cache-Control` header reuses a recent answer when the endpoint keeps results.

> **note:** Prefer pulling from the sheet over pushing to it. Writ does not follow redirects, and an Apps Script web app usually answers a webhook with one, which Writ counts as a failed delivery.

## Next

-
- [Call your API](https://usewrit.app/docs/call): Waiting, async runs, caching and errors for the HTTP step.
-
- [Schedules, triggers and webhooks](https://usewrit.app/docs/automations-webhooks): Incoming webhooks, signed deliveries and automations.
-
- [API keys and OAuth](https://usewrit.app/docs/authentication): Scopes, token lifetimes and revoking access.
-
- [Alerts and notifications](https://usewrit.app/docs/notifications): Slack, Discord and Telegram without a third-party tool.
