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

# Send a WhatsApp message



## OpenAPI

````yaml /openapi.json post /api/v1/messages/
openapi: 3.0.3
info:
  title: ChatBridge Public API
  version: 1.0.0
  description: >-
    Customer-facing REST API for ChatBridge — contacts, conversations, messages,
    templates, team, catalogue, tickets, and WhatsApp Flows. Authenticate with a
    workspace API key: `Authorization: Bearer cb_...`. See
    https://github.com/algosmiths/whatschat/blob/main/public_api.md for the full
    scope/versioning reference.
servers:
  - url: https://api.algosmiths.com
    description: Production
security: []
paths:
  /api/v1/messages/:
    post:
      tags:
        - Messages
      summary: Send a WhatsApp message
      operationId: messages_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MessageRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MessageRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
      security:
        - ApiKeyAuth: []
        - tokenAuth: []
        - CookieAuth: []
components:
  schemas:
    MessageRequest:
      type: object
      properties:
        to:
          type: string
          minLength: 1
        type:
          $ref: '#/components/schemas/MessageTypeEnum'
        text: {}
        interactive:
          $ref: '#/components/schemas/InteractiveMessageRequest'
        audio: {}
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/ContactRequest'
        document:
          $ref: '#/components/schemas/DocumentRequest'
        image:
          $ref: '#/components/schemas/ImageRequest'
        location:
          $ref: '#/components/schemas/LocationRequest'
        reaction:
          $ref: '#/components/schemas/ReactionRequest'
        sticker:
          $ref: '#/components/schemas/StickerRequest'
        video:
          $ref: '#/components/schemas/VideoRequest'
        template:
          $ref: '#/components/schemas/TemplateMessageRequest'
        reply_to_wamid:
          type: string
          nullable: true
        whatsapp_business_account_id:
          type: integer
          description: >-
            Provide the WhatsApp Business Account ID. If multiple accounts are
            present, provide the account ID otherwise it will be defaulted to
            the first account
        phone_number:
          type: integer
          description: >-
            If the provided business account has multiple phone numbers, provide
            the phone number ID
      required:
        - to
        - type
    MessageTypeEnum:
      enum:
        - template
        - text
        - interactive
        - audio
        - contacts
        - document
        - image
        - location
        - order
        - reaction
        - sticker
        - video
      type: string
      description: |-
        * `template` - TEMPLATE
        * `text` - TEXT
        * `interactive` - INTERACTIVE
        * `audio` - AUDIO
        * `contacts` - CONTACTS
        * `document` - DOCUMENT
        * `image` - IMAGE
        * `location` - LOCATION
        * `order` - ORDER
        * `reaction` - REACTION
        * `sticker` - STICKER
        * `video` - VIDEO
    InteractiveMessageRequest:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/InteractiveMessageTypeEnum'
        body: {}
        action: {}
        header: {}
        footer: {}
      required:
        - type
    ContactRequest:
      type: object
      properties:
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/AddressRequest'
        birthday:
          type: string
          minLength: 1
          description: YYYY-MM-DD
        emails:
          type: array
          items:
            $ref: '#/components/schemas/EmailRequest'
        name:
          $ref: '#/components/schemas/ContactNameRequest'
        org:
          $ref: '#/components/schemas/OrgContactRequest'
        phones:
          type: array
          items:
            $ref: '#/components/schemas/PhoneContactRequest'
        urls:
          type: array
          items:
            $ref: '#/components/schemas/UrlContactRequest'
    DocumentRequest:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        link:
          type: string
          format: uri
          minLength: 1
        caption:
          type: string
          minLength: 1
        filename:
          type: string
          minLength: 1
    ImageRequest:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        link:
          type: string
          format: uri
          minLength: 1
        caption:
          type: string
          minLength: 1
    LocationRequest:
      type: object
      properties:
        latitude:
          type: string
          minLength: 1
        longitude:
          type: string
          minLength: 1
        name:
          type: string
          minLength: 1
        address:
          type: string
          minLength: 1
      required:
        - latitude
        - longitude
    ReactionRequest:
      type: object
      properties:
        message_id:
          type: string
          minLength: 1
        emoji:
          type: string
          minLength: 1
      required:
        - emoji
        - message_id
    StickerRequest:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        link:
          type: string
          format: uri
          minLength: 1
    VideoRequest:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        link:
          type: string
          format: uri
          minLength: 1
        caption:
          type: string
          minLength: 1
          maxLength: 1024
    TemplateMessageRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 512
        language: {}
        components: {}
      required:
        - language
        - name
    InteractiveMessageTypeEnum:
      enum:
        - address_message
        - cta_url
        - flow
        - list
        - button
        - location_request_message
        - product
        - product_list
        - catalog_message
        - order_details
        - order_status
        - call_permission_request
      type: string
      description: |-
        * `address_message` - address_message
        * `cta_url` - cta_url
        * `flow` - flow
        * `list` - list
        * `button` - button
        * `location_request_message` - location_request_message
        * `product` - product
        * `product_list` - product_list
        * `catalog_message` - catalog_message
        * `order_details` - order_details
        * `order_status` - order_status
        * `call_permission_request` - call_permission_request
    AddressRequest:
      type: object
      properties:
        street:
          type: string
          minLength: 1
        city:
          type: string
          minLength: 1
        state:
          type: string
          minLength: 1
        zip:
          type: string
          minLength: 1
        country:
          type: string
          minLength: 1
        country_code:
          type: string
          minLength: 1
        type:
          $ref: '#/components/schemas/AddressTypeEnum'
    EmailRequest:
      type: object
      properties:
        email:
          type: string
          format: email
          minLength: 1
        type:
          $ref: '#/components/schemas/Type612Enum'
    ContactNameRequest:
      type: object
      properties:
        formatted_name:
          type: string
          minLength: 1
        first_name:
          type: string
          minLength: 1
        last_name:
          type: string
          minLength: 1
        middle_name:
          type: string
          minLength: 1
        suffix:
          type: string
          minLength: 1
        prefix:
          type: string
          minLength: 1
    OrgContactRequest:
      type: object
      properties:
        company:
          type: string
          minLength: 1
        department:
          type: string
          minLength: 1
        title:
          type: string
          minLength: 1
    PhoneContactRequest:
      type: object
      properties:
        phone:
          type: string
          minLength: 1
        type:
          $ref: '#/components/schemas/PhoneContactTypeEnum'
    UrlContactRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
          minLength: 1
        type:
          $ref: '#/components/schemas/Type612Enum'
    AddressTypeEnum:
      enum:
        - Home
        - Office
        - Pop-Up
        - Other
      type: string
      description: |-
        * `Home` - Home
        * `Office` - Office
        * `Pop-Up` - Pop-Up
        * `Other` - Other
    Type612Enum:
      enum:
        - Personal
        - Work
        - Other
      type: string
      description: |-
        * `Personal` - Personal
        * `Work` - Work
        * `Other` - Other
    PhoneContactTypeEnum:
      enum:
        - Mobile
        - Work
        - Home
        - Landline
        - Other
      type: string
      description: |-
        * `Mobile` - Mobile
        * `Work` - Work
        * `Home` - Home
        * `Landline` - Landline
        * `Other` - Other
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: cb_...
      description: >-
        Workspace API key, e.g. `Authorization: Bearer cb_live_...`. Create one
        in Settings → API Keys. See public_api.md § 3 for scopes.
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"
    CookieAuth:
      type: apiKey
      in: cookie
      name: token
      description: Dashboard session cookie — internal use only, not the public contract.

````