Unified Inbox
Aggregates comments and messages from connected social platforms.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/inbox | List conversations |
| GET | /api/inbox/:id | Get conversation thread |
| POST | /api/inbox/:id/reply | Reply to message/comment |
| POST | /api/inbox/:id/archive | Archive conversation |
| POST | /api/inbox/:id/sentiment | Update sentiment label |
| POST | /api/inbox/bulk | Bulk actions |
Data Model
prisma
model InboxConversation {
id String
companyId String
socialAccountId String
platform String
type String // 'comment', 'dm', 'mention'
participantId String // External user ID
participantName String
sentiment String? // 'positive', 'neutral', 'negative'
isArchived Boolean
lastMessageAt DateTime
messages InboxMessage[]
}
model InboxMessage {
id String
conversationId String
direction String // 'inbound', 'outbound'
content String
sentAt DateTime
externalId String? // Platform's message ID
}Platform Support
| Platform | Comments | DMs | Mentions |
|---|---|---|---|
| Twitter/X | ✅ | ✅ | ✅ |
| ✅ | ✅ | ✅ | |
| ✅ | ✅ | ❌ | |
| ❌ | ❌ | ❌ | |
| ❌ | ❌ | ❌ |
Sync Process
- Webhook receives new activity
- Fetch full conversation/thread
- Upsert into InboxConversation
- AI sentiment analysis (optional)
- Notify user if enabled
Sentiment Analysis
Uses AI to classify message sentiment:
- Positive: Praise, thanks, excitement
- Neutral: Questions, general
- Negative: Complaints, issues