Inbox
Read email threads and messages from synced accounts. Manage read status and access individual interactions.
The inbox endpoints let you access email threads from accounts synced to Kasar. Threads are scoped to the authenticated user's connected email accounts, so each user only sees their own inbox.
List Threads
GET /api/v1/inbox/threadsReturns a paginated list of email threads for the current user.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
channel | string | Filter by channel (e.g. gmail, outlook) | |
is_read | boolean | Filter by read status. true for read, false for unread. | |
sort_by | string | last_message_at | Sort field |
sort_dir | string | desc | Sort direction: asc or desc |
cursor | string | Pagination cursor from a previous response | |
limit | integer | 20 | Number of threads per page (max 100) |
Example Request
curl -X GET "https://kasar.app/api/v1/inbox/threads?is_read=false&limit=25" \
-H "Authorization: Bearer ksr_a1b2c3d4e5f6..."Response
{
"data": [
{
"id": "thr_a1b2c3d4-...",
"subject": "Q2 Partnership Proposal",
"snippet": "Hi team, attached is the revised proposal...",
"participants": ["alice@example.com", "bob@acme.com"],
"message_count": 4,
"is_read": false,
"last_message_at": "2025-03-12T16:45:00Z",
"channel": "gmail"
}
],
"total": 142,
"nextCursor": "eyJ0aHJlYWRfaWQiOi..."
}User isolation is enforced at the SQL level. The API only returns threads from email accounts owned by the authenticated user.
Get Thread with Messages
GET /api/v1/inbox/threads/{id}Returns a single thread along with its messages, paginated separately.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | The thread ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
message_cursor | string | Cursor for paginating messages within the thread | |
message_limit | integer | 50 | Number of messages to return (max 200) |
Example Request
curl -X GET "https://kasar.app/api/v1/inbox/threads/thr_a1b2c3d4-...?message_limit=20" \
-H "Authorization: Bearer ksr_a1b2c3d4e5f6..."Response
{
"thread": {
"id": "thr_a1b2c3d4-...",
"subject": "Q2 Partnership Proposal",
"is_read": true,
"last_message_at": "2025-03-12T16:45:00Z"
},
"messages": [
{
"id": "msg_e5f6a7b8-...",
"from": "alice@example.com",
"to": ["bob@acme.com"],
"body": "Hi Bob, here is the revised proposal...",
"sent_at": "2025-03-12T16:45:00Z"
}
],
"total_messages": 4,
"next_message_cursor": null
}When next_message_cursor is null, all messages in the thread have been returned.
Mark Thread Read / Unread
PUT /api/v1/inbox/threads/{id}Updates the read status of a thread.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | The thread ID |
Request Body
{
"is_read": true
}Example Request
curl -X PUT "https://kasar.app/api/v1/inbox/threads/thr_a1b2c3d4-..." \
-H "Authorization: Bearer ksr_a1b2c3d4e5f6..." \
-H "Content-Type: application/json" \
-d '{"is_read": true}'Response
{
"data": {
"id": "thr_a1b2c3d4-...",
"is_read": true
}
}Get Single Interaction
GET /api/v1/interactions/{id}Returns a single interaction (email, call, meeting, etc.) by ID. Email metadata is automatically stripped from the response.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | The interaction ID |
Example Request
curl -X GET "https://kasar.app/api/v1/interactions/msg_e5f6a7b8-..." \
-H "Authorization: Bearer ksr_a1b2c3d4e5f6..."Response
{
"data": {
"id": "msg_e5f6a7b8-...",
"channel": "email",
"direction": "outbound",
"subject": "Q2 Partnership Proposal",
"body": "Hi Bob, here is the revised proposal...",
"participants": ["alice@example.com", "bob@acme.com"],
"sent_at": "2025-03-12T16:45:00Z"
}
}The body field is only returned when the token has the inbox:content scope. Without it, the response includes metadata but the body is omitted.
Error Responses
| Status | Code | Description |
|---|---|---|
| 404 | RECORD_NOT_FOUND | No interaction found with the given ID |
| 403 | PERMISSION_DENIED | Token lacks permission, or interaction belongs to another user |