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

# GET /v1/conversations: listar conversaciones

> Lista las conversaciones del número conectado, ordenadas por la actividad de mensajes más reciente.

Lista las conversaciones del número conectado, ordenadas por la actividad de mensajes más reciente (`lastMessageAt` descendente; las conversaciones sin ese valor van al final).

## Endpoint

`GET https://pilotstatus.com.br/v1/conversations`

> [!NOTE]
>
> Actúa sobre **un número**: usa una API key **con alcance de número** (`ps_*`) en el header `x-api-key` (o `x-api-key-id`), o una clave de toda la cuenta que indique el número en el header [`x-whatsapp-number-id`](https://docs.pilotstatus.com.br/es/api/authentication). Una clave de toda la cuenta sin ese header recibe `403 TENANT_SCOPE_NOT_ALLOWED`.
>
> **Los tokens OAuth / MCP y las claves de cuenta** (`ps_account_`) también necesitan el permiso `chat:read` (roles `AGENT`, `ADMIN`, `OWNER`); el rol `ANALYST` se rechaza con `403 PERMISSION_DENIED`. Una clave `ps_` clásica no se ve afectada por los roles.

## Parámetros de consulta

**startDate** `string`

Fecha y hora ISO 8601. Filtra las conversaciones cuyo último mensaje es **igual o posterior** a esta fecha.

**endDate** `string`

Fecha y hora ISO 8601. Filtra las conversaciones cuyo último mensaje es **igual o anterior** a esta fecha.

**page** `integer` (default: 1)

Número de página (≥ 1).

**pageSize** `integer` (default: 30)

Resultados por página (1–100).

`startDate` y `endDate` son opcionales por separado. Cuando se envían, cada uno debe ser un string ISO 8601 válido y `startDate` no puede ser posterior a `endDate`; de lo contrario se devuelve `400 INVALID_DATE_RANGE`.

## Efecto del modo PII

La respuesta depende del **modo PII** configurado para el número, que se cambia en el panel en la página API Keys (panel Privacy & retention) o en la configuración del número en Numbers:

| Modo PII | Efecto |
| - | - |
| `STORE_INDEFINITE` (predeterminado) | Se devuelven todas las conversaciones (sujetas a los filtros de fecha). |
| `STORE_X_DAYS` | Las conversaciones se devuelven completas: la retención se aplica **por mensaje** en los endpoints de mensajes, no a la fila de la conversación, así que su contacto y `lastMessagePreview` se mantienen. |
| `RELAY_ONLY` | Las conversaciones **sí** se devuelven (no es una lista vacía), pero cada fila está **ocultada** (`redacted: true`, identidad del contacto y vista previa del último mensaje en `null`). La respuesta incluye un campo `notice: "PII_RELAY_ONLY"`. |

## Ejemplo

```bash cURL theme={null}
curl "https://pilotstatus.com.br/v1/conversations?startDate=2026-06-01T00:00:00Z&page=1&pageSize=20" \
  -H "x-api-key: ps_your_key_here"
```

```json Respuesta (200) theme={null}
{
  "conversations": [
    {
      "id": "conv_abc123",
      "whatsappNumberId": "cmnum_01",
      "from": "+5511999999999",
      "type": "DIRECT",
      "fromName": "John Doe",
      "peerLid": null,
      "userId": "BR.13491208655302741918",
      "username": null,
      "profilePicUrl": null,
      "lastMessagePreview": "Thanks!",
      "lastDirection": "INBOUND",
      "unreadCount": 2,
      "lastMessageAt": "2026-06-27T10:15:00.000Z",
      "lastInboundAt": "2026-06-27T10:15:00.000Z",
      "createdAt": "2026-06-01T09:00:00.000Z",
      "updatedAt": "2026-06-27T10:15:00.200Z"
    },
    {
      "id": "conv_def456",
      "whatsappNumberId": "cmnum_01",
      "from": null,
      "type": "GROUP",
      "fromName": "Team Chat",
      "peerLid": null,
      "userId": null,
      "username": null,
      "profilePicUrl": null,
      "lastMessagePreview": "See you at 10am",
      "lastDirection": "OUTBOUND",
      "unreadCount": 0,
      "lastMessageAt": "2026-06-27T09:45:00.000Z",
      "lastInboundAt": "2026-06-27T09:40:00.000Z",
      "createdAt": "2026-06-10T14:00:00.000Z",
      "updatedAt": "2026-06-27T09:45:00.100Z"
    }
  ],
  "total": 45,
  "page": 1,
  "pageSize": 20,
  "totalPages": 3
}
```

```json RELAY_ONLY (200) theme={null}
{
  "conversations": [
    {
      "id": "conv_abc123",
      "whatsappNumberId": "cmnum_01",
      "from": null,
      "type": "DIRECT",
      "fromName": null,
      "peerLid": null,
      "userId": null,
      "username": null,
      "profilePicUrl": null,
      "lastMessagePreview": null,
      "lastDirection": "INBOUND",
      "unreadCount": 2,
      "lastMessageAt": "2026-06-27T10:15:00.000Z",
      "lastInboundAt": "2026-06-27T10:15:00.000Z",
      "createdAt": "2026-06-01T09:00:00.000Z",
      "updatedAt": "2026-06-27T10:15:00.200Z",
      "redacted": true
    }
  ],
  "total": 45,
  "page": 1,
  "pageSize": 30,
  "totalPages": 2,
  "notice": "PII_RELAY_ONLY"
}
```

## Campos del objeto conversación

**id** `string` *required*

ID de la conversación en Pilot Status.

**whatsappNumberId** `string` *required*

El número al que pertenece la conversación.

**type** `string` *required*

`"DIRECT"`, `"GROUP"` o `"NEWSLETTER"`.

**from** `string | null`

Teléfono del contacto en E.164 (con `+`) para personas; `null` para grupos/newsletters, para contactos sin teléfono (solo lid o solo username) y cuando está ocultado.

**fromName** `string | null`

Nombre visible del contacto o del grupo, cuando está disponible.

**peerLid** `string | null`

LID de WhatsApp del contacto, cuando se conoce.

**userId** `string | null`

Business-Scoped User ID (BSUID) de Meta: la clave duradera de un contacto de Meta. Está presente incluso cuando `from` es `null` (un contacto que usa un username), y se acepta como `destinationNumber` en [`POST /v1/messages/send`](https://docs.pilotstatus.com.br/es/api/messages/send).

**username** `string | null`

El username de WhatsApp del contacto, cuando se conoce.

**profilePicUrl** `string | null`

URL de la foto de perfil, cuando se conoce.

**lastMessagePreview** `string | null`

Vista previa breve del último mensaje.

**lastDirection** `string | null`

`INBOUND` u `OUTBOUND`: dirección del último mensaje.

**unreadCount** `integer` *required*

Mensajes entrantes no leídos de la conversación: el contador detrás de [`GET /v1/messages/unread`](https://docs.pilotstatus.com.br/es/api/messages/unread).

**lastMessageAt** `string | null`

ISO 8601: última actividad de mensajes. Las conversaciones sin este valor se ordenan al final.

**lastInboundAt** `string | null`

ISO 8601: último mensaje recibido del contacto (desde donde cuenta la ventana de servicio de 24 horas).

**createdAt** `string` *required*

ISO 8601: cuándo se creó la conversación por primera vez.

**updatedAt** `string` *required*

ISO 8601: última actualización del registro de la conversación.

**redacted** `boolean`

Presente (`true`) solo en una conversación ocultada: `from`, `fromName`, `peerLid`, `userId`, `username`, `profilePicUrl` y `lastMessagePreview` son `null`.

## Errores comunes

* `400 INVALID_DATE_RANGE`: `startDate` o `endDate` no es un string ISO 8601 válido, o `startDate > endDate`.
* `400 INVALID_PAGINATION`: `page × pageSize` mayor que `10000`.
* `400 NUMBER_NOT_FOUND`: la credencial no indica ningún número de WhatsApp.
* `401`: credencial ausente o inválida (`{"error": "Invalid API key"}`).
* `403 TENANT_SCOPE_NOT_ALLOWED`: una clave de toda la cuenta sin `x-whatsapp-number-id`.
* `403 PERMISSION_DENIED`: token OAuth/MCP o clave de cuenta cuyo rol no tiene `chat:read` (`ANALYST`).

Pruébalo en el Playground: [Listar conversaciones](https://docs.pilotstatus.com.br/es/playground/conversations/list-conversations.md).


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