Conversations
Get Conversation
Retrieve a specific conversation by ID
Endpoint
GET https://api.perform.chat/rest/v1/conversations/:idRequest Body
{
"keyId": "your-key-id",
"keySecret": "your-key-secret"
}Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Conversation ID |
Response
{
"id": "conv_123",
"title": "Help with billing question",
"customer_user_id": "cu_123",
"message_count": 12,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T11:45:00Z"
}Example Request
async function getConversation(conversationId) {
const response = await axios.get(
`https://api.performchat.com/rest/v1/v1/conversations/${conversationId}`,
{
data: {
keyId: process.env.API_KEY_ID,
keySecret: process.env.API_KEY_SECRET
}
}
)
return response.data
}Error Responses
| Status | Description |
|---|---|
| 404 | Conversation not found or doesn't belong to company |
| 401 | Invalid API credentials |
| 500 | Internal server error |
Use Cases
Verify Conversation Exists
async function conversationExists(conversationId) {
try {
await getConversation(conversationId)
return true
} catch (error) {
if (error.response?.status === 404) {
return false
}
throw error
}
}Get Conversation Metadata
async function getConversationInfo(conversationId) {
const conv = await getConversation(conversationId)
return {
title: conv.title,
messageCount: conv.message_count,
duration: new Date(conv.updated_at) - new Date(conv.created_at),
isActive: new Date() - new Date(conv.updated_at) < 3600000 // 1 hour
}
}Related Endpoints
- List Conversations - List all conversations
- Get Messages - Get conversation messages