Conversations
Fetches a conversations by agent API key. The response includes the conversation details.
Custom authentication header
Page number
Page size
Order by
Order direction
If true, returns conversations with at least one feedback
Successfully received conversations.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Unexpected error occurred while processing the request. Please try again later.
GET /external/conversations HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
"currentPage": 1,
"pageSize": 1,
"totalItems": 1,
"totalPages": 1,
"hasNextPage": true,
"hasPreviousPage": true,
"data": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"conversationUserId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"title": "Conversation Title",
"score": 4,
"summary": "This is a summary of the conversation.",
"aiConversationId": "conv_h435hi34h5i43i5sdfdfs",
"metadata": {
"customData": {
"key1": "value1",
"key2": "value2"
}
},
"aiCallId": "call_h435hi34h5i43i5",
"mode": "manual",
"conversationStateId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"feedbacks": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"voteType": "down",
"question": "text",
"answer": "text",
"comment": "text",
"userEmail": "text",
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z"
}
]
}
]
}Creates a new conversation . The response includes the conversation ID.
Custom authentication header
Conversation user ID
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bConversation title
New Conversation TitleConversation context
New conversation contextConversation custom data
{"key1":"value1","key2":"value2"}Conversation state ID
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bSuccessfully created a new conversation.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Unexpected error occurred while processing the request. Please try again later.
POST /external/conversations HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 239
{
"conversationUserId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"title": "New Conversation Title",
"context": "New conversation context",
"customData": {
"key1": "value1",
"key2": "value2"
},
"conversationStateId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b"
}{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"conversationUserId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"title": "Conversation Title",
"score": 4,
"summary": "This is a summary of the conversation.",
"aiConversationId": "conv_h435hi34h5i43i5sdfdfs",
"metadata": {
"customData": {
"key1": "value1",
"key2": "value2"
}
},
"aiCallId": "call_h435hi34h5i43i5",
"mode": "manual",
"conversationStateId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b"
}Delete all conversations associated with specified user in current agent.
Custom authentication header
Conversation user ID
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bSuccessfully delete all user conversations in current agent.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Unexpected error occurred while processing the request. Please try again later.
DELETE /external/conversations HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 61
{
"conversationUserId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b"
}No content
Fetches a conversation by its unique ID. The response includes the conversation details.
Custom authentication header
The ID of the conversation to retrieve.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bSuccessfully retrieved the conversation.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Conversation not found.
Unexpected error occurred while processing the request. Please try again later.
GET /external/conversations/{id} HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"conversationUserId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"title": "Conversation Title",
"score": 4,
"summary": "This is a summary of the conversation.",
"aiConversationId": "conv_h435hi34h5i43i5sdfdfs",
"metadata": {
"customData": {
"key1": "value1",
"key2": "value2"
}
},
"aiCallId": "call_h435hi34h5i43i5",
"mode": "manual",
"conversationStateId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"feedbacks": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"voteType": "down",
"question": "text",
"answer": "text",
"comment": "text",
"userEmail": "text",
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z"
}
]
}Updates an existing conversation by ID. Returns the updated conversation.
Custom authentication header
The ID of the conversation to update.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bConversation title
Updated Conversation TitleConversation context
Updated conversation contextConversation status
activePossible values: Conversation mode
aiPossible values: Conversation state ID
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bSuccessfully updated the conversation.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Conversation not found.
Unexpected error occurred while processing the request. Please try again later.
PUT /external/conversations/{id} HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 170
{
"title": "Updated Conversation Title",
"context": "Updated conversation context",
"status": "active",
"mode": "ai",
"conversationStateId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b"
}{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"conversationUserId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"title": "Conversation Title",
"score": 4,
"summary": "This is a summary of the conversation.",
"aiConversationId": "conv_h435hi34h5i43i5sdfdfs",
"metadata": {
"customData": {
"key1": "value1",
"key2": "value2"
}
},
"aiCallId": "call_h435hi34h5i43i5",
"mode": "manual",
"conversationStateId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b"
}Start a new conversation using either an email, SMS or voice as the communication method. The response includes the conversation ID.
Custom authentication header
Successfully start a new conversation.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Unexpected error occurred while processing the request. Please try again later.
POST /external/conversations/start HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 453
{
"firstName": "John",
"lastName": "Doe",
"context": "Support",
"conversationContext": "Support",
"source": "webchat",
"fkId": "123456",
"fkUserId": "123456",
"customData": {
"key1": "value1",
"key2": "value2"
},
"conversationStateId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"channel": "email",
"email": "[email protected]",
"emailSubject": "New Conversation",
"emailIntroduction": "New Conversation",
"includeSignatureInEmail": false,
"phoneNumber": "+1234567890",
"resetConversation": false
}{
"conversationId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b"
}Fetches all messages associated with a specific conversation ID.
Custom authentication header
The ID of the conversation to retrieve messages for.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bIf true, returns conversation messages with feedbacks
Message created at order direction. Default: ASC
Successfully retrieved conversation messages.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Unexpected error occurred while processing the request. Please try again later.
GET /external/conversations/{id}/messages HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
"messages": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"message": "Hello, how can I help you?",
"rawMessage": "Raw message example",
"conversationId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"senderRole": "conversation_user",
"conversationMessageId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"source": "api",
"createdAt": "2022-01-01T00:00:00.000Z",
"conversationMessageFeedbacks": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"voteType": "down",
"question": "text",
"answer": "text",
"comment": "text",
"userEmail": "text"
}
]
}
]
}Send a new message to an agent using conversationId.
Custom authentication header
The ID of the conversation to send a message to.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bThe message that the user sends to the AI agent
How does quantum entanglement work?Context of the message
User is asking about quantum physics.Successfully processed a message to an agent.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Unexpected error occurred while processing the request. Please try again later.
POST /external/conversations/{id}/messages HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 99
{
"message": "How does quantum entanglement work?",
"context": "User is asking about quantum physics."
}{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"message": "Hello, how can I help you?",
"rawMessage": "Raw message example",
"conversationId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"senderRole": "conversation_user",
"conversationMessageId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"source": "api",
"createdAt": "2022-01-01T00:00:00.000Z",
"conversationMessageFeedbacks": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"voteType": "down",
"question": "text",
"answer": "text",
"comment": "text",
"userEmail": "text"
}
]
}Send a new message to an agent using conversationId.
Custom authentication header
The ID of the conversation to send a message to.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bThe message that the user sends to the AI agent
How does quantum entanglement work?Context of the message
User is asking about quantum physics.Successfully sent a message to an agent.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Unexpected error occurred while processing the request. Please try again later.
POST /external/conversations/{id}/messages/async HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 99
{
"message": "How does quantum entanglement work?",
"context": "User is asking about quantum physics."
}{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"message": "Hello, how can I help you?",
"rawMessage": "Raw message example",
"conversationId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"senderRole": "conversation_user",
"conversationMessageId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"source": "api",
"createdAt": "2022-01-01T00:00:00.000Z",
"conversationMessageFeedbacks": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"voteType": "down",
"question": "text",
"answer": "text",
"comment": "text",
"userEmail": "text"
}
]
}Fetches response on a specific conversation message ID.
Custom authentication header
The ID of the conversation to retrieve message for.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bThe ID of the conversation message to retrieve response for.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bSuccessfully retrieved conversation message.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Unexpected error occurred while processing the request. Please try again later.
GET /external/conversations/{id}/messages/{conversationMessageId}/response-on HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"message": "Hello, how can I help you?",
"rawMessage": "Raw message example",
"conversationId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"senderRole": "conversation_user",
"conversationMessageId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"source": "api",
"createdAt": "2022-01-01T00:00:00.000Z",
"conversationMessageFeedbacks": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"voteType": "down",
"question": "text",
"answer": "text",
"comment": "text",
"userEmail": "text"
}
]
}Send a manual message to a user in a conversation that is in manual mode. Will fail if the conversation is not in manual mode or is a voice conversation.
Custom authentication header
The ID of the conversation to send a message to the user.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bThe message that will be sent to the user
Your appointment has been confirmed for tomorrow at 2pm.The ID of the conversation message that the user sent to the AI agent
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3bMessage sent successfully to the user.
Conversation must be in manual mode and not a voice conversation.
Invalid API key or secret key. Ensure that you are using a valid authentication key.
Conversation not found.
Unexpected error occurred while processing the request. Please try again later.
POST /external/conversations/{id}/send-manual-message HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 133
{
"message": "Your appointment has been confirmed for tomorrow at 2pm.",
"conversationMessageId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b"
}{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"message": "Hello, how can I help you?",
"rawMessage": "Raw message example",
"conversationId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"senderRole": "conversation_user",
"conversationMessageId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"source": "api",
"createdAt": "2022-01-01T00:00:00.000Z",
"conversationMessageFeedbacks": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"voteType": "down",
"question": "text",
"answer": "text",
"comment": "text",
"userEmail": "text"
}
]
}Last updated

