POST
/
v0
/
chatbots
/
{chatbotId}
/
message
curl --request POST \
  --url https://sitegpt.ai/api/v0/chatbots/{chatbotId}/message \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "message": "What can you do ?",
  "from": "USER"
}'
{
  "success": true,
  "message": "Sent the message successfully",
  "data": {
    "message": {
      "id": "376290410396385873",
      "question": {
        "text": "This is user!!",
        "timestamp": "2023-08-03T11:43:52.037718Z"
      },
      "answer": {
        "text": "This is agent!!",
        "timestamp": "2023-08-03T11:19:19.041469Z"
      },
      "sources": [],
      "gptModel": "gpt-3.5-turbo",
      "reaction": "NEUTRAL",
      "threadId": "06b3b43c-5651-49a2-b618-d7f24667c1b6",
      "messageType": "AGENT_MESSAGE",
      "iconUrl": "https://avatars.githubusercontent.com/u/17903466?s=48&v=4",
      "agentName": "Test Agent",
      "prompts": [
        {
          "id": "17e23880-386e-492f-960c-4394baec2977",
          "title": "Prompt 1",
          "description": "This is the prompt1 description"
        },
        {
          "id": "ab0ba301-90c9-4ef2-8ca8-fa579a104386",
          "title": "Prompt 2",
          "description": "This is the prompt2 description"
        }
      ],
      "smartPrompts": [
        "First smart prompt",
        "Second smart prompt",
        "Third smart prompt"
      ],
      "chatbotId": "365062873485935184"
    }
  }
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

chatbotId
string
required

Id of the chatbot

Body

application/json

Request Body

message
string
required

Actual text containing the message

threadId
string

If provided, message will be sent to the thread with this threadId. Otherwise, message will be sent to a new thread. This is mandatory when from is AGENT.

from
enum<string>

Indicates who all can send messages to the chat threads

Available options:
USER,
AGENT
iconUrl
string

Icon url to be associated with the message in the conversation thread

agentName
string

Agent name to be associated with the message in the conversation thread

prompts
object[]

Prompts should be provided only when from is AGENT. This provides user list of options to choose from after the message is sent.

includeSmartPrompts
boolean
default: false

Flag to decide whether to return smart followup questions based on the AI response.

Response

200 - application/json

Sucess Response

success
boolean

Indicates whether this is success response or error response

message
string

Overall message regarding the operation performed

data
object

Data returned from the server