GET
/
backend
/
conversations
/
:bot_id
/
messages
/
:conversation_id
curl --location 'https://api.opencopilot.so/backend/conversations/:bot_id' \
  --header 'Authorization: Bearer TOKEN' \ 
  --header 'Content-Type: application/json' 
[
    {
        "action_called": false,
        "client_extra_params": {},
        "from": "copilot",
        "knowldgebase_called": false,
        "message": "Hello! How can I assist you today?"
    },
    {
        "action_called": false,
        "client_extra_params": {},
        "from": "user",
        "knowldgebase_called": false,
        "message": "hey"
    }
]

This endpoint is protected by the same JWT that the user uses to call other APIs. The response will include data for the specified chatbot, along with other metadata information.

This endpoint points to the (v2) version of the API. The (v2) version of the API is the latest version and is recommended for all new development. Please update your code to use the (v2) version of the API.

This endpoint retrieves all messages for a specific conversation. You can use the conversation_id parameter to specify the conversation for which you want to retrieve messages, to the conversation_id parameter, use get conversations endpoint to get the conversation_id.

The endpoint is paginated, and you can specify the offset and limit parameters to control the amount of data returned.

The response includes the following fields:

  • action_called: A boolean value that indicates whether the action was called to handle the message.
  • client_extra_params: An object that contains additional parameters that the client can send to the bot.
  • from: A string that indicates the sender of the message. The value can be copilot or user.
  • knowldgebase_called: A boolean value that indicates whether the knowledge base was called to handle the message.
  • message: A string that contains the message text.

You can use the offset and limit parameters to control the pagination of the response. For example, to retrieve the first 10 messages, you can use the following request:

Example Request
curl --location 'https://api.opencopilot.so/backend/conversations/:bot_id/messages/:conversation_id?offset=0&limit=10' \
  --header 'Authorization: Bearer TOKEN'