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

# Obtener mensaje

> Devuelve el estado y las marcas de tiempo de un mensaje. `{id}` puede ser el id interno del mensaje, el correlationId o el id del mensaje del proveedor (wamid de Meta). Incluye externalMessageId, status, destinationNumber, sentAt/deliveredAt/readAt, errorCode y errorMessage cuando falló, template (se omite cuando el envío no usó ninguna), origin y metaPricing. En un número no oficial, un mensaje QUEUED/SENT con id del proveedor se vuelve a verificar con el proveedor en esta llamada. Solo los mensajes que Pilot Status envió tienen detalle: los mensajes recibidos y las filas APP / LAYER / CHATWOOT de bandeja nativa responden 404 (lístalos con GET /v1/messages).

**Auth:** una clave con alcance de número, o una clave de toda la cuenta con el encabezado `x-whatsapp-number-id` (si no, 403 `TENANT_SCOPE_NOT_ALLOWED`). Los tokens OAuth/MCP y las claves de cuenta también necesitan `logs:read:content` (AGENT, ADMIN u OWNER).



## OpenAPI

````yaml openapi.es.json GET /v1/messages/{id}
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    API REST pública de Pilot Status. Autentícate con el encabezado `x-api-key:
    ps_...` (o `x-api-key-id`). URL base: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/messages/{id}:
    get:
      tags:
        - Messages
      summary: Obtener mensaje
      description: >-
        Devuelve el estado y las marcas de tiempo de un mensaje. `{id}` puede
        ser el id interno del mensaje, el correlationId o el id del mensaje del
        proveedor (wamid de Meta). Incluye externalMessageId, status,
        destinationNumber, sentAt/deliveredAt/readAt, errorCode y errorMessage
        cuando falló, template (se omite cuando el envío no usó ninguna), origin
        y metaPricing. En un número no oficial, un mensaje QUEUED/SENT con id
        del proveedor se vuelve a verificar con el proveedor en esta llamada.
        Solo los mensajes que Pilot Status envió tienen detalle: los mensajes
        recibidos y las filas APP / LAYER / CHATWOOT de bandeja nativa responden
        404 (lístalos con GET /v1/messages).


        **Auth:** una clave con alcance de número, o una clave de toda la cuenta
        con el encabezado `x-whatsapp-number-id` (si no, 403
        `TENANT_SCOPE_NOT_ALLOWED`). Los tokens OAuth/MCP y las claves de cuenta
        también necesitan `logs:read:content` (AGENT, ADMIN u OWNER).
      operationId: get_messages_id
      parameters:
        - name: id
          in: path
          required: true
          description: Id interno, correlationId o externalMessageId (wamid de Meta).
          schema:
            type: string
          example: msg_01HZX...
      responses:
        '200':
          description: Obtener mensaje
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      Id interno del mensaje: el `id` que devuelve `POST
                      /v1/messages/send`.
                    example: msg_01HZX...
                  externalMessageId:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Id del mensaje del proveedor (en un número oficial, el
                      wamid de Meta). `null` hasta que el proveedor acepta el
                      mensaje.
                    example: wamid.HBg...
                  status:
                    type: string
                    enum:
                      - QUEUED
                      - SENT
                      - DELIVERED
                      - READ
                      - PLAYED
                      - FAILED
                      - CANCELED
                    description: Estado de entrega actual.
                    example: FAILED
                  correlationId:
                    type: string
                    description: Identificador de correlación del envío.
                    example: corr_01HZX...
                  destinationNumber:
                    type: string
                    description: Número de teléfono de destino.
                    example: '5511988887777'
                  createdAt:
                    type: string
                    format: date-time
                    description: Cuándo se creó el mensaje (UTC, ISO 8601).
                    example: '2026-06-20T10:00:00.000Z'
                  sentAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: Cuándo se envió el mensaje, o `null`.
                    example: '2026-06-20T10:00:01.000Z'
                  deliveredAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: Cuándo se entregó el mensaje, o `null`.
                    example: null
                  readAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: Cuándo se leyó el mensaje, o `null`.
                    example: null
                  errorCode:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Motivo del fallo legible por máquina: el mismo valor que
                      `GET /v1/messages` devuelve para este mensaje. `null`
                      cuando no hay error, y siempre `null` en `DELIVERED`,
                      `READ`, `PLAYED` y `CANCELED`. Toma decisiones con este
                      campo, nunca con `errorMessage`. El conjunto crece
                      (consulta Log Error Codes): trata un código desconocido
                      como "requiere revisión".
                    example: META_OUTSIDE_24H_WINDOW
                  errorMessage:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Motivo del fallo legible por humanos, o `null`. Su
                      redacción no es un contrato: no la analices; usa
                      `errorCode`.
                    example: >-
                      Re-engagement message: Message failed to send because more
                      than 24 hours have passed since the customer last replied
                      to this number.
                  template:
                    type: string
                    description: >-
                      Nombre de la plantilla con la que se envió el mensaje. La
                      clave se omite (no es `null`) cuando el envío no usó
                      plantilla.
                    example: boas_vindas
                  origin:
                    type:
                      - string
                      - 'null'
                    enum:
                      - API
                      - MCP
                      - CHATWOOT
                      - CHAT
                      - DASHBOARD
                      - SYSTEM
                      - null
                    description: >-
                      Por qué rail salió el mensaje. `null` significa que no hay
                      una solicitud de envío reconocida; no significa entrante.
                      Los mensajes salientes que Pilot Status no envió (`APP`,
                      `LAYER` y respuestas `CHATWOOT` de una bandeja nativa de
                      WhatsApp Cloud) solo se listan en `GET /v1/messages` y
                      `GET /v1/messages/history`; este endpoint responde 404
                      para ellos.
                    example: API
                  metaPricing:
                    type:
                      - object
                      - 'null'
                    description: >-
                      El veredicto de facturación de Meta para este mensaje.
                      `null` hasta que Meta lo informa, y siempre `null` en
                      números que no son de Meta.
                    properties:
                      conversationId:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Id de la ventana de facturación de 24 h de Meta (no es
                          un id de hilo).
                        example: b1f2...
                      originType:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Cómo se abrió esa ventana: `marketing`, `utility`,
                          `authentication`, `service` o `referral_conversion`.
                        example: utility
                      category:
                        type:
                          - string
                          - 'null'
                        description: >-
                          La categoría que Meta facturó. Mismo conjunto de
                          valores que `originType`.
                        example: utility
                      type:
                        type:
                          - string
                          - 'null'
                        description: >-
                          `regular` = facturado; `free_entry_point` (clic en
                          anuncio) y `free_customer_service` = no facturados.
                        example: regular
              example:
                id: msg_01HZX...
                externalMessageId: wamid.HBg...
                status: DELIVERED
                correlationId: corr_01HZX...
                destinationNumber: '5511988887777'
                createdAt: '2026-06-20T10:00:00.000Z'
                sentAt: '2026-06-20T10:00:01.000Z'
                deliveredAt: '2026-06-20T10:00:03.000Z'
                readAt: null
                errorCode: null
                errorMessage: null
                template: boas_vindas
                origin: API
                metaPricing: null
        '401':
          description: >-
            Credencial ausente o inválida (`x-api-key` / `x-api-key-id` / token
            Bearer)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Invalid API key
        '403':
          description: >-
            `TENANT_SCOPE_NOT_ALLOWED`: una clave de toda la cuenta sin
            `x-whatsapp-number-id`; `PERMISSION_DENIED`: un token OAuth/MCP o
            una clave de cuenta (`ps_account_`) cuyo rol en el workspace no
            tiene `logs:read:content` (las claves `ps_` clásicas no están
            sujetas a roles)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                tenantScope:
                  summary: Account-wide key without x-whatsapp-number-id
                  value:
                    error: >-
                      This endpoint acts on a single WhatsApp number: send the
                      x-whatsapp-number-id header naming the number to act on
                      (its id or instance id from GET /v1/numbers) | Este
                      endpoint atua sobre um único número de WhatsApp: envie o
                      header x-whatsapp-number-id indicando o número desejado (o
                      id dele ou o id da instância, obtidos em GET /v1/numbers)
                    code: TENANT_SCOPE_NOT_ALLOWED
                permission:
                  summary: Role without logs:read:content
                  value:
                    error: >-
                      Your workspace role does not allow this action
                      (logs:read:content).
                    code: PERMISSION_DENIED
        '404':
          description: No hay ningún mensaje con ese identificador en el número de la clave
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Message not found
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Tu API key ps_
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: Id de la API key (alternativa a x-api-key)

````

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