> ## 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.

# WhatsApp Stories (Status) API

> Publish, read and delete WhatsApp stories (status) from the connected number.

A **story** (called *status* inside WhatsApp) is a text, image or video post that your number's contacts see in the **Updates** tab for **24 hours**. Pilot Status publishes it from the **same WhatsApp number** tied to your API key, as `POST /v1/messages/send` does.

> [!WARNING]
>
> Stories are available on **Evolution GO** numbers only. A Meta Cloud API number answers `400 NOT_SUPPORTED_FOR_META` (the Cloud API has no stories), and an unofficial number on any other session (e.g. Evolution v2) answers `400 NOT_SUPPORTED_FOR_PROVIDER`.

## How a story works

* **Who sees it.** Send `recipients` (phone numbers in E.164 without `+`, or JIDs) and only those contacts receive it. Leave it out and the phone's own **status privacy** setting decides (*My contacts*, *My contacts except…*, *Only share with…*).
* **Nobody in the privacy list.** The story is still published and charged: it shows only on your own devices, and `GET /v1/stories/{id}` returns `recipientCount: 0`.
* **24 hours.** WhatsApp removes the story 24 hours after it was sent. You can delete it earlier with `DELETE /v1/stories/{id}`; after 24 hours the answer is `410 STORY_EXPIRED`.
* **Charging.** Each story counts as **1 message** in your plan once it is sent, whatever the number of recipients. Deleting is free.
* **Where it shows.** A story is not a conversation: it does not appear in the inbox, but it is listed in `GET /v1/messages` and in the message log, and fires the usual `message.sent` / `message.failed` webhooks with `type: "story"`.
* **Delivery and read receipts are best effort.** `SENT` is the guaranteed state. A story may move to `DELIVERED` or `READ` when WhatsApp forwards the receipt to the connected session, but for stories it often does not: the view is recorded on the main phone ("My status" shows who saw it) and the receipt may never reach the API. Do not build logic or alerts that wait for `READ` on a story.

## Publish a story

`POST https://pilotstatus.com.br/v1/stories`

Answers **`202`** with the story queued: `{ "id", "status": "QUEUED", "type", "recipients": "explicit" | "privacy", "deliverAt" }` (`deliverAt` is `null` when the story goes out right away). Send an `Idempotency-Key` header to retry safely: the same key returns the same `id`.

| Field | Type | Rules |
| - | - | - |
| `type` | string | **Required.** `text`, `image` or `video`. |
| `text` | string | Required when `type` is `text`. 1–700 characters. |
| `backgroundColor` | string | `text` only. `#RRGGBB` or `#AARRGGBB`. Default `#128C7E` (WhatsApp green). |
| `textColor` | string | `text` only. `#RRGGBB` or `#AARRGGBB`. See [Colors](#colors). |
| `font` | string | `text` only. A font **name** from [Fonts](#fonts). Default `system`. A number is refused. |
| `mediaUrl` | string | Required when `type` is `image` or `video`. A public `https` URL — the only way to pass media (there is no `mediaId`). Up to **100 MiB**. |
| `caption` | string | `image` / `video` only. Up to 1024 characters. |
| `recipients` | string\[] | Optional. Phone numbers (E.164 without `+`) or JIDs; duplicates are removed. **1 to 5000** items — more than 5000 answers `400 VALIDATION_ERROR`. Left out → the phone's status privacy. |
| `deliverAt` | string | Optional. ISO-8601 date-time to publish the story later. See [Schedule a story](#schedule-a-story). |

Unknown fields are refused with `400 VALIDATION_ERROR`.

### Colors

| You send | Background | Text |
| - | - | - |
| neither | `#128C7E` | `#FFFFFF` |
| only `backgroundColor` | yours | `#FFFFFF` or `#000000`, whichever contrasts more with your background |
| only `textColor` | `#128C7E` | yours |
| both | yours | yours — contrast is **not** checked |

The alpha of the background is ignored when picking the contrasting text color.

### Fonts

`system` (default), `system_text`, `script`, `system_bold`, `morningbreeze`, `calistoga`, `exo2`, `courier`.

### Media

* **Images and videos** only; audio stories are not supported.
* Pilot Status downloads `mediaUrl` and uploads it to WhatsApp. The limit is **100 MiB**, the same as for media messages.
* **WebP** images are converted to JPEG before publishing.

## Schedule a story

Send `deliverAt` to publish the story at a later time. It follows the same rules as `deliverAt` on [sending a message](https://docs.pilotstatus.com.br/api/messages/send.md):

* ISO-8601 with a time zone, e.g. `2026-11-12T10:00:00-03:00`; it is stored in UTC. Without a zone it is read as UTC.
* A time in the past, or now, publishes right away.
* An invalid value answers `400 VALIDATION_ERROR` with `details.deliverAt: ["Invalid datetime"]`.
* The story stays `QUEUED` until then, and `GET /v1/stories/{id}` returns its `deliverAt`.
* `mediaUrl` is downloaded **at publish time**, not when you schedule. If the URL is gone by then, the story fails and you get `message.failed`.
* It is charged (1 message) only when it goes out. A canceled story is not charged.

To cancel, call `DELETE /v1/stories/{id}` while the story is still `QUEUED` and its `deliverAt` is in the future. See [Delete a story](#delete-a-story).

```bash theme={null}
curl -X POST https://pilotstatus.com.br/v1/stories \
  -H "x-api-key: ps_number_..." \
  -H "Content-Type: application/json" \
  -d '{ "type": "text", "text": "Opening at 10!", "deliverAt": "2026-11-12T10:00:00-03:00" }'
```

```json theme={null}
{ "id": "cm3story0002", "status": "QUEUED", "type": "text", "recipients": "privacy", "deliverAt": "2026-11-12T13:00:00.000Z" }
```

## Read a story

`GET https://pilotstatus.com.br/v1/stories/{id}`

```json theme={null}
{
  "id": "cm3story0001",
  "type": "image",
  "status": "SENT",
  "caption": "New collection",
  "recipientsMode": "explicit",
  "recipientCount": 2,
  "recipients": ["5511999999999", "5521988887777"],
  "deliverAt": null,
  "createdAt": "2026-11-10T14:00:00.000Z",
  "sentAt": "2026-11-10T14:00:03.000Z",
  "revokedAt": null,
  "errorMessage": null,
  "errorCode": null
}
```

A story that failed carries the reason and its code, with the same rules as `errorMessage` and `errorCode` on [`GET /v1/messages/{id}`](https://docs.pilotstatus.com.br/api/messages/read): `errorMessage` is the public text (English and Portuguese separated by `|`, no internal detail) and `errorCode` is a stable code. Both are `null` when the story did not fail.

```json theme={null}
{
  "id": "cm3story0003",
  "type": "image",
  "status": "FAILED",
  "errorMessage": "The story media could not be downloaded | Não foi possível baixar a mídia do story",
  "errorCode": "MEDIA_DOWNLOAD_FAILED"
}
```

* `recipients` is the **effective** list of who received the story, without your own number: the one you sent (`recipientsMode: "explicit"`) or the one the phone's privacy produced (`"privacy"`). It is `null` while the story is `QUEUED`.
* Recipients are third-party data and follow the same retention as message content: outside the retention window, `recipients` is `null` and `redacted: true`; `recipientCount` stays.
* The id must belong to the credential's number; an id from another number, or a message that is not a story, answers `404`.

## Delete a story

`DELETE https://pilotstatus.com.br/v1/stories/{id}`

* **Scheduled and not due yet** (`QUEUED` with a future `deliverAt`): cancels it. Answers **`200`** with `{ "id", "canceledAt" }`; the story becomes `CANCELED`, is never published and is not charged.
* **`QUEUED` and already due** (it is being published): `409 STORY_NOT_REVOCABLE` with its `status`. Try again once it is `SENT`.
* **Sent:** removes the story from the phones of everyone who received it (the same effective list as the send, even if the privacy setting changed since).
* Only a story already sent (`status` `SENT`, `DELIVERED`, `READ` or `PLAYED`) and not yet deleted; otherwise `409 STORY_NOT_REVOCABLE`. More than 24 hours after `sentAt` → `410 STORY_EXPIRED`.
* Answers **`200`** with `{ "id", "revokedAt" }`. It is not charged and creates no new message.

## Authentication

Same rules as [sending a message](https://docs.pilotstatus.com.br/api/messages/send.md): a **number key** (`ps_number_`) acts on its own number; a workspace key, an account key (with `x-workspace-id`) or an OAuth token must name the number in `x-whatsapp-number-id`. With an account key or an OAuth token, publishing and deleting need the `messages:send` permission (**AGENT**, **ADMIN** or **OWNER**) and reading needs `logs:read:content`. See [Authentication](https://docs.pilotstatus.com.br/api/authentication.md).

## Errors

Error messages are bilingual (`English | Portuguese`).

| Status | `code` | When |
| - | - | - |
| `400` | `NUMBER_NOT_FOUND` | The credential is not tied to a number. |
| `400` | `NOT_SUPPORTED_FOR_META` | The number is a Meta Cloud API number. |
| `400` | `NOT_SUPPORTED_FOR_PROVIDER` | The number's session is not Evolution GO (e.g. Evolution v2). |
| `400` | `VALIDATION_ERROR` | Invalid body; `details` lists each field. |
| `402` / `429` | same codes as [sending a message](https://docs.pilotstatus.com.br/api/messages/send.md) | Plan limit reached. |
| `403` | `PERMISSION_DENIED` | The credential's role lacks the permission. |
| `404` | — | The story does not exist for this number. |
| `409` | `WHATSAPP_INSTANCE_NOT_CONNECTED` | The session is not connected. |
| `409` | `STORY_NOT_REVOCABLE` | Delete on a story that is being published (`QUEUED` and due), failed, canceled or already deleted. |
| `410` | `STORY_EXPIRED` | Delete more than 24 hours after the story was sent. |

## Examples

```bash cURL theme={null}
curl -X POST "https://pilotstatus.com.br/v1/stories" \
  -H "x-api-key: ps_number_your_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: promo-2026-11-10" \
  -d '{
    "type": "text",
    "text": "Sale today!",
    "backgroundColor": "#25D366",
    "font": "calistoga",
    "recipients": ["5511999999999"]
  }'
```

```typescript Node theme={null}
import { PilotStatusClient } from "@pilot-status/sdk";

const client = new PilotStatusClient({ apiKey: process.env.PILOT_STATUS_API_KEY! });

const story = await client.stories.create({
  type: "image",
  mediaUrl: "https://example.com/collection.jpg",
  caption: "New collection",
});

const details = await client.stories.get(story.id);
await client.stories.delete(story.id);
```

```python Python theme={null}
import os
from pilot_status import PilotStatusClient

client = PilotStatusClient(api_key=os.environ["PILOT_STATUS_API_KEY"])

story = client.stories.create({
    "type": "video",
    "mediaUrl": "https://example.com/teaser.mp4",
    "caption": "Coming soon",
    "recipients": ["5511999999999", "5521988887777"],
})

details = client.stories.get(story["id"])
client.stories.delete(story["id"])
```

```json Response (202) theme={null}
{ "id": "cm3story0001", "status": "QUEUED", "type": "text", "recipients": "explicit" }
```

## MCP

The [MCP server](https://docs.pilotstatus.com.br/integrations/mcp-server.md) exposes the same operations as `stories_send`, `story_get` and `story_delete`.


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