> ## 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 Flows screen: build, publish and wire WhatsApp Flows

> Everything on the dashboard Flows screen (/flows): the Flow list, create, clone and AI generate, the JSON editor, preview link, publish, deprecate and delete, and the data_exchange endpoint panel — the number's public key (generate or import a PEM), your destination URL, the signing secret shown only once (rotate it via the API), and the endpoint_uri drift warning.

The Flows screen is where you manage the [WhatsApp Flows](https://docs.pilotstatus.com.br/concepts/flows.md) of a WhatsApp Business Account (WABA): forms that open inside the WhatsApp conversation. You create a draft, upload its JSON, preview it, publish it, and — for Flows whose screens call your backend — wire the `data_exchange` endpoint.

> [!NOTE]
>
> Flows only exist on **Meta (Cloud API) numbers**. A Flow belongs to the **WABA**, not to the number: every Meta number of the same WABA sees the same list.

## How to reach it

Click **Flows** in the left sidebar (marked **beta**), or press **H** anywhere outside a text field. The route is `/flows`.

The screen follows the number selected at the top of the dashboard:

* **Flows** is hidden from the sidebar while the selected number is not a Meta number. Select a Meta number to bring it back.
* If you open `/flows` with a non-Meta number selected, the screen says **"Flows only exist on Meta (Cloud API) numbers."** and offers no actions.
* If the number is Meta but has no WABA attached yet, the screen asks you to finish the account verification first.

There is no plan gate: the screen behaves the same on every plan.

## What you see

From top to bottom:

1. **Header** — the buttons **Create Flow** and **Generate Flow with AI** (the AI button shows only while AI is available on the platform).
2. **State** filter — **All states**, **Draft**, **Published**, **Deprecated**, **Blocked**, **Throttled**.
3. **Flow without a number** notice — only when it applies (see [below](#flow-without-a-number)).
4. **Account Flows** table — one row per Flow of the WABA.
5. A box saying **"This account has N more Flows on another number"** when your other Meta numbers sit on other WABAs, with a **See the N on …** button that switches the selected number.
6. Once you click a row: the **Clone** action, **Flow JSON**, **Flow preview**, the endpoint panel, **Endpoint traces (what we saw)**, **Publish**, and the **Danger zone**. Until you pick one, the screen says **"Pick a Flow in the list above."**

### The Flow table

| Column | What it shows |
| - | - |
| **Name** | The Flow name, with the **Meta Flow ID** underneath (or **not on Meta yet**). |
| **State** | `Draft`, `Published`, `Deprecated`, `Blocked`, `Throttled` — Meta's status. |
| **Categories** | The categories Meta uses to classify the form. |
| **JSON version** | The Flow JSON version Meta compiled. |
| **Health** | Meta's health verdict, or **not reported by Meta**. |
| **Updated at** | Last change. |

The footer reads **Showing X of Y in this WhatsApp Business account**, with **Previous** / **Next** for paging. An empty filtered list tells you to set the filter back to **All states** before concluding there is no Flow. If the list fails to load, the screen says so and offers **Try again** — that is not the same as an empty account, so do not create a duplicate.

## Actions and modals

### Create Flow

**Create Flow** opens the **Create Flow** modal:

* **Name** — placeholder *Contact form*.
* **Categories** — pick at least one: **Sign up**, **Sign in**, **Appointment booking**, **Lead generation**, **Contact us**, **Customer support**, **Survey**, **Other**.
* **Clone from** — optionally start from an existing Flow of this account, or keep **Do not clone — start empty**.

The new Flow is created at Meta as a **draft**. Upload its JSON next.

### Clone a Flow

With a Flow selected, **Clone "name"** opens the same modal titled **Clone Flow**, pre-filled from that Flow (the name gets *(copy)*). A published Flow is immutable at Meta, so cloning is how a new version starts. The clone is born a draft with a copy of the JSON; publishing it is still a separate step.

### Generate Flow with AI

**Generate Flow with AI** opens a modal of the same name. Describe the form in **What the form should do** and click **Generate**. The AI writes the Flow document, creates the draft at Meta and sends the document for Meta to compile — keep the window open while it runs.

At the end you see the Flow name, its categories, and a list of **What the AI could not put in the form**, if any. **Open the Flow** selects it. If Meta refused the generated document, the draft still exists and the document waits in the JSON box for you to fix and resend.

### Flow JSON

The **Flow JSON** section loads the document Meta holds for the selected Flow and lets you edit it:

* Toggle between **Árvore** (tree) and **Texto** (text) views; **Formatar** pretty-prints valid JSON; **Copiar** copies it. These four controls show in Portuguese in every interface language.
* **Save and validate at Meta** uploads the text exactly as typed. It does **not** publish. If Meta rejects it, you get the list: **"Validation reported N problems:"**.
* Only a **draft** takes a new JSON. On a published Flow the box is read-only — clone it and upload on the copy.

### Flow preview

**Mint preview link** asks Meta for a link that opens the Flow exactly as it will look in the conversation. It works on drafts, which makes it the last check before publishing. Once you have a link:

* **Open in a new tab** — the frame on the page may show blank because Meta refuses embedding; the tab works.
* **Mint again** reuses the live link; **Revoke this link and mint another** kills the old one.
* The link shows its expiry and **requires no login** — whoever receives it opens the Flow.

> [!WARNING]
>
> **The preview is NOT a sandbox.** Every `data_exchange` step in the preview calls **your** webhook for real, with the same body and signature as production.

### Publish

**Publish "name"…** opens the **Publish Flow** dialog. **Publishing is final: there is no way to unpublish.** Meta freezes the JSON; afterwards the Flow can only be deprecated or cloned. Type the Flow name in **Type the Flow name to confirm**, then click **Publish**. If Meta refuses, the dialog lists its validation errors.

Only a draft can be published. A `data_exchange` Flow must also have Meta pointed at us first (**Register at Meta**, below) — Meta refuses to publish it otherwise.

### Danger zone

Two different actions; one does not replace the other.

* **Deprecate Flow** — for a Flow that has left draft. It stays in the list with the answers it already received, and stops opening in new conversations. There is no way back: to have the form again, clone and publish a new version.
* **Delete permanently** — **drafts only**. Type the Flow name to confirm. It does not come back.

### Flow without a number

The **Flow without a number** notice lists Flows that still point at the endpoint of a number that was deleted. Meta keeps calling that dead address, nobody answers, and the form does not open for the customer.

Each row has **Re-point to \<number>**, which registers the endpoint of a number of this WABA that has an endpoint key. If no number has one, the notice tells you to generate a key first. The notice shows only to Owners and Admins.

## The endpoint panel (`data_exchange`)

Only needed for Flows whose screens call your backend. The full contract is in [Connect your API to a Flow](https://docs.pilotstatus.com.br/guides/flow-data-exchange.md); this section is what each part of the panel means. Pick a Meta number at the top first — the key belongs to the number.

### Key of this NUMBER

Meta keeps a **single key per number**, shared by **all** the Flows of that number. The panel shows the key state — for example **"Meta confirmed this number's key."**, **"This number has no key."**, or a **PENDING VERIFICATION** message when Meta holds a different key, none, or could not be asked.

* **Generate a new pair** — creates an RSA pair and registers the public half at Meta. When a key is already live it asks first: **"Generating a new pair REPLACES the key registered with Meta for this number."** Confirm with **Yes, generate and replace**. Every `data_exchange` Flow of that number switches to the new key at once.
* **Import an existing key** — paste **Private key (PEM) of this number** and, if it has one, **Passphrase (only if the key has one)**, then **Import key**. Importing changes nothing at Meta; we compare your key with what Meta has registered. If Meta holds a different key, the import is refused. If Meta holds none or cannot be asked, the key is kept as **PENDING VERIFICATION**.
* **See this number's public key** — expands the public key PEM.

> [!NOTE]
>
> **The passphrase is used once and then discarded.** Under the field the panel says *"The passphrase is stored, encrypted: without it we cannot open the key on later requests."* — that is not what happens. On **Import key** the passphrase opens your PEM a single time; we keep the opened private key, encrypted at rest with our own key, and the passphrase itself is not saved anywhere. You never need to type it again, and nobody can give it back to you: keep your own copy. A passphrase typed for a key that has none is simply ignored.

If the import is refused, the panel shows *"The action could not be completed (code …)"* with the code, and under it the server's explanation (in Portuguese):

| Code | Meaning |
| - | - |
| `FLOW_ENDPOINT_KEY_PASSPHRASE_REQUIRED` | The PEM is protected and the passphrase field was empty |
| `FLOW_ENDPOINT_KEY_PASSPHRASE_WRONG` | The passphrase does not open the PEM (the key itself was not judged) |
| `FLOW_ENDPOINT_KEY_PEM_INVALID` | Not a readable private-key PEM (paste the whole file, `BEGIN`/`END` lines included), not an RSA key, or an RSA key smaller than 2048 bits |
| `FLOW_ENDPOINT_KEY_IMPORT_MISMATCH` | Meta has a different public key registered for this number — nothing was stored |

### Destination of this Flow

**This Flow's endpoint URL** is **your** webhook, where we forward this Flow's `data_exchange` calls already decrypted. It is per Flow, must be `https://`, and **Save destination** stays disabled until the number has a key. Saving an empty URL clears the destination and keeps the secret.

### Signing secret — shown once

The first time you save a destination, the panel shows **"Signing secret — shown ONCE."** with a **Copy** button. Use it to verify the `x-pilot-status-signature` header on every request we forward ([how](https://docs.pilotstatus.com.br/guides/flow-data-exchange.md#the-signature)).

> [!WARNING]
>
> **Copy it before you leave the screen.** We store it encrypted and cannot show it again. On later visits the panel only says **"A signing secret already exists for this Flow. It is encrypted and cannot be read again."** Support cannot read it either.
>
> **Lost or leaked?** The dashboard has no rotate button. Send `PUT /v1/flows/{flowId}/endpoint` with `{"url": "<your url>", "rotateSecret": true}`. The response carries the new `secret`, once. The old secret stops working at once. See [Flow endpoint](https://docs.pilotstatus.com.br/api/flows.md#flow-endpoint).

### Point Meta here

Saving the URL does not tell Meta anything. **Register at Meta** writes our proxy address into the Flow's `endpoint_uri` at Meta; without it Meta refuses to publish the Flow. When Meta already points at us, the panel says **"Meta already points here. Nothing to do."** and the button becomes **Register again**.

If Meta points the Flow at someone else, you get **"Meta already points this Flow at another address."** with that address. **Take it over anyway** moves every exchange of the Flow to Pilot Status; whoever answers there stops receiving them, and Meta keeps no copy of the old value. **Cancel** leaves it alone.

### endpoint\_uri drift warning

**"Meta is not calling us for this Flow."** means the `endpoint_uri` Meta has registered is not ours. It shows **At Meta:** and **Ours:** side by side. While it lasts, the form's answers go elsewhere and nothing appears in the traces — it is not a defect of your backend. Fix it with **Register at Meta**.

What Meta has is read by an hourly sync, so a fresh change can take up to an hour to show. Other conditions appear under **Warnings about this wiring**.

### Endpoint traces (what we saw)

Every `data_exchange` call of this Flow as our proxy saw it: what we sent to your webhook, what it answered, and how long it took. The summary separates calls that **failed on your backend** from those that **had no destination configured**. Traces are kept for **24h**; **Refresh** reloads them. Successful exchanges keep metadata only, never the bodies.

## Values to copy, and where they live

| Value | Where on the screen | Shown once? | How to get it again |
| - | - | - | - |
| **Signing secret** (HMAC for `x-pilot-status-signature`) | Endpoint panel, right after the first **Save destination** | **Yes** | Not readable again. Rotate with `PUT /v1/flows/{flowId}/endpoint` + `"rotateSecret": true` |
| **Number's public key** | **See this number's public key** | No | Same place, or `GET /v1/numbers/{numberId}/flow-endpoint-key` |
| **Private key / passphrase** | Never shown — you paste them on import | — | Keep your own copy. The private key is kept encrypted and no endpoint returns it; the passphrase is not kept at all |
| **Our proxy URL** (`endpoint_uri`) | Only in the drift box, as **Ours:** | No | `GET /v1/flows/{flowId}/endpoint` → `endpointUri`. Treat it as a credential |
| **Preview link** | **Flow preview** | Until it expires | **Mint again** |
| **Meta Flow ID** | Under the name in the table | No | `GET /v1/flows` |

## Who can do it

| Action | Owner | Admin | Agent | Analyst |
| - | - | - | - | - |
| Open the screen and see the list | ✓ | ✓ | ✓ | ✓ |
| Read the Flow JSON and the traces | ✓ | ✓ | ✓ | — |
| Create, clone, AI generate, upload JSON, preview, publish, deprecate, delete | ✓ | ✓ | — | — |
| Endpoint panel (key, destination, secret, register) — reads included | ✓ | ✓ | — | — |
| **Flow without a number** notice and **Re-point** | ✓ | ✓ | — | — |

The buttons stay on screen for every role. An Agent or Analyst who clicks one gets an error, and the endpoint panel shows **"The endpoint configuration could not be read."** See [Roles and permissions](https://docs.pilotstatus.com.br/concepts/roles-and-permissions.md).

## Do it via API / MCP

Every `/v1` call uses an API key bound to a Meta number. Full reference: [Flows API](https://docs.pilotstatus.com.br/api/flows.md).

| Screen action | API | MCP tool |
| - | - | - |
| List | `GET /v1/flows` | `flows_list` |
| Create / clone | `POST /v1/flows` | `flows_create` |
| Rename / change categories (no button on this screen) | `PATCH /v1/flows/{id}` | `flows_update` |
| Save and validate JSON | `POST /v1/flows/{id}/json` | `flows_json_upload` |
| Publish | `POST /v1/flows/{id}/publish` (`"confirm": true`) | `flows_publish` |
| Deprecate | `POST /v1/flows/{id}/deprecate` | `flows_deprecate` |
| Delete a draft | `DELETE /v1/flows/{id}` | `flows_delete` |
| Number key: read / generate / import | `GET` / `POST /v1/numbers/{numberId}/flow-endpoint-key` | `flows_endpoint_key_get` / `flows_endpoint_key_rotate` (generate only) |
| Destination, signing secret, rotate secret | `GET` / `PUT /v1/flows/{id}/endpoint` | — (API only) |
| Register at Meta | `POST /v1/flows/{id}/endpoint` | — (API only) |
| Preview link | `POST /v1/flows/{id}/preview` | — |
| Traces | `GET /v1/flows/{id}/traces` | — |
| Form answers (not on this screen) | `GET /v1/flows/{id}/responses` | `flows_responses_list` |
| AI generate, **Flow without a number** re-point | Dashboard only | — |

The screen does not list form answers. They arrive on the `flow.response_received` webhook — see [Receive Flow responses](https://docs.pilotstatus.com.br/guides/flow-responses.md).

## Related

* [WhatsApp Flows concepts](https://docs.pilotstatus.com.br/concepts/flows.md)
* [Flows with live data](https://docs.pilotstatus.com.br/guides/flow-live-data.md)
* [Connect your API to a Flow](https://docs.pilotstatus.com.br/guides/flow-data-exchange.md)
* [Receive Flow responses](https://docs.pilotstatus.com.br/guides/flow-responses.md)
* [Send a dynamic Flow](https://docs.pilotstatus.com.br/guides/send-flow-dynamic.md)
* [MCP server](https://docs.pilotstatus.com.br/integrations/mcp-server.md)


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