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

# Send Message

> Sends a message to a conversation

Send a message to an existing conversation on behalf of your agent.

## Message Types

You can send two main types of messages:

* **Unified messages** — Sent rich text messages with images, videos, audio, documents, buttons, and more
* **Template messages** — Pre-approved messages that can initiate or re-engage conversations

You can additionally send cta and text speicic messages, though these are deprecated and will be removed in the future.
We will be adding support for other specific message types, such as contacts, location and call requests in the future.

<Warning>
  **Check conversation status first!** You can only send regular (non-template) messages to **active** conversations. Use the [Get Conversation](/api-reference/conversations/get) endpoint to verify the conversation is active before sending.
</Warning>

<Note>
  **Billing**: Template messages are billed by Meta according to their [pricing tiers](https://developers.facebook.com/docs/whatsapp/pricing). Regular messages within the 24-hour customer service window are free.
</Note>


## OpenAPI

````yaml api-reference/openapi.json post /api/v1/conversations/{id}/messages/
openapi: 3.0.3
info:
  title: Wassist API
  version: 1.0.0
  description: API for building WhatsApp AI agents
servers:
  - url: https://backend.wassist.app
    description: Production
  - url: http://localhost:8050
    description: Development
security: []
tags:
  - name: Agents
    description: Create and manage AI agents
  - name: Conversations
    description: Chat conversations and messages
  - name: WhatsApp
    description: WhatsApp Business account management
  - name: Contacts
    description: Contact management
  - name: Integrations
    description: Third-party integrations
paths:
  /api/v1/conversations/{id}/messages/:
    post:
      tags:
        - api
      description: |-
        Get or send messages in a conversation.

        POST supports unified input for text or template messages:
        - type: 'text' with 'message' field
        - type: 'template' with 'templateName' and optional 'variables' fields
      operationId: api_v1_conversations_messages_create
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageInput'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    SendMessageInput:
      type: object
      description: Unified input for sending text, template, or CTA URL messages.
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/SendMessageInputTypeEnum'
          description: >-
            The type of message to send: 'text', 'template', 'cta', or
            'unified'.


            * `text` - text

            * `template` - template

            * `cta` - cta

            * `unified` - unified
        text:
          $ref: '#/components/schemas/SendMessageTextInput'
        template:
          $ref: '#/components/schemas/SendMessageTemplateInput'
        cta:
          $ref: '#/components/schemas/SendMessageCtaInput'
        unified:
          $ref: '#/components/schemas/UnifiedWhatsappMessageInput'
      required:
        - type
    Message:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        role:
          type: string
          readOnly: true
        type:
          type: string
          readOnly: true
        status:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        replyTo:
          type: string
          readOnly: true
        text:
          type: string
          readOnly: true
        image:
          type: string
          readOnly: true
        cta:
          type: string
          readOnly: true
        listSelection:
          type: string
          readOnly: true
        template:
          type: string
          readOnly: true
        unified:
          type: string
          readOnly: true
        quickReply:
          type: string
          readOnly: true
      required:
        - createdAt
        - cta
        - id
        - image
        - listSelection
        - quickReply
        - replyTo
        - role
        - status
        - template
        - text
        - type
        - unified
    SendMessageInputTypeEnum:
      enum:
        - text
        - template
        - cta
        - unified
      type: string
      description: |-
        * `text` - text
        * `template` - template
        * `cta` - cta
        * `unified` - unified
    SendMessageTextInput:
      type: object
      properties:
        body:
          type: string
      required:
        - body
    SendMessageTemplateInput:
      type: object
      properties:
        name:
          type: string
        variables:
          $ref: '#/components/schemas/TemplateVariables'
      required:
        - name
    SendMessageCtaInput:
      type: object
      properties:
        body:
          type: string
          description: Message body text.
          maxLength: 1024
        buttonText:
          type: string
          description: Button label (max 20 chars).
          maxLength: 20
        url:
          type: string
          format: uri
          description: URL to open when button is tapped.
        image:
          $ref: '#/components/schemas/SendMessageCtaImageInput'
      required:
        - body
        - buttonText
        - url
    UnifiedWhatsappMessageInput:
      type: object
      properties:
        text:
          type: string
          maxLength: 1024
        footer:
          type: string
          maxLength: 60
        media:
          $ref: '#/components/schemas/UnifiedWhatsappMediaInput'
        buttons:
          type: array
          items:
            $ref: '#/components/schemas/UnifiedWhatsappButtonInput'
    TemplateVariables:
      type: object
      properties:
        body:
          type: array
          items:
            type: string
        header:
          type: string
        buttons:
          type: array
          items:
            type: string
        cards:
          type: array
          items:
            $ref: '#/components/schemas/Card'
    SendMessageCtaImageInput:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: Image URL.
      required:
        - url
    UnifiedWhatsappMediaInput:
      type: object
      properties:
        url:
          type: string
          format: uri
      required:
        - url
    UnifiedWhatsappButtonInput:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/UnifiedWhatsappButtonInputTypeEnum'
        text:
          type: string
          maxLength: 20
        url:
          type: string
          format: uri
        quickReplyId:
          type: string
          maxLength: 200
      required:
        - text
        - type
    Card:
      type: object
      properties:
        body:
          type: array
          items:
            type: string
        header:
          type: string
        buttons:
          type: array
          items:
            type: string
    UnifiedWhatsappButtonInputTypeEnum:
      enum:
        - url
        - quick_reply
      type: string
      description: |-
        * `url` - url
        * `quick_reply` - quick_reply
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key authentication. Pass your API key in the X-API-Key header.

````