> ## 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.

# Ingest message

> This endpoint lets you ingest messages in conversations that use custom channels. When called, it creates a new message in the specified conversation. If the conversation does not exist, the endpoint will automatically create the conversation before adding the message.

You must use an API key with `ORG_ADMIN` or `PROVIDER` rights for this endpoint.

⚠️ A `200 OK` response does not guarantee that the message was successfully created. 
It only means the request was received and accepted for processing. ⚠️




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml post /custom-channels/{channel_id}/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:
  /custom-channels/{channel_id}/messages:
    post:
      tags:
        - Custom Channels
      summary: Ingest message
      description: >
        This endpoint lets you ingest messages in conversations that use custom
        channels. When called, it creates a new message in the specified
        conversation. If the conversation does not exist, the endpoint will
        automatically create the conversation before adding the message.


        You must use an API key with `ORG_ADMIN` or `PROVIDER` rights for this
        endpoint.


        ⚠️ A `200 OK` response does not guarantee that the message was
        successfully created. 

        It only means the request was received and accepted for processing. ⚠️
      operationId: customChannelMessages
      parameters:
        - name: channel_id
          in: path
          required: true
          schema:
            type: string
            description: The id of the custom channel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              description: Request body to ingest a new message in a conversation
              type: object
              required:
                - business_id
                - external_conversation_id
                - external_message_id
                - content
                - sender_type
              properties:
                business_id:
                  type: string
                  description: The id of the business.
                external_conversation_id:
                  type: string
                  description: >-
                    The unique id of the conversation in your system. Messages
                    with the same `external_conversation_id` & `channel_id` will
                    be grouped within the same Partoo Conversation.
                external_message_id:
                  type: string
                  description: >-
                    The unique id of the message in your system. Messages with
                    the same `external_message_id` & `channel_id` will be
                    considered as duplicates and will be ignored.
                content:
                  type: string
                  description: The message content.
                sender_type:
                  type: string
                  enum:
                    - User
                    - Consumer
                consumer_name:
                  type:
                    - string
                    - 'null'
                  default: 'null'
                  description: >-
                    Display name of the consumer. This property is only used at
                    the creation of the conversation.
                consumer_image:
                  type:
                    - string
                    - 'null'
                  default: 'null'
                  description: >-
                    Profile image URL of the consumer. This property is only
                    used at the creation of the conversation.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
        '403':
          $ref: '#/components/responses/403'
components:
  responses:
    '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

````