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

# Enviar un mensaje

> Envía cualquier mensaje de WhatsApp Cloud API. `type` selecciona el tipo: text, image, audio, video, document, sticker, location, contacts, interactive, template, reaction.



## OpenAPI

````yaml openapi.meta.es.json POST /{phoneNumberId}/messages
openapi: 3.1.0
info:
  title: Meta Cloud API Layer
  version: 1.0.0
  description: >-
    Pilot Status API Layer: Meta Cloud API (passthrough de WhatsApp Cloud API /
    Graph API). URL base `https://pilotstatus.com.br/api/layer/meta`. Llama a
    los nodos de Graph API exactamente como en `graph.facebook.com/<version>/`:
    Pilot cambia tu clave `ps_` por el token de sistema real de Meta del número.
    El prefijo de versión `vNN.N` es opcional (por defecto v22.0). La gestión de
    cuenta/negocio/autenticación y el (des)registro de números están bloqueados.
servers:
  - url: https://pilotstatus.com.br/api/layer/meta
security:
  - apiKey: []
tags:
  - name: Messages
  - name: Media
  - name: By id
  - name: Templates
  - name: Phone numbers
  - name: Business profile
  - name: Groups
  - name: Calls
paths:
  /{phoneNumberId}/messages:
    post:
      tags:
        - Messages
      summary: Enviar un mensaje
      description: >-
        Envía cualquier mensaje de WhatsApp Cloud API. `type` selecciona el
        tipo: text, image, audio, video, document, sticker, location, contacts,
        interactive, template, reaction.
      operationId: post__phoneNumberId_messages
      parameters:
        - name: phoneNumberId
          in: path
          required: true
          schema:
            type: string
          description: >-
            Id de número de teléfono de Meta del número vinculado a tu clave de
            API.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messaging_product:
                  type: string
                  description: Siempre `whatsapp`.
                  enum:
                    - whatsapp
                  example: whatsapp
                recipient_type:
                  type: string
                  description: '`individual` o `group`.'
                  enum:
                    - individual
                    - group
                  example: individual
                to:
                  type: string
                  description: MSISDN del destinatario (o id del grupo).
                  example: '5511999999999'
                type:
                  type: string
                  description: >-
                    Tipo de mensaje: selecciona cuál de los objetos de abajo
                    completar.
                  enum:
                    - text
                    - image
                    - audio
                    - video
                    - document
                    - sticker
                    - location
                    - contacts
                    - interactive
                    - template
                    - reaction
                  example: text
                text:
                  type: object
                  properties:
                    preview_url:
                      type: boolean
                      description: Mostrar una vista previa del enlace.
                    body:
                      type: string
                      description: Texto del mensaje.
                  required:
                    - body
                  example:
                    preview_url: false
                    body: Hello from Pilot Status 👋
                image:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Id del medio obtenido de una carga.
                    link:
                      type: string
                      description: URL https pública (alternativa al id).
                    caption:
                      type: string
                      description: Leyenda opcional.
                audio:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Id del medio obtenido de una carga.
                    link:
                      type: string
                      description: URL https pública (alternativa al id).
                video:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Id del medio obtenido de una carga.
                    link:
                      type: string
                      description: URL https pública (alternativa al id).
                    caption:
                      type: string
                      description: Leyenda opcional.
                document:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Id del medio obtenido de una carga.
                    link:
                      type: string
                      description: URL https pública (alternativa al id).
                    caption:
                      type: string
                      description: Leyenda opcional.
                    filename:
                      type: string
                      description: Nombre de archivo que ve el destinatario.
                sticker:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Id del medio obtenido de una carga.
                    link:
                      type: string
                      description: URL https pública (alternativa al id).
                location:
                  type: object
                  properties:
                    latitude:
                      type: number
                    longitude:
                      type: number
                    name:
                      type: string
                      description: Nombre del lugar.
                    address:
                      type: string
                      description: Dirección.
                  required:
                    - latitude
                    - longitude
                contacts:
                  type: array
                  items:
                    type: object
                  description: Tarjetas de contacto.
                interactive:
                  type: object
                  properties:
                    type:
                      type: string
                      description: '`button`, `list`, `cta_url`, `flow`, `product`…'
                    header:
                      type: object
                    body:
                      type: object
                      properties:
                        text:
                          type: string
                    footer:
                      type: object
                      properties:
                        text:
                          type: string
                    action:
                      type: object
                      description: >-
                        Botones / secciones / parámetros para el tipo
                        interactivo.
                  description: Mensaje interactivo (botones/lista/CTA/flow).
                template:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Nombre de la plantilla aprobada.
                    language:
                      type: object
                      properties:
                        code:
                          type: string
                          description: p. ej. `pt_BR`.
                    components:
                      type: array
                      items:
                        type: object
                      description: Parámetros de encabezado/cuerpo/botones.
                reaction:
                  type: object
                  properties:
                    message_id:
                      type: string
                    emoji:
                      type: string
                      description: Emoji, o string vacío para quitarla.
                context:
                  type: object
                  properties:
                    message_id:
                      type: string
                      description: Responder a este id de mensaje.
                  description: Contexto de cita/respuesta.
              required:
                - messaging_product
                - to
                - type
      responses:
        '200':
          description: Respuesta de Meta Graph API.
          content:
            application/json:
              schema:
                type: object
                properties:
                  messaging_product:
                    type: string
                  contacts:
                    type: array
                    items:
                      type: object
                      properties:
                        input:
                          type: string
                        wa_id:
                          type: string
                  messages:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Id del mensaje (wamid).
                        message_status:
                          type: string
              example:
                messaging_product: whatsapp
                contacts:
                  - input: '5511999999999'
                    wa_id: '5511999999999'
                messages:
                  - id: wamid.HBgL...
        default:
          description: Meta Graph API error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        description: Human-readable error.
                      type:
                        type: string
                        description: e.g. `OAuthException`.
                      code:
                        type: integer
                      error_subcode:
                        type: integer
                      error_data:
                        type: object
                      fbtrace_id:
                        type: string
                description: Meta Graph API error envelope.
              example:
                error:
                  message: (#131030) Recipient phone number not in allowed list
                  type: OAuthException
                  code: 131030
                  fbtrace_id: A...
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Tu clave de API de Pilot Status (ps_...). También puedes enviar
        `Authorization: Bearer ps_...` o `?access_token=ps_...`.

````

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