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

> ## Agent Instructions
> Integrating Pilot Status end to end? Follow https://docs.pilotstatus.com.br/guides/integrate-with-ai.md (pt-BR: https://docs.pilotstatus.com.br/pt-BR/guides/integrate-with-ai.md). No step requires contacting support: every credential is shown in the dashboard or in an API response, and a lost one is regenerated, not recovered.
> Webhook signing secret: shown ONCE in the Signing secret window right after creating the webhook on /webhooks, and in the `secret` field of the POST /v1/webhooks response (MCP: webhooks_create). Lost it: Edit Webhook → Generate a new secret, POST /v1/webhooks/{id}/rotate-secret, or webhooks_rotate_secret (the old one stops working at once). Verify `x-pilot-status-signature` = hex HMAC-SHA256 of the raw request body keyed with that secret.
> Meta verify token (number connected with the user's own Meta app credentials): Meta Number Created! window after connecting, then the number's card on Numbers (workspace Owner), or webhook.verifyToken in the POST /v1/numbers/meta response. It is not the webhook signing secret.
> REST auth: `x-api-key: ps_...` header, never Authorization: Bearer. MCP: https://mcp.pilotstatus.com.br/mcp (148 tools, OAuth 2.1 or x-api-key); Code Mode: https://mcp.pilotstatus.com.br/code. Destructive MCP tools return a preview and a confirm_token: show the preview and call again only after the user's explicit yes. Over OAuth, revealing or creating ps_ API keys is workspace Owner only.

# The Chatwoot screen in the Pilot Status dashboard

> Connect the selected number to Chatwoot (instance URL, account ID, agent access token), test credentials, pause mirroring, reconnect, switch channel mode, sync history and disconnect. For native WhatsApp Cloud inboxes the screen also shows the setup kit: Phone number ID, WABA ID, the number's ps_ API key (revealable by the Owner), Base URL, Webhook URL and a Rails console snippet.

The **Chatwoot** screen connects **one WhatsApp number at a time** to a Chatwoot account. Once connected, WhatsApp conversations show up in a Chatwoot inbox and agent replies go back out on WhatsApp. The screen subtitle reads *Connect this number to a Chatwoot instance for bidirectional support.*

This page describes the screen: what each button and modal does. For the integration itself (prerequisites like `FRONTEND_URL` and `WHATSAPP_CLOUD_BASE_URL`, how templates and Flow answers behave in Chatwoot, what agents see), read [Chatwoot integration](https://docs.pilotstatus.com.br/integrations/chatwoot.md). For native voice calls, read [Chatwoot Voice Calls](https://docs.pilotstatus.com.br/integrations/chatwoot-voice.md).

## How to get there

Sidebar → **Chatwoot** (path `/chatwoot`; keyboard shortcut `g`).

The screen works on the number picked in the **number selector** in the header. You need a connected number to use it. To set up Chatwoot for another number, switch numbers in the header. Each number has its own integration.

If the screen cannot load the integration, it shows *Failed to load the Chatwoot integration.*

## Who can use it

| Role | What they get |
| - | - |
| **Owner** | Everything. In the native setup kit, the number's `ps_` API key shows masked (`••••••••` plus the last 4 characters) with **reveal** and **copy** buttons. |
| **Admin** | Everything except the full key: in the native setup kit the **API key** field shows it masked (`••••••••` plus the last 4 characters), with no reveal or copy button, and the note *Only the workspace owner can reveal the full key.* |
| **Agent**, **Analyst** | The screen is hidden from the sidebar and the route is blocked. Every action on it (reading the status included) requires the `integrations:manage` permission, and the server refuses the calls for these roles. |

## Before connecting: the setup form

When the number has no integration yet, the screen shows **Connect this number to your Chatwoot**. The page says it takes about 2 minutes and needs three things from your Chatwoot account: **Chatwoot address**, **Account ID** and **Access token**. Each step gets a check mark once it is filled in.

| Field | What to type |
| - | - |
| **Your Chatwoot address** | The address you see in the browser when you use Chatwoot, with nothing after the domain (for example `https://chatwoot.your-domain.com` or `https://app.chatwoot.com`). It must be a full URL, with `https://`. A trailing slash is removed. |
| **Your account ID** | The number in the Chatwoot URL right after `/accounts/` (the screen shows the example `…/app/accounts/1/dashboard`). |
| **Access token** | In Chatwoot: your avatar → **Profile** → **Access Tokens**. The eye button shows or hides what you typed. After you type the address and the account ID, the link **Open the tokens page in my Chatwoot** opens `<address>/app/accounts/<id>/profile/settings` directly. |

If the address is **not** `app.chatwoot.com`, a notice says it looks like a self-hosted Chatwoot. It asks you to confirm the `FRONTEND_URL` variable on your instance before connecting, because without it the inbox is rejected. See [the prerequisite](https://docs.pilotstatus.com.br/integrations/chatwoot.md).

Buttons:

* **Test credentials**: a dry run. It checks the values against your Chatwoot **without creating or changing anything**. You get a checklist with two lines, green or red: whether the account accepted the credentials, and whether the token can access the account. The two line labels are shown in Portuguese (*Credenciais aceitas pela conta*, *Permissão de acesso à conta*). When everything passes: **All good — you can connect.** Editing any field clears the result. If you leave the token blank and the number already has a stored token, the test uses the stored one.
* **Connect Chatwoot**: creates the inbox in your Chatwoot and the webhook back to Pilot Status. You never paste a webhook URL by hand. The button is highlighted after a passing test, but you can click it without testing first.
* **Advanced options** — *channel mode, native voice (most people don't need to touch this)*: opens the **Channel mode** selector (see below).

Messages you may see:

* **Instance URL and Account ID are required** or **Access token is required**: a field is empty. The token is only required when the number has no stored token. With one stored, a blank token field keeps it.
* *Enter the Chatwoot access token — there is no saved token for this number.*: the server's version of the message above.
* *Invalid Chatwoot credentials. Check instance URL, account ID and access token.*: Chatwoot refused the token, the account ID is wrong, or the address did not answer.
* *Invalid request body* (on **Test credentials**): the address is not a full URL (for example it is missing `https://`). On **Connect Chatwoot**, the browser itself flags the field instead.
* *Chatwoot instance URL refused*: the address points, or redirects, to an internal or private network address. Use the public address of your Chatwoot. This message comes in English and Portuguese, separated by `|`.
* *Couldn't create the inbox in Chatwoot. Check the token permissions and Account ID.*
* *Your Chatwoot rejected the WhatsApp Cloud channel …*: only in native mode. Set `WHATSAPP_CLOUD_BASE_URL` on your Chatwoot to the Pilot Status layer address and connect again.
* *We couldn't reach your Chatwoot to check the existing inbox. Nothing was changed — try again in a moment.*

> [!NOTE]
>
> The access token is **never shown back**, on this screen or in any API response. Pilot Status only tells you whether a token is stored. To change it, type a new one under **Update credentials**.

## Channel mode

The **Channel mode** selector (with a **Which one to choose?** guide of scenarios and warnings) has three options:

* **Automatic (recommended)**: we pick the mode by number. Official goes native, non-official goes to the mirror.
* **API mirror (Model A)**: Pilot Status mirrors messages and media into Chatwoot. Chat only. Works on a shared Chatwoot.
* **Native WhatsApp Cloud (Model B)**: Chatwoot talks to Meta directly through the Pilot Status layer. Enables voice and calling. Requires a dedicated Chatwoot. This option is only offered when the number is eligible for a native inbox: official Meta numbers, or Pilot Status web numbers on the Evolution GO provider (voice only).

On an Evolution GO web number, **Automatic** always uses the API mirror: the native voice inbox is only created when you pick **Native WhatsApp Cloud** yourself. If the native inbox cannot be prepared (for example the number has no `ps_` API key), the connection falls back to an API mirror inbox.

The trade-offs are explained in [Channel mode: API mirror vs native Cloud](https://docs.pilotstatus.com.br/integrations/chatwoot.md#channel-mode-api-mirror-vs-native-cloud).

## After connecting

### Status header

The screen header shows a badge with the integration state: **Connected**, **Error** or **Disconnected**. A green card reads *All set — your conversations are mirroring to inbox #…*, followed by *New WhatsApp messages show up in Chatwoot; agent replies go back to WhatsApp.* The **Open inbox in Chatwoot** link opens your Chatwoot account dashboard.

### When the integration falls into an error state

If a connection, a credentials update or a reconnect fails at your Chatwoot (rejected credentials, inbox not created, Chatwoot not reachable), or if Chatwoot starts refusing the stored token while mirroring, the integration goes into an error state. The header badge reads **Error**, and a red panel replaces the connected view:

* *The Chatwoot connection failed — nothing is being mirrored right now.*, followed by the reason in plain words and the raw error below it. Without a reason from Chatwoot: *Chatwoot did not report a reason.*
* **Try again**: runs the connection again with the stored credentials and keeps the current inbox, like **Reconnect**.
* **Disconnect**: opens the same **Disconnect Chatwoot?** dialog as the connected view.

Below the panel, the **Sync history to Chatwoot** card stays available while mirroring is on, so you can follow, cancel or retry a sync. Then comes the setup form, with the address and account ID pre-filled, to fix the credentials. Leave the token blank to keep the stored one, or type a new one, and click **Connect Chatwoot**.

### Update credentials

A collapsible **Update credentials** section holds the same fields (**Instance URL**, **Account ID**, **Access token (agent)**) with the current address and account ID filled in, plus the **Channel mode** selector. The token field says **•••••••• (leave blank to keep)**. Leave it blank to keep the stored token. Click **Update** to save. Saving runs the connection again with the new values and the mode selected in the form. When the existing inbox still exists in Chatwoot and the mode keeps the same kind of inbox, that inbox is reused. Otherwise a new inbox is created and the number's conversation mappings are reset, as with **Reconnect**: new messages open new conversations in the new inbox.

### Mirroring

The **Mirroring** switch (**Active** / **Paused**) pauses or resumes the integration. *Paused = we stop sending to Chatwoot; no message is lost.* Nothing is deleted.

If the last mirroring attempt failed while the integration stays connected, a **Last error** box shows a readable explanation and the raw error below it. Common cases:

* The conversation or inbox was deleted in Chatwoot (it is recreated automatically; if it persists, use **Reconnect**).
* Failed to sync with Chatwoot (try again or use **Reconnect**).

A token that loses access to the account does not show here: it puts the integration in the error state described above.

### Connection details

A read-only block:

* **Inbox**: the Chatwoot inbox ID.
* **Account**: the account ID.
* **Instance URL**.
* **Token**: **Stored** or **Missing**. The value itself is never shown.
* **Last sync**: relative time; hover for the exact time.

### Maintenance: reconnect and disconnect

* **Reconnect** runs the connection again with the stored credentials, without re-entering them. *Reconnect re-tests the saved credentials and keeps the current inbox — it only creates another one if it was deleted in Chatwoot.* A new inbox is also created when the saved mode now needs a different kind of inbox.
* **Disconnect** opens the **Disconnect Chatwoot?** dialog: *This deletes the inbox in Chatwoot. Open conversations don't migrate.* Confirm with **Disconnect**. The dashboard asks Chatwoot to delete the inbox, removes the native webhook if there is one, and clears the stored credentials. If Chatwoot does not accept the inbox deletion (for example the token no longer has access), the integration is still removed and the inbox stays in Chatwoot for you to delete there.

### Change channel mode

**Change channel mode — now: …** shows the saved mode and the same selector. After you pick a different mode, the **Switch mode → …** button applies it. *Applies the new mode and reconnects. If the channel type changes (API mirror ↔ native WhatsApp Cloud), Chatwoot gets a new inbox and the old one stops receiving messages; open conversations don't migrate and history isn't copied on its own. If the channel type stays the same, the current inbox is kept.* For example, **Automatic** → **API mirror** on a non-official number keeps the existing inbox. To bring past messages into a new inbox, use **Sync history to Chatwoot**. Pick the mode before connecting when you can.

### Sync history to Chatwoot

This card is shown while mirroring is **Active**, also when the integration is in the error state. *Replays this number's already-stored messages into the Chatwoot inbox so agents can see the recent history.* Its main use is coexistence Meta numbers, whose imported history appears in **/chat** but is not mirrored on its own.

The server refuses the sync, and the reason appears inline on the card, when:

* the number is not a Meta number (*Only Meta numbers have importable history.*);
* the number is not a coexistence number (*This number is not a coexistence number, so there is no stored history to send.*);
* Chatwoot is not connected and enabled for the number (*Connect Chatwoot for this number before sending history.*);
* the number does not store message content (*This number does not store content (RELAY\_ONLY), so there is no history to send.*).

These refusals come in Portuguese and English, separated by `/`.

Click **Sync** to open the **Sync history to Chatwoot?** dialog. It lists three things to expect:

* Messages are inserted at import time, and the original date and time are prefixed into each message body.
* Old media may not import (Meta references expire) and shows as "\[mídia]".
* Agents may get a burst of notifications, and conversations may reopen.

Options in the dialog:

* **Window**: **30 days** or **90 days**.
* **Mark read when done**: on by default.

Confirm with **Sync**. Only one sync runs per number at a time: if one is already running, the card simply follows it. While it runs, the card shows **Queued…** or **Syncing…**, a `done / total` counter, a progress bar and a **Cancel** button. When it finishes, you see one of these:

* **N messages synced**, and the **Sync** button again.
* A summary like `N sent · N failed · N media expired`, plus the error and a **Try again** button.
* **Canceled**, plus a **Try again** button. A canceled run shows no error line, also when it was canceled before it started.

**Try again** starts a new run right away, without the dialog. It reuses the **window** of the run that ended (a 90-day run is retried as 90 days, even after a page reload). **Mark read when done** follows the dialog's current choice (on, after a reload). Running it again is safe: only messages that never landed are posted again.

With a **native WhatsApp Cloud** inbox, the sync only replays messages you **received** (not the ones you sent), **Mark read when done** has no effect, and audio and sticker messages arrive without the date prefix.

Details: [Send history to Chatwoot](https://docs.pilotstatus.com.br/integrations/chatwoot.md#send-history-to-chatwoot).

### Native Chatwoot / Voice: the native setup kit

For eligible numbers, while the integration is connected, a **Native Chatwoot / Voice** card appears. On official numbers it reads *native messages + voice via Chatwoot*. On Evolution GO web numbers it reads *native voice via Chatwoot (messages go through mirroring)*. A badge shows whether the inbox currently is **Native** or **Legacy (API)**.

*The native inbox is created automatically on connect. The values below are informational.* Each value has a copy button:

| Value | What it is |
| - | - |
| **Phone** | The number in E.164 format with `+`. |
| **Phone number ID** | The Meta phone number ID. Evolution GO numbers get a synthetic ID used only for voice. |
| **WhatsApp Business Account ID** | The WABA ID (synthetic for Evolution GO numbers). |
| **API key** | The number's **`ps_` API key**, which a native `whatsapp_cloud` inbox uses as its channel API key. The **Owner** sees it masked (`••••••••` plus the last 4 characters) and can **reveal** and copy it. Everyone else sees the same masked value, with no buttons, and the note *Only the workspace owner can reveal the full key.* It reads **unavailable** only when the number has no `ps_` key. This is the same key managed on the [API Keys screen](https://docs.pilotstatus.com.br/dashboard/api-keys.md). Regenerating it there breaks the native inbox until you paste the new key into Chatwoot. |
| **Base URL** | The Pilot Status Meta layer address (`https://<your Pilot Status host>/api/layer/meta`). This is the value for `WHATSAPP_CLOUD_BASE_URL` on your Chatwoot. |
| **Webhook URL** | `<your Chatwoot address>/webhooks/whatsapp/+<number>`. Shows *connect to generate* until the integration exists. |

Actions on the card:

* **Test configuration**: a server-side self-check. It uses the number's `ps_` key to call the layer's `/{phoneId}/settings` and `/{phoneId}/call_permissions` endpoints (the same ones Chatwoot calls) and lists each check (`settings`, `call_permissions`) in green or red. If the number has no `ps_` key, the test fails with *Native voice is not available for this number*.
* **View documentation**: opens [Chatwoot Voice Calls](https://docs.pilotstatus.com.br/integrations/chatwoot-voice.md).
* **Manual setup (fallback)**: a collapsible box with a Rails console snippet to copy. You only need it if the inbox was created by hand in Chatwoot. It turns on calling for that channel:

  ```ruby theme={null}
  ch = Channel::Whatsapp.find_by(phone_number: "+<number>")
  ch.update!(provider_config: ch.provider_config.merge("calling_enabled" => true))
  ch.inbox.reauthorized!
  ```

## Do it via API / MCP

| Screen action | Public API | MCP tool |
| - | - | - |
| See the status | [`GET /v1/chatwoot`](https://docs.pilotstatus.com.br/playground/chatwoot/chatwoot-status) | `chatwoot_get` |
| Connect | [`POST /v1/chatwoot`](https://docs.pilotstatus.com.br/playground/chatwoot/connect-chatwoot) | `chatwoot_connect` |
| Update credentials, pause or resume mirroring, reconnect, switch mode | [`PATCH /v1/chatwoot`](https://docs.pilotstatus.com.br/playground/chatwoot/update-chatwoot) | `chatwoot_update` |
| Disconnect | [`DELETE /v1/chatwoot`](https://docs.pilotstatus.com.br/playground/chatwoot/disconnect-chatwoot). Pass `?deleteInbox=true` to also delete the inbox, as the dashboard does. | `chatwoot_disconnect` |
| Test credentials | [`POST /v1/chatwoot/test`](https://docs.pilotstatus.com.br/playground/chatwoot/test-chatwoot-credentials) | `chatwoot_test` |
| Sync history (start, progress, cancel) | `POST`, `GET`, `DELETE` on `/v1/chatwoot/history-sync` | `chatwoot_history_replay`, `chatwoot_history_replay_get`, `chatwoot_history_replay_cancel` |
| Native setup kit and **Test configuration** (voice self-check) | Dashboard only. The public API does not return the kit, because it would expose the `ps_` key. To get the key, see [API keys](https://docs.pilotstatus.com.br/api/api-keys.md). | — |

With a number-scoped API key, the number comes from the key. With a workspace key or OAuth, send the number in the `x-whatsapp-number-id` header. The API never returns the Chatwoot access token, only `hasToken`.

## Related

* [Chatwoot integration](https://docs.pilotstatus.com.br/integrations/chatwoot.md): prerequisites, modes, templates, Flow answers, what agents see.
* [Chatwoot Voice Calls](https://docs.pilotstatus.com.br/integrations/chatwoot-voice.md).
* [API Keys screen](https://docs.pilotstatus.com.br/dashboard/api-keys.md): where the number's `ps_` key is managed and regenerated.
* [Live Chat](https://docs.pilotstatus.com.br/dashboard/live-chat.md).


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