Conversations
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
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"
}
Start a new conversation using either an email, SMS or voice as the communication method. The response includes the conversation ID.
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": "test@test.com",
"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
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"
}
]
}
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.
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"
}
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"}
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"
}
Delete all conversations associated with specified user in current agent.
Conversation user ID
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
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