Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.animam.ai/llms.txt

Use this file to discover all available pages before exploring further.

Endpoints to view conversation history.

GET /tenants//conversations

List conversations. Required scope: conversations:read

Request

curl https://api.animam.ai/tenants/my-company/conversations \
  -H "Authorization: Bearer ak_your_token"

Query Parameters

ParamTypeDescription
pagenumberPage (default: 1)
limitnumberConversations per page (default: 20)
fromstringStart date (ISO 8601)
tostringEnd date (ISO 8601)
segmentstringFilter by segment

Response

{
  "conversations": [
    {
      "id": "conv_abc123",
      "sessionId": "sess_xyz789",
      "segment": "pricing",
      "messageCount": 8,
      "startedAt": "2024-01-25T10:30:00Z",
      "lastMessageAt": "2024-01-25T10:45:00Z",
      "preview": "What are your prices?"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 156
  }
}

GET /tenants//conversations/

Retrieve a complete conversation with all messages. Required scope: conversations:read

Request

curl https://api.animam.ai/tenants/my-company/conversations/conv_abc123 \
  -H "Authorization: Bearer ak_your_token"

Response

{
  "id": "conv_abc123",
  "sessionId": "sess_xyz789",
  "segment": "pricing",
  "startedAt": "2024-01-25T10:30:00Z",
  "lastMessageAt": "2024-01-25T10:45:00Z",
  "messages": [
    {
      "id": "msg_001",
      "role": "user",
      "content": "Hello, what are your prices?",
      "timestamp": "2024-01-25T10:30:00Z"
    },
    {
      "id": "msg_002",
      "role": "assistant",
      "content": "Hello! We offer 3 plans...",
      "timestamp": "2024-01-25T10:30:02Z"
    },
    {
      "id": "msg_003",
      "role": "user",
      "content": "And for the Pro plan?",
      "timestamp": "2024-01-25T10:31:00Z"
    }
  ],
  "metadata": {
    "userAgent": "Mozilla/5.0...",
    "referrer": "https://google.com",
    "page": "/pricing"
  }
}

GET /tenants//conversations/export

Export conversations to CSV. Required scope: conversations:read

Request

curl https://api.animam.ai/tenants/my-company/conversations/export \
  -H "Authorization: Bearer ak_your_token" \
  -o conversations.csv

Query Parameters

ParamTypeDescription
fromstringStart date (required)
tostringEnd date (required)
formatstringcsv or json (default: csv)

Response (CSV)

conversation_id,timestamp,role,content,segment
conv_abc123,2024-01-25T10:30:00Z,user,"What are your prices?",pricing
conv_abc123,2024-01-25T10:30:02Z,assistant,"We offer 3 plans...",pricing

Statistics

GET /tenants//conversations/stats

Required scope: conversations:read
curl https://api.animam.ai/tenants/my-company/conversations/stats?period=7d \
  -H "Authorization: Bearer ak_your_token"

Response

{
  "period": "7d",
  "totalConversations": 234,
  "totalMessages": 1567,
  "avgMessagesPerConversation": 6.7,
  "avgResponseTime": "1.2s",
  "bySegment": {
    "landing": 89,
    "pricing": 67,
    "support": 78
  },
  "byDay": [
    { "date": "2024-01-19", "conversations": 32 },
    { "date": "2024-01-20", "conversations": 28 }
  ]
}