Fetches a conversations by agent API key. The response includes the conversation details.
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.",
"threadId": "thread_h435hi34h5i43i5",
"metadata": {
"customData": {
"key1": "value1",
"key2": "value2"
}
},
"aiCallId": "call_h435hi34h5i43i5",
"mode": "manual",
"feedbacks": [
{
"id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"voteType": "down",
"question": "text",
"answer": "text",
"comment": "text"
}
]
}
]
}
Creates a new conversation . The response includes the conversation ID.
Conversation user ID
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Conversation title
New Conversation Title
Conversation context
New conversation context
Conversation custom data
{"key1":"value1","key2":"value2"}
Successfully 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: 178
{
"conversationUserId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
"title": "New Conversation Title",
"context": "New conversation context",
"customData": {
"key1": "value1",
"key2": "value2"
}
}
{
"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.",
"threadId": "thread_h435hi34h5i43i5",
"metadata": {
"customData": {
"key1": "value1",
"key2": "value2"
}
},
"aiCallId": "call_h435hi34h5i43i5",
"mode": "manual"
}
Delete all conversations associated with specified user in current agent.
Conversation user ID
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Successfully 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.
The ID of the conversation to retrieve.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Successfully 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.",
"threadId": "thread_h435hi34h5i43i5",
"metadata": {
"customData": {
"key1": "value1",
"key2": "value2"
}
},
"aiCallId": "call_h435hi34h5i43i5",
"mode": "manual"
}
Updates an existing conversation by ID. Returns the updated conversation.
The ID of the conversation to update.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Conversation title
Updated Conversation Title
Conversation context
Updated conversation context
Conversation status
active
Possible values: Conversation mode
ai
Possible values: Successfully 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: 109
{
"title": "Updated Conversation Title",
"context": "Updated conversation context",
"status": "active",
"mode": "ai"
}
{
"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.",
"threadId": "thread_h435hi34h5i43i5",
"metadata": {
"customData": {
"key1": "value1",
"key2": "value2"
}
},
"aiCallId": "call_h435hi34h5i43i5",
"mode": "manual"
}
Start a new conversation using either an email, SMS or voice as the communication method. The response includes the conversation ID.
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: 392
{
"firstName": "John",
"lastName": "Doe",
"context": "Support",
"conversationContext": "Support",
"source": "webchat",
"fkId": "123456",
"fkUserId": "123456",
"customData": {
"key1": "value1",
"key2": "value2"
},
"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.
The ID of the conversation to retrieve messages for.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
If 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"
}
]
}
]
}
Send a new message to an agent using conversationId.
The ID of the conversation to send a message to.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
The message that the user sends to the AI agent
How does quantum entanglement work?
Context of the message
User is asking about quantum physics.
Response from the 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"
}
]
}