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

# Send a message

> Sends a message to a contact from one of your channels (v1.0, legacy: v2.0 has POST /conversations).



## OpenAPI

````yaml /api-reference/v1.0/openapi.json post /messages/send
openapi: 3.1.0
info:
  title: Shortext API
  description: >-
    Shortext API v1.0 (legacy). New integrations should use v2.0. Every response
    is HTTP 200: check `success` and `code`.
  version: '1.0'
servers:
  - url: https://shortext.ny-corp.io/api
security: []
tags:
  - name: Agents
    description: Agents
  - name: Business manager
    description: Business manager
  - name: Messages
    description: Messages
  - name: Tickets
    description: Tickets
  - name: Knowledge
    description: Knowledge
  - name: Health
    description: Health
paths:
  /messages/send:
    post:
      tags:
        - Messages
      summary: Send a message
      description: >-
        Sends a message to a contact from one of your channels (v1.0, legacy:
        v2.0 has POST /conversations).
      operationId: sendMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
      responses:
        '200':
          description: Message sent. The stored message is returned in body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    SendMessageRequest:
      required:
        - channel
        - contact
        - from
        - message
      properties:
        channel:
          type: string
          enum:
            - whatsapp
            - mail
          example: whatsapp
        contact:
          required:
            - identifier
            - profile
          properties:
            identifier:
              description: For channel whatsapp -> E.164 format without leading +
              type: string
              example: '1234567890'
            profile:
              required:
                - lastname
              properties:
                lastname:
                  type: string
                  maxLength: 250
                  example: Yoan
                firstname:
                  type: string
                  maxLength: 250
                  example: André
                email:
                  type: string
                  format: email
                  example: celia@home.io
                address:
                  type: string
                  maxLength: 250
                  example: Place to be
                preferred_language:
                  type: string
                  enum:
                    - en
                    - fr
                    - es
                    - de
                  example: en
              type: object
          type: object
        from:
          description: >-
            Id of the sending channel: WhatsApp phone id, mailbox id (mbx_...)
            or Shortext endpoint id (ste_...)
          type: string
          example: '1234567890'
        message:
          required:
            - type
            - content
          properties:
            type:
              type: string
              enum:
                - text
                - media
                - interactive
                - template
              example: text
            content:
              oneOf:
                - $ref: '#/components/schemas/TextMessageContent'
                - $ref: '#/components/schemas/ImageMessageContent'
                - $ref: '#/components/schemas/VideoMessageContent'
                - $ref: '#/components/schemas/DocumentMessageContent'
                - $ref: '#/components/schemas/AudioMessageContent'
                - $ref: '#/components/schemas/InteractiveButtonMessageContent'
          type: object
      type: object
    SendMessageResponse:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - properties:
            body:
              description: The stored outbound message
              type: object
          type: object
    TextMessageContent:
      title: Text Message
      description: >-
        WhatsApp allow text message only when there is already an open session
        between the contact and the business number
      required:
        - text
      properties:
        text:
          description: 'for embedded url please use this format ex: https://shortext.io'
          type: string
          maxLength: 4096
          example: Ceci est un message texte.
        preview_url:
          type: boolean
          default: true
          example: true
      type: object
    ImageMessageContent:
      title: Image Message
      description: >-
        Image messages are messages that display a single image and an optional
        caption.
      required:
        - media_type
        - media_url
      properties:
        media_type:
          description: Get the validation rules that apply to the request.
          type: string
          enum:
            - image
          example: image
        media_url:
          type: string
          example: https://example.com/image.jpg
        caption:
          type: string
          maxLength: 1024
          example: Voici une image
      type: object
    VideoMessageContent:
      title: Video Message
      description: >-
        Video messages display a thumbnail preview of a video image with an
        optional caption. When the WhatsApp user taps the preview, it loads the
        video and displays it to the user.
      required:
        - media_type
        - media_url
      properties:
        media_type:
          type: string
          enum:
            - video
          example: video
        media_url:
          type: string
          example: https://example.com/video.mp4
        caption:
          type: string
          maxLength: 1024
          example: Voici une image
      type: object
    DocumentMessageContent:
      title: Document Message
      description: >-
        Document messages are messages that display a document icon, linked to a
        document, that a WhatsApp user can tap to download.
      required:
        - media_type
        - media_url
      properties:
        media_type:
          type: string
          enum:
            - document
          example: document
        media_url:
          type: string
          example: https://example.com/document.pdf
        name:
          description: >-
            Document filename, with extension. The WhatsApp client will use an
            appropriate file type icon based on the extension.
          type: string
          maxLength: 30
          example: Facture.pdf
        caption:
          type: string
          maxLength: 1024
          example: Voici une image
      type: object
    AudioMessageContent:
      title: Audio Message
      description: >-
        Audio messages display an audio icon and a link to an audio file. When
        the WhatsApp user taps the icon, the WhatsApp client loads and plays the
        audio file.
      required:
        - media_type
        - media_url
      properties:
        media_type:
          description: Get the validation rules that apply to the request.
          type: string
          enum:
            - audio
          example: audio
        media_url:
          type: string
          example: https://example.com/image.jpg
      type: object
    InteractiveButtonMessageContent:
      title: Interactive Button Reply Message
      properties:
        type:
          description: Get the validation rules that apply to the request.
          type: string
          enum:
            - button
            - payment
          example: button
        header:
          description: >-
            Text header doesn't allow formating like *<HEADER>* or any other
            format supported by WhatsApp
          properties:
            type:
              type: string
              enum:
                - text
                - image
                - video
                - document
              example: text
            value:
              type: string
              example: text or url to the media file
          type:
            - object
            - 'null'
        body:
          properties:
            text:
              type: string
              example: Voici deux options
          type: string
        footer:
          properties:
            text:
              type: string
              example: Sélectionnez une option
          type:
            - string
            - 'null'
        buttons:
          type: array
          items:
            properties:
              id:
                type: string
                example: btn_1
              title:
                type: string
                example: Option 1
            type: object
        payment_detail:
          type: array
          items:
            properties:
              amount:
                type: number
                format: float
                example: '100'
              currency:
                type: string
                example: XAF
              order_id:
                type: string
                example: ORDER001
              callback_url:
                type: string
                example: https://shortext.ny-corp.io/callback
            type: object
        action:
          type: array
          items:
            properties:
              url:
                type: string
                example: https://shortext.ny-corp.io
            type: object
      type: object
    ApiResponse:
      description: >-
        Envelope of every response (always HTTP 200): only `body` changes from
        one endpoint to another.
      required:
        - success
        - code
        - message
      properties:
        success:
          type: boolean
          example: true
        code:
          $ref: '#/components/schemas/ResponseCode'
        message:
          type: string
          example: Request success
        body:
          description: Endpoint-specific payload, null on most errors
          type:
            - object
            - 'null'
        token:
          description: Present only on authentication routes
          type:
            - string
            - 'null'
        trace_id:
          description: Present only when success=false. Give it to support.
          type:
            - string
            - 'null'
      type: object
    ResponseCode:
      description: >-
        Standard response codes defined by the system / Codes de réponse
        standard définis par le système.
      type: integer
      enum:
        - -1
        - -2
        - -3
        - -4
        - -5
        - 1000
        - -1001
        - -1002
        - -1003
        - -1004
        - -1005
        - -1006
        - -1007
        - -1008
        - -1009
        - -1010
        - -1100
        - -1101
        - -1102
        - -1103
        - 1104
        - -1105
      example: 1000
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Company API key, sent as `Authorization: Bearer <key>`. Create it in the
        dashboard (Developer > API Keys) with the permissions the integration
        needs.
      scheme: bearer

````

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