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

# Plain

> Connect your Plain workspace so Sazabi can manage a webhook target for the support event types you select.

[All Plain integration capabilities](https://docs.sazabi.com/catalogs/integrations/plain)

## About

Plain delivers customer support events — threads, customers, labels, comments, and more — to Sazabi through webhook targets. Connecting your Plain workspace lets Sazabi create and manage a single webhook target subscribed to the event types you choose.

Plain also has a **Send to an endpoint** path where you create the webhook target yourself in Plain. See [Plain endpoint page](https://docs.sazabi.com/catalogs/log-sources/send-to-an-endpoint/plain.md) for that setup.

## Prerequisites

* A Plain workspace.
* A Plain machine user API key with these permissions:
  * `webhookTarget:create`
  * `webhookTarget:edit`
  * `webhookTarget:delete`
  * `webhookTarget:read`
  * `subscriptionEventTypes:read`

Workspace read access is included with every key.

## Set up in the dashboard

**Step 1**

### Create a machine user API key

In your Plain workspace, go to **Settings > Machine users** (at `app.plain.com/workspace/<your-org-id>/settings/machine-users`) and create a machine user API key with the five permissions listed in Prerequisites.

**Step 2**

### Connect in Sazabi

Go to [**Settings > Log streams**](https://app.sazabi.com/settings/log-source-providers), click **Add source**, and select **Plain**. Enter your Plain API key (format: `plainApiKey_...`) and click **Connect**. Sazabi validates the key and confirms the workspace name.

**Step 3**

### Add log streams

After the connection is confirmed, click **Add log stream** to open the event type picker. Sazabi lists all subscribable Plain event types. Select the event types you want to forward.

Sazabi consolidates your selections into a single Plain webhook target — Plain allows a maximum of 25 webhook targets per workspace, so Sazabi manages one target that covers all selected event types.

## Set up with the CLI

You can also connect the Plain log source with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Create a native connection by passing your machine user API key as metadata:

```bash theme={"system"}
sazabi log-sources create plain --mode native \
  --metadata '{"plainApiKey":"'"$PLAIN_API_KEY"'"}'
```

Use a machine user key with the same permissions as the dashboard flow. Sazabi validates it against the Plain API and creates the log source; note the log source ID it prints.

Add a log stream with `sazabi log-streams create`, listing the Plain event types you want to subscribe to in `--config` (use the exact event type IDs from your Plain workspace):

```bash theme={"system"}
sazabi log-streams create --log-source-id <log-source-id> \
  --config '{"eventTypes":["<event type>","<event type>"]}'
```

Run `sazabi log-sources list` to confirm the source and its streams.

## Verify

Trigger a subscribed event in Plain — for example create or update a thread, add a label, or post a comment.

Open the [Intake page](https://docs.sazabi.com/guides/instrument/intake.md) in the Sazabi dashboard and confirm that records attributed to the **Plain** source appear. Events typically arrive within one to two minutes of Plain delivering the webhook.

## Troubleshooting

**"Plain returned no subscribable event types"** — Confirm the API key has the `subscriptionEventTypes:read` permission. Without it, Sazabi cannot list event types and the picker appears empty.

**Token validation fails** — Confirm the key format starts with `plainApiKey_` and that it has all five required permissions. A key missing any one of `webhookTarget:create`, `webhookTarget:edit`, `webhookTarget:delete`, `webhookTarget:read`, or `subscriptionEventTypes:read` will fail validation.

**Events stop arriving** — The webhook target may have been deleted or disabled in Plain, or the API key may have been revoked. Reconnect from [**Settings > Log streams**](https://app.sazabi.com/settings/log-source-providers) in Sazabi to reprovision the target.

**Only some event types are received** — Review the event type selection in the Sazabi log stream settings and confirm that all intended event types are selected in the consolidated webhook target.

## Further reading

> [card] [Intake](https://docs.sazabi.com/guides/instrument/intake.md)
>
> See per-source ingestion volume and health in the Intake page.

> [card] [Plain (send to an endpoint)](https://docs.sazabi.com/catalogs/log-sources/send-to-an-endpoint/plain.md)
>
> Create a Plain webhook target yourself and point it at Sazabi.

> [card] [Log sources](https://docs.sazabi.com/catalogs/log-sources.md)
>
> Browse the full log source catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.