> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apyconnect.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Send message

> Channel-agnostic. Recipient by conversation_id or contact_id (+channel_id). Returns 202 (queued).



## OpenAPI

````yaml https://api.apyconnect.io/v1/openapi.json post /v1/messages
openapi: 3.1.0
info:
  title: ApyConnect API
  version: 1.0.0
  description: >-
    ApyConnect public API. OAuth 2.0 authentication (client_credentials grant)
    with opaque Bearer tokens. Wrapped responses ({data, meta} / {object:'list',
    data, pagination, meta}); typed errors with trace_id; cursor pagination;
    snake_case throughout the JSON. Rate limit per Application.


    Best practices: send an `Idempotency-Key` header on writes to make retries
    safe (the same key replays the stored response for 24h; reusing a key with a
    different body returns 409). Use `?expand=contact` (and `expand=company` on
    deals) to embed related resources and save round-trips. Deprecated endpoints
    carry RFC 8594 `Deprecation`/`Sunset` headers. Inspect usage at `/v1/usage`
    and the write audit trail at `/v1/audit-logs`.
  contact:
    name: ApyConnect
    url: https://docs.apyconnect.io
servers:
  - url: https://api.apyconnect.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: OAuth
  - name: Contacts
  - name: Conversations
  - name: Messages
  - name: Channels
  - name: Inboxes
  - name: Campaigns
  - name: Analytics
  - name: Webhooks
  - name: Deals
  - name: Tasks
  - name: Companies
  - name: Tickets
  - name: Notes
  - name: Segments
  - name: Macros
  - name: Settings
  - name: Jobs
  - name: Observability
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: Send message
      description: >-
        Channel-agnostic. Recipient by conversation_id or contact_id
        (+channel_id). Returns 202 (queued).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessage'
      responses:
        '202':
          description: Encolado
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Message'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
        '400':
          description: invalid_request_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: authentication_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: permission_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: not_found_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: rate_limit_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    SendMessage:
      type: object
      description: >-
        Recipient by conversation_id, contact_id, or to.identifier (raw channel
        handle — resolves or creates the contact). Content is channel-agnostic;
        interactive/location/contacts/reaction/template are WhatsApp-only.
      properties:
        conversation_id:
          type: string
        contact_id:
          type: string
        channel_id:
          type: string
        to:
          type: object
          description: >-
            Raw recipient. `identifier` is a channel handle; `channel_id` picks
            the sending channel.
          properties:
            channel_id:
              type: string
            identifier:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - phone
                    - email
                    - wa_id
                    - instagram_igsid
                    - telegram_id
                    - discord_id
                    - messenger_psid
                    - external
                value:
                  type: string
              required:
                - type
                - value
        content:
          oneOf:
            - type: object
              properties:
                type:
                  const: text
                text:
                  type: string
              required:
                - type
                - text
            - type: object
              properties:
                type:
                  const: media
                kind:
                  type: string
                  enum:
                    - image
                    - video
                    - audio
                    - document
                url:
                  type: string
                caption:
                  type: string
                filename:
                  type: string
              required:
                - type
                - kind
                - url
            - type: object
              properties:
                type:
                  const: template
                name:
                  type: string
                language:
                  type: string
                components:
                  type: array
                  items: {}
              required:
                - type
                - name
                - language
            - type: object
              description: >-
                Raw WhatsApp interactive object (reply buttons, cta_url, list,
                flow, catalog…).
              properties:
                type:
                  const: interactive
                interactive:
                  type: object
                  additionalProperties: true
                preview_text:
                  type: string
              required:
                - type
                - interactive
            - type: object
              properties:
                type:
                  const: location
                latitude:
                  type: number
                longitude:
                  type: number
                name:
                  type: string
                address:
                  type: string
              required:
                - type
                - latitude
                - longitude
            - type: object
              description: Array of contact cards (Cloud API `contacts` format).
              properties:
                type:
                  const: contacts
                contacts:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
              required:
                - type
                - contacts
            - type: object
              description: >-
                React to a message by its ApyConnect id. Empty emoji removes the
                reaction.
              properties:
                type:
                  const: reaction
                message_id:
                  type: string
                emoji:
                  type: string
              required:
                - type
                - message_id
                - emoji
      required:
        - content
    Message:
      type: object
      properties:
        object:
          const: message
        id:
          type: string
        conversation_id:
          type: string
        direction:
          type: string
          enum:
            - in
            - out
        sender_type:
          type: string
        content_type:
          type: string
        text:
          type:
            - string
            - 'null'
        attachments:
          type: array
          items: {}
        internal_note:
          type: boolean
        delivery_status:
          type:
            - string
            - 'null'
          enum:
            - queued
            - sent
            - delivered
            - read
            - failed
            - bounced
            - complained
            - null
        provider_message_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
    Meta:
      type: object
      properties:
        request_id:
          type: string
      required:
        - request_id
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - not_found_error
                - conflict_error
                - api_error
            code:
              type: string
            message:
              type: string
            trace_id:
              type: string
            details: {}
          required:
            - type
            - code
            - message
            - trace_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Opaque token issued by /oauth/token.

````