Skip to Content

ChatApi

All URIs are relative to https://business.apis.kesk.app/v1 

MethodHTTP requestDescription
addChatReactionPOST /chat/sessions/{chat_session_id}/messages/{message_id}/reactions
deleteChatMediaDELETE /chat/sessions/{chat_session_id}/media/{media_id}Delete media from a chat session
deleteChatMessageDELETE /chat/sessions/{chat_session_id}/messages/{message_id}
editChatMessagePUT /chat/sessions/{chat_session_id}/messages/{message_id}
getBotConversationStatusGET /chat/bots/{bot_username}/status
getBotSuggestionsGET /chat/bots/{bot_username}/suggestions
getChatMediaGET /chat/sessions/{chat_session_id}/media/{media_id}Get a specific media item from a chat session
getChatMessageHistoryGET /chat/sessions/{chat_session_id}/messages
getSpecificChatMessageGET /chat/sessions/{chat_session_id}/messages/{message_id}
listChatMediaGET /chat/sessions/{chat_session_id}/mediaList all media in a chat session
listChatSessionsGET /chat/sessions
markChatMessagesAsReadPOST /chat/sessions/{chat_session_id}/read
removeChatReactionDELETE /chat/sessions/{chat_session_id}/messages/{message_id}/reactions
restartBotConversationPOST /chat/bots/{bot_username}/restart
sendBotMessagePOST /chat/bots/{bot_username}/send
sendChatMessagePOST /chat/sessions/{chat_session_id}/messages
sendRagQueryPOST /chat/sessions/{chat_session_id}/rag
startBotConversationPOST /chat/bots/{bot_username}/start
startChatPOST /chat/sessions/startStart a chat session (RAG with AI assistant or Vendor chat)
startDirectChatPOST /chat/sessions/directStart a direct chat with another user
transferBotToHumanPOST /chat/bots/{bot_username}/transfer
updateChatSessionMetadataPUT /chat/sessions/{session_id}/metadata
uploadChatMediaPOST /chat/sessions/{chat_session_id}/mediaUpload media for a chat session

addChatReaction

ReactionResponse addChatReaction(chat_session_id, message_id, AddReaction)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
message_idLong[default to null]
AddReactionAddReaction

Return type

ReactionResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

deleteChatMedia

String deleteChatMedia(chat_session_id, media_id)

Delete media from a chat session

Removes a media file from the chat session. Only participants can delete media.

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
media_idLong[default to null]

Return type

String

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

deleteChatMessage

ChatMessage deleteChatMessage(chat_session_id, message_id)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
message_idLong[default to null]

Return type

ChatMessage

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

editChatMessage

ChatMessage editChatMessage(chat_session_id, message_id, EditMessage)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
message_idLong[default to null]
EditMessageEditMessage

Return type

ChatMessage

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

getBotConversationStatus

BotConversationSession getBotConversationStatus(bot_username)

Parameters

NameTypeDescriptionNotes
bot_usernameString[default to null]

Return type

BotConversationSession

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

getBotSuggestions

BotSuggestions getBotSuggestions(bot_username, context)

Parameters

NameTypeDescriptionNotes
bot_usernameString[default to null]
contextString[optional] [default to null]

Return type

BotSuggestions

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

getChatMedia

ChatMediaResponse getChatMedia(chat_session_id, media_id)

Get a specific media item from a chat session

Retrieves information about a specific media file in a chat session, including the URL to download/view the file.

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
media_idLong[default to null]

Return type

ChatMediaResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

getChatMessageHistory

PaginatedMessages getChatMessageHistory(chat_session_id, limit, before_message_id)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
limitInteger[optional] [default to null]
before_message_idLong[optional] [default to null]

Return type

PaginatedMessages

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

getSpecificChatMessage

ChatMessage getSpecificChatMessage(chat_session_id, message_id)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
message_idLong[default to null]

Return type

ChatMessage

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

listChatMedia

List listChatMedia(chat_session_id, limit, offset)

List all media in a chat session

Retrieves a paginated list of all media files in a chat session. Useful for displaying a media gallery view.

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
limitInteger[optional] [default to null]
offsetInteger[optional] [default to null]

Return type

List

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

listChatSessions

PaginatedSessionList listChatSessions(limit, before)

Parameters

NameTypeDescriptionNotes
limitInteger[optional] [default to null]
beforeString[optional] [default to null]

Return type

PaginatedSessionList

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

markChatMessagesAsRead

GenericSuccess markChatMessagesAsRead(chat_session_id, MarkRead)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
MarkReadMarkRead

Return type

GenericSuccess

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

removeChatReaction

ReactionResponse removeChatReaction(chat_session_id, message_id, RemoveReaction)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
message_idLong[default to null]
RemoveReactionRemoveReaction

Return type

ReactionResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

restartBotConversation

MessageResponse restartBotConversation(bot_username)

Parameters

NameTypeDescriptionNotes
bot_usernameString[default to null]

Return type

MessageResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

sendBotMessage

ChatMessage sendBotMessage(bot_username, BotInteraction)

Parameters

NameTypeDescriptionNotes
bot_usernameString[default to null]
BotInteractionBotInteraction

Return type

ChatMessage

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

sendChatMessage

ChatMessage sendChatMessage(chat_session_id, SendMessage)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
SendMessageSendMessage

Return type

ChatMessage

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

sendRagQuery

RagQueryResponse sendRagQuery(chat_session_id, RagQueryRequest)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
RagQueryRequestRagQueryRequest

Return type

RagQueryResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

startBotConversation

BotConversationSession startBotConversation(bot_username, StartBotConversation)

Parameters

NameTypeDescriptionNotes
bot_usernameString[default to null]
StartBotConversationStartBotConversation

Return type

BotConversationSession

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

startChat

StartChatResponse startChat(StartChatSessionRequest)

Start a chat session (RAG with AI assistant or Vendor chat)

Unified endpoint to start either a RAG chat with AI assistant or a chat with a vendor. Sessions should only be created when the user sends an actual message. For RAG sessions: Requires `user_type` field. For Vendor sessions: Requires `vendor_location_id` which will be validated.

Parameters

NameTypeDescriptionNotes
StartChatSessionRequestStartChatSessionRequest

Return type

StartChatResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

startDirectChat

StartChatResponse startDirectChat(StartDirectChat)

Start a direct chat with another user

Creates a new direct chat session (or uses existing one) and sends the first message. This is the preferred way to start a chat - sessions should always be created with a message.

Parameters

NameTypeDescriptionNotes
StartDirectChatStartDirectChat

Return type

StartChatResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

transferBotToHuman

MessageResponse transferBotToHuman(bot_username, BotTransfer)

Parameters

NameTypeDescriptionNotes
bot_usernameString[default to null]
BotTransferBotTransfer

Return type

MessageResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

updateChatSessionMetadata

ChatSessionListItem updateChatSessionMetadata(session_id, UpdateSessionMetadata)

Parameters

NameTypeDescriptionNotes
session_idLong[default to null]
UpdateSessionMetadataUpdateSessionMetadata

Return type

ChatSessionListItem

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

uploadChatMedia

ChatMediaUploadResponse uploadChatMedia(chat_session_id, file)

Upload media for a chat session

Uploads a file (image, audio, video, or document) to be used in a chat message. Returns media information including the URL to include in the message payload. Supported file types: - Images: jpg, jpeg, png, gif, webp (max 10MB) - Audio: mp3, wav, ogg, m4a (max 25MB) - Video: mp4, mov, avi, mkv, webm (max 100MB) - Files: pdf, doc, docx, xls, xlsx, etc. (max 50MB)

Parameters

NameTypeDescriptionNotes
chat_session_idLong[default to null]
fileFileThe file to upload[default to null]

Return type

ChatMediaUploadResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json; charset=utf-8