Conversations

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

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the conversation.

  • Name
    thread_id
    Type
    string
    Description

    Unique identifier for the conversation thread.

  • Name
    message
    Type
    string
    Description

    The conversation message contents.

  • Name
    date
    Type
    string
    Description

    The date the conversation took place.

  • Name
    lead
    Type
    string
    Description

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

  • Name
    type
    Type
    string
    Description

    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

  • Name
    chatbot_id
    Type
    string
    Description

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

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    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

  • Name
    chatbot_id
    Type
    string
    Description

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

  • Name
    thread_id
    Type
    string
    Description

    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

  • Name
    chatbot_id
    Type
    string
    Description

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

  • Name
    thread_id
    Type
    string
    Description

    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
}

Was this page helpful?