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

# Send message

> Enqueues sending a message from the number linked to the API key. Use exactly one of templateId (template send, with variables) or text (free-form); and exactly one destination: destinationNumber (E.164), groupId (…@g.us) or newsletterId (…@newsletter). Requires a number-scoped key (403 for a tenant key). Real side effect: actually delivers and may cost. NOT_SUPPORTED_FOR_META for groupId/newsletterId on Meta numbers.

**Requires a number-scoped key.**



## OpenAPI

````yaml openapi.json POST /v1/messages/send
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: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/messages/send:
    post:
      tags:
        - Messages
      summary: Send message
      description: >-
        Enqueues sending a message from the number linked to the API key. Use
        exactly one of templateId (template send, with variables) or text
        (free-form); and exactly one destination: destinationNumber (E.164),
        groupId (…@g.us) or newsletterId (…@newsletter). Requires a
        number-scoped key (403 for a tenant key). Real side effect: actually
        delivers and may cost. NOT_SUPPORTED_FOR_META for groupId/newsletterId
        on Meta numbers.


        **Requires a number-scoped key.**
      operationId: post_messages_send
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                templateId:
                  type: string
                  description: Template id or name (mutually exclusive with text).
                  example: boas_vindas
                text:
                  type: string
                  description: Free-form text (mutually exclusive with templateId).
                  example: Olá! Sua entrega chegou.
                destinationNumber:
                  type: string
                  description: >-
                    Destination (exactly one). Accepts an E.164 phone OR a BSUID
                    — the contact's durable userId (e.g.
                    BR.13491208655302741918), returned by GET
                    /api/v1/conversations. Use the BSUID to reply to contacts
                    using a WhatsApp username (no phone).
                    One-tap/zero-tap/copy-code authentication templates require
                    a phone number.
                  example: '5511988887777'
                groupId:
                  type: string
                  description: Group JID. NOT_SUPPORTED_FOR_META.
                  example: 123456789-987654321@g.us
                newsletterId:
                  type: string
                  description: Channel/newsletter JID. NOT_SUPPORTED_FOR_META.
                  example: 120363000000000000@newsletter
                variables:
                  type: string
                  description: Template variables (default {}).
                  example: '{ "nome": "Ana" }'
                media:
                  type: string
                  description: >-
                    Public http(s) URL OR base64 data URI (e.g.
                    data:audio/ogg;base64,AAAA…). Base64 works on Meta Cloud API
                    and Evolution v2; on Evolution GO use a public http(s) URL
                    (GO does not accept base64). Used in template mode or in
                    direct-media mode (media + mediaType, without templateId and
                    without text).
                  example: https://cdn.acme.com/img.png
                mediaType:
                  type: string
                  description: >-
                    Media type. In direct-media mode (no templateId/text) send
                    media + mediaType: optional caption for image/video/document
                    (not for audio); buttons/header/footer/variables not
                    allowed. "audio" is delivered as a voice note (PTT) on Meta
                    Cloud API, Evolution v2, and Evolution GO; on Evolution v2
                    and GO a "recording audio" presence indicator is shown to
                    the recipient before the voice note (Meta has no outbound
                    presence API).
                  example: image
                buttons:
                  type: string
                  description: Buttons (QUICK_REPLY/URL/PHONE_NUMBER/COPY_CODE).
                header:
                  type: string
                  description: Header for free-form (with buttons).
                footer:
                  type: string
                  description: Footer for free-form (with buttons).
                deliverAt:
                  type: string
                  description: Schedule delivery for a future time.
                  example: '2026-06-21T09:00:00Z'
                deliverUntil:
                  type: string
                  description: Maximum delivery window.
                  example: '2026-06-21T18:00:00Z'
                labels:
                  type: string
                  description: Labels to apply to the destination conversation.
                  example: '["pedido", "vip"]'
            example:
              templateId: boas_vindas
              destinationNumber: '5511988887777'
              variables:
                nome: Ana
      responses:
        '202':
          description: Send template
          content:
            application/json:
              example:
                id: msg_01HZX...
                correlationId: corr_01HZX...
                status: QUEUED
                createdAt: '2026-06-20T10:00:00.000Z'
                origin: Suporte
                sourceNumber: '5511999999999'
        '400':
          description: Invalid payload or parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Validation error
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: Tenant-scoped key used on a number-scoped endpoint
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Tenant-scoped keys cannot call number endpoints
                code: TENANT_SCOPE_NOT_ALLOWED
        '404':
          description: Template not found or without an approved version
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Template not found
        '422':
          description: Tenant billing suspended
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Billing suspended
                code: BILLING_SUSPENDED
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````