Conversations
Thread and manage communication history.
Overview
Conversations group messages by:
- Contact
- Channel
- Thread ID
- Session
Conversation Structure
Conversation
├── Contact (who)
├── Gateway (channel)
├── Messages (history)
└── Metadata (context)Creating Conversations
Automatic
Conversations are created automatically when:
- New contact sends message
- Agent initiates contact
- Webhook receives message
Via API
bash
curl -X POST .../conversations \
-d '{
"contact_id": "contact-123",
"gateway_id": "telegram-bot",
"metadata": {"topic": "support"}
}'Message Threading
Messages are grouped by conversation:
json
{
"conversation_id": "conv-123",
"messages": [
{"role": "user", "content": "Help"},
{"role": "assistant", "content": "How can I help?"},
{"role": "user", "content": "Order issue"}
]
}Identity Resolution
When a message arrives, the system:
- Extracts sender identity (email, phone, etc.)
- Looks up contact
- Finds or creates conversation
- Links message
Metadata
Store context with conversations:
json
{
"metadata": {
"topic": "billing",
"priority": "high",
"order_id": "ORD-123"
}
}Listing Conversations
All Conversations
bash
curl .../conversationsBy Contact
bash
curl ".../conversations?contact_id=contact-123"By Gateway
bash
curl ".../conversations?gateway_id=telegram-bot"API Reference
See Conversations API for complete endpoint documentation.