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

# Send message

> This endpoint allows you to send a message as a business, in an existing
conversation.

The supported content types when sending messages are :
- Text
- Image
- Video
- Audio
- Document

⚠️ Due to underlying channel limitations, some media content_types are not
supported on all channels :
<table>
  <thead>
    <tr>
      <th scope="col">Channel</th>
      <th scope="col">Image</th>
      <th scope="col">Video</th>
      <th scope="col">Audio</th>
      <th scope="col">Document</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Facebook</th>
      <td>✅</td>
      <td>✅</td>
      <td>✅</td>
      <td>✅</td>
    </tr>
    <tr>
      <th scope="row">Instagram</th>
      <td>✅</td>
      <td>✅</td>
      <td>✅</td>
      <td>❌</td>
    </tr>
    <tr>
      <th scope="row">SMS</th>
      <td>❌</td>
      <td>❌</td>
      <td>❌</td>
      <td>❌</td>
    </tr>
    <tr>
      <th scope="row">Whatsapp</th>
      <td>✅</td>
      <td>✅</td>
      <td>✅</td>
      <td>✅</td>
    </tr>
  </tbody>
</table>

When dealing with media messages (`Image`, `Video`, `Audio`, `Document`), there are some
additionnal file type and file size limitations.
- Image size should not exceed <strong>5 MB</strong>.
- Video size should not exceed <strong>16 MB</strong>.
- Audio size should not exceed <strong>16 MB</strong>.
- Document size should not exceed <strong>100 MB</strong>.

For optimal support, you should target the following file types :
- Image : `jpeg`, `png`.
- Video : `mp4`.
- Audio : `aac`, `mp4`.
- Document : `xls`, `xlsx`, `docx`, `pdf`, `ppt`, `pptx`.     

A successful HTTP response to this endpoint (code 200) does not necessarily mean that the
message has been correctly delivered to the consumer, only that it has been created on
Partoo.
To ensure that the message has been delivered successfully, we recommend subscribing to the
[Message Updated](/api-reference/webhooks-events/message-updated) Webhook, and checking that the `status` field
of the message has switched to `Success`.

If the answer has failed to be sent, you can send it again by using the
[/retry endpoint](/api-reference/messages/retry-send-message)




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml post /messages
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /messages:
    post:
      tags:
        - Messages
      summary: Send message
      description: >
        This endpoint allows you to send a message as a business, in an existing

        conversation.


        The supported content types when sending messages are :

        - Text

        - Image

        - Video

        - Audio

        - Document


        ⚠️ Due to underlying channel limitations, some media content_types are
        not

        supported on all channels :

        <table>
          <thead>
            <tr>
              <th scope="col">Channel</th>
              <th scope="col">Image</th>
              <th scope="col">Video</th>
              <th scope="col">Audio</th>
              <th scope="col">Document</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <th scope="row">Facebook</th>
              <td>✅</td>
              <td>✅</td>
              <td>✅</td>
              <td>✅</td>
            </tr>
            <tr>
              <th scope="row">Instagram</th>
              <td>✅</td>
              <td>✅</td>
              <td>✅</td>
              <td>❌</td>
            </tr>
            <tr>
              <th scope="row">SMS</th>
              <td>❌</td>
              <td>❌</td>
              <td>❌</td>
              <td>❌</td>
            </tr>
            <tr>
              <th scope="row">Whatsapp</th>
              <td>✅</td>
              <td>✅</td>
              <td>✅</td>
              <td>✅</td>
            </tr>
          </tbody>
        </table>


        When dealing with media messages (`Image`, `Video`, `Audio`,
        `Document`), there are some

        additionnal file type and file size limitations.

        - Image size should not exceed <strong>5 MB</strong>.

        - Video size should not exceed <strong>16 MB</strong>.

        - Audio size should not exceed <strong>16 MB</strong>.

        - Document size should not exceed <strong>100 MB</strong>.


        For optimal support, you should target the following file types :

        - Image : `jpeg`, `png`.

        - Video : `mp4`.

        - Audio : `aac`, `mp4`.

        - Document : `xls`, `xlsx`, `docx`, `pdf`, `ppt`, `pptx`.     


        A successful HTTP response to this endpoint (code 200) does not
        necessarily mean that the

        message has been correctly delivered to the consumer, only that it has
        been created on

        Partoo.

        To ensure that the message has been delivered successfully, we recommend
        subscribing to the

        [Message Updated](/api-reference/webhooks-events/message-updated)
        Webhook, and checking that the `status` field

        of the message has switched to `Success`.


        If the answer has failed to be sent, you can send it again by using the

        [/retry endpoint](/api-reference/messages/retry-send-message)
      operationId: postMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/PostTextMessage'
                - $ref: '#/components/schemas/PostImageUrlMessage'
                - $ref: '#/components/schemas/PostAudioMessage'
                - $ref: '#/components/schemas/PostVideoMessage'
                - $ref: '#/components/schemas/PostDocumentMessage'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PostImageMessage'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  message_id:
                    type: integer
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
components:
  schemas:
    PostTextMessage:
      required:
        - content
      title: Text
      allOf:
        - $ref: '#/components/schemas/PostMessage'
        - properties:
            content_type:
              type: string
              enum:
                - Text
            content:
              type: string
              description: The text to send
    PostImageUrlMessage:
      required:
        - url
      title: Image Url
      allOf:
        - $ref: '#/components/schemas/PostMessage'
        - properties:
            content_type:
              type: string
              enum:
                - Image
            url:
              type: string
              description: The url of the image to send
    PostAudioMessage:
      required:
        - url
      title: Audio
      allOf:
        - $ref: '#/components/schemas/PostMessage'
        - properties:
            content_type:
              type: string
              enum:
                - Audio
            content:
              type: object
              properties:
                url:
                  type: string
                  description: The url of the audio to send
    PostVideoMessage:
      required:
        - url
      title: Video
      allOf:
        - $ref: '#/components/schemas/PostMessage'
        - properties:
            content_type:
              type: string
              enum:
                - Video
            content:
              type: object
              properties:
                url:
                  type: string
                  description: The url of the video to send
    PostDocumentMessage:
      required:
        - url
      title: Document
      allOf:
        - $ref: '#/components/schemas/PostMessage'
        - properties:
            content_type:
              type: string
              enum:
                - Document
            content:
              type: object
              properties:
                url:
                  type: string
                  description: The url of the document to send
    PostImageMessage:
      required:
        - image
      allOf:
        - $ref: '#/components/schemas/PostMessage'
        - properties:
            content_type:
              type: string
              enum:
                - Image
            image:
              type: string
              description: The image to send
    PostMessage:
      required:
        - conversation_id
        - content_type
        - date
      properties:
        conversation_id:
          type: integer
          description: The id of the conversation
  responses:
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
  securitySchemes:
    ApiKeyAuth:
      description: >
        The authentication system on Partoo API is using API Key that should be
        put in the header of the request (the name of the header is `x-APIKey`).
        An api_key is linked to a user. This user's role will give you different
        access level to the API features.
      type: apiKey
      in: header
      name: x-APIKey

````