Skip to content

Conversation API

Develop modeUnverified

View as Markdown

The Conversation API manages real-time chat conversations with users, starting a chat session, sending messages, ending the session, and retrieving conversation history. This is commonly used for customer-support chat scenarios.

See REST API reference for the base URL and authentication header every request below needs.

Start Conversation Session: initiate a new chat conversation session with a user.

Request body:

Field Type Need Notes
targetSymphonaAgentID string (UUID) Required The Agent the user will interact with.
channelType string Optional Channel type (only Web Chat is supported).
channelName string Optional Name given to this conversation instance.
userFirstName string Optional The user’s first name.
userLastName string Optional The user’s last name.
userID string Optional The ID of the user having the conversation.
userEmail array of strings Optional The user’s email address(es).
userPhone array of strings Optional The user’s phone number(s).

Example request:

curl --location 'https://app.symphona.ai/dashboard/api/v1/conversation/startSession' \
--header 'apiKey: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"channelType": "Web Chat",
"channelName": "Test",
"targetSymphonaAgentID": "0201f741-cdeb-45c9-a12e-7bf33dcb7b35",
"userID": "user111"
}'

Sample response (200 OK):

{
"conversationSessionID": "609c655b-48a3-49fb-94be-7a2d8d2b616a",
"message": "Hello! How can I assist you today?"
}

Send Message: send a message within an ongoing conversation session. Either the user or the Agent side can call this to add a message to the chat.

Request body (all fields required):

Field Type Notes
conversationSessionID string The session ID returned by startSession.
message string The message to send.

Example request:

curl --location 'https://app.symphona.ai/dashboard/api/v1/conversation/sendMessage' \
--header 'apiKey: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"conversationSessionID": "609c655b-48a3-49fb-94be-7a2d8d2b616a",
"message": "How are you doing today?"
}'

Sample response (200 OK):

{
"response": "I'm doing well, thank you! How can I assist you today?"
}

End Conversation Session: terminate an active conversation session, indicating the chat has concluded (resolved or otherwise ended).

Request body (required):

Field Type Notes
conversationSessionID string The session ID to end.

Example request:

curl --location 'https://app.symphona.ai/dashboard/api/v1/conversation/endSession' \
--header 'apiKey: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"conversationSessionID": "609c655b-48a3-49fb-94be-7a2d8d2b616a"
}'

Sample response: 200 OK with no body means the conversation ended.

Get Conversation History: retrieve a list of closed conversation sessions, for example past chats that may need follow-up or review.

Query parameters (none mandatory)

Parameter Type Default Notes
sortOrder string firstClosed How the list is sorted.
isAscending string true Sort direction.
pageNumber int32 0 Page of results to return.
pageSize int32 25 Number of results per page.

Example request:

curl --location 'https://app.symphona.ai/dashboard/api/v1/conversation/history?pageNumber=0' \
--header 'apiKey: xxxxxx'

Sample response (200 OK):

{
"content": [],
"number": 0,
"size": 25,
"totalElements": 0,
"last": true,
"first": true,
"numberOfElements": 0,
"totalPages": 0,
"hasContent": false
}