KasarKasar Docs
API Reference

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/threads

Returns a paginated list of email threads for the current user.

Query Parameters

ParameterTypeDefaultDescription
channelstringFilter by channel (e.g. gmail, outlook)
is_readbooleanFilter by read status. true for read, false for unread.
sort_bystringlast_message_atSort field
sort_dirstringdescSort direction: asc or desc
cursorstringPagination cursor from a previous response
limitinteger20Number 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

ParameterTypeDescription
idUUIDThe thread ID

Query Parameters

ParameterTypeDefaultDescription
message_cursorstringCursor for paginating messages within the thread
message_limitinteger50Number 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

ParameterTypeDescription
idUUIDThe 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

ParameterTypeDescription
idUUIDThe 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

StatusCodeDescription
404RECORD_NOT_FOUNDNo interaction found with the given ID
403PERMISSION_DENIEDToken lacks permission, or interaction belongs to another user

On this page