Support AI

Conversations

Learn how to managed your AI chatbot conversations with the Support AI conversations API endpoints.

Leverage the following Conversations API to view and delete the different conversations that your AI chatbot is having with your contacts and customers.

Properties

idstring

Unique identifier for the conversation.

thread_idstring

Unique identifier for the conversation thread.

messagestring

The conversation message contents.

datestring

The date the conversation took place.

leadstring

If there was a lead, this will contain the details about the lead.

typestring

Whether the message was from a user or a bot.


POST /fetchConversations/:chatbot_id

Fetch conversations

Get the list of last conversations of a specific chatbot of your account. The default number of conversations is 100. The message from the response is the last message received from the user in the thread.

Required attributes

chatbot_idstring

The Chatbot ID that you want to get the training links for.

Optional attributes

limitinteger

Limit the number of conversations returned. Defaults to last 10 conversations.

Request

POST /fetchConversations/:chatbot_id

curl --request POST \
  --url https://api.supportai.com/fetchConversations/:chatbot_id \
  --header 'Authorization: Bearer IDZFdfiD...'
  --data '{"limit":100}'

Response

{
  "success": true,
  "data": [
    {
      "thread_id": "6906efee...",
      "message": "What is your pricing?",
      "date": "2024-01-20T01:02:34.609757+00:00",
      "lead": "{json string}"
    }
    ...
  ]
}

POST /fetchMessages/:chatbot_id

Fetch conversation messages

Get the list of messages of a specific conversation of a specific chatbot of your account. Messages are sorted by ID, the last message in the response is the most recent.

Required attributes

chatbot_idstring

The Chatbot ID that you want to get the training links for.

thread_idstring

The Conversation thread ID that you want to get the messages for. Can be obtained from the Fetch conversations endpoint.

Request

POST /fetchMessages/:chatbot_id

curl --request POST \
  --url https://api.supportai.com/fetchMessages/:chatbot_id \
  --header 'Authorization: Bearer IDZFdfiD...' \
  --data '{"thread_id":"fdbe104a..."}'

Response

{
  "success": true,
  "data": [
    {
      "id": 123456,
      "message": "What is your pricing?",
      "date": "2024-01-19T19:15:55.666419+00:00",
      "type": "user" (or bot)
    }
    ...
  ]
}

GET /deleteConversation/:chatbot_id

Delete a conversation

Delete a conversation and its messages of a specific chatbot of your account.

Required attributes

chatbot_idstring

The Chatbot ID that you want to get the training links for.

thread_idstring

The Conversation thread ID that you want to get the messages for. Can be obtained from the Fetch conversations endpoint.

Request

GET /deleteConversation/:chatbot_id

curl --request GET \
  --url https://api.supportai.com/deleteConversation/:chatbot_id \
  --header 'Authorization: Bearer IDZFdfiD...'
  --data '{"thread_id":"18407402..."}'

Response

{
  "success": true
}