curl -X GET "https://api.ansa.so/conversations?agentId=agent_xxx&limit=10" \
-H "Authorization: Bearer your-api-key"
{
"data": [
{
"id": "conv_xxx",
"agentId": "agent_xxx",
"title": "Question about pricing",
"messageCount": 5,
"createdAt": "2024-01-22T14:30:00Z",
"updatedAt": "2024-01-22T14:35:00Z"
}
],
"pagination": {
"total": 150,
"limit": 10,
"offset": 0
}
}
Access conversation history
curl -X GET "https://api.ansa.so/conversations?agentId=agent_xxx&limit=10" \
-H "Authorization: Bearer your-api-key"
{
"data": [
{
"id": "conv_xxx",
"agentId": "agent_xxx",
"title": "Question about pricing",
"messageCount": 5,
"createdAt": "2024-01-22T14:30:00Z",
"updatedAt": "2024-01-22T14:35:00Z"
}
],
"pagination": {
"total": 150,
"limit": 10,
"offset": 0
}
}
curl -X GET "https://api.ansa.so/conversations?agentId=agent_xxx&limit=10" \
-H "Authorization: Bearer your-api-key"
{
"data": [
{
"id": "conv_xxx",
"agentId": "agent_xxx",
"title": "Question about pricing",
"messageCount": 5,
"createdAt": "2024-01-22T14:30:00Z",
"updatedAt": "2024-01-22T14:35:00Z"
}
],
"pagination": {
"total": 150,
"limit": 10,
"offset": 0
}
}
GET /conversations/:id
curl -X GET https://api.ansa.so/conversations/conv_xxx \
-H "Authorization: Bearer your-api-key"
{
"data": {
"id": "conv_xxx",
"agentId": "agent_xxx",
"title": "Question about pricing",
"messages": [
{
"id": "msg_1",
"role": "user",
"content": "What's your pricing?",
"createdAt": "2024-01-22T14:30:00Z"
},
{
"id": "msg_2",
"role": "assistant",
"content": "We offer three plans: Starter at $29/mo, Growth at $99/mo, and Pro at $299/mo.",
"createdAt": "2024-01-22T14:30:05Z"
}
],
"createdAt": "2024-01-22T14:30:00Z"
}
}
DELETE /conversations/:id
curl -X DELETE https://api.ansa.so/conversations/conv_xxx \
-H "Authorization: Bearer your-api-key"
POST /conversations/:id/feedback
"up" or "down"curl -X POST https://api.ansa.so/conversations/conv_xxx/feedback \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"messageId": "msg_2",
"rating": "up"
}'