Skip to main content
GET
/
ask
/
sessions
/
{id}
/
messages
curl "https://api.bota.dev/v1/ask/sessions/as_abc123/messages?limit=50" \
  -H "Authorization: Bearer sk_live_..."
{
  "data": [
    {
      "id": "msg_111",
      "role": "user",
      "content": "What did I commit to this week?",
      "parts": [{ "type": "text", "text": "What did I commit to this week?" }],
      "tokens": { "input": null, "output": null, "cached": null },
      "model": null,
      "provider": null,
      "finish_reason": null,
      "created_at": "2026-05-20T10:23:40Z"
    },
    {
      "id": "msg_222",
      "role": "assistant",
      "content": "You agreed to send the budget draft by Friday.",
      "parts": [
        { "type": "text", "text": "You agreed to send the budget draft by Friday." },
        { "type": "citation", "recording_id": "rec_ghi789", "start_ms": 754000 }
      ],
      "tokens": { "input": 1240, "output": 32, "cached": 0 },
      "model": "gemini-2.0-flash",
      "provider": "gemini",
      "finish_reason": "stop",
      "created_at": "2026-05-20T10:23:45Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
Retrieve a session’s messages, oldest first. Assistant messages carry citation parts that deep-link to a recording_id + start_ms.

Authentication

Requires an API key. The session is looked up within the key’s project; an unknown session returns 404. An end-user-scoped key can only read its own sessions.
curl "https://api.bota.dev/v1/ask/sessions/as_abc123/messages?limit=50" \
  -H "Authorization: Bearer sk_live_..."

Path Parameters

id
string
required
Session identifier (as_*).

Query Parameters

limit
integer
default:"20"
Maximum number of messages to return (1–100).
cursor
string
Pagination cursor from a previous response’s next_cursor.

Response

Returns a paginated list of messages, oldest first.
{
  "data": [
    {
      "id": "msg_111",
      "role": "user",
      "content": "What did I commit to this week?",
      "parts": [{ "type": "text", "text": "What did I commit to this week?" }],
      "tokens": { "input": null, "output": null, "cached": null },
      "model": null,
      "provider": null,
      "finish_reason": null,
      "created_at": "2026-05-20T10:23:40Z"
    },
    {
      "id": "msg_222",
      "role": "assistant",
      "content": "You agreed to send the budget draft by Friday.",
      "parts": [
        { "type": "text", "text": "You agreed to send the budget draft by Friday." },
        { "type": "citation", "recording_id": "rec_ghi789", "start_ms": 754000 }
      ],
      "tokens": { "input": 1240, "output": 32, "cached": 0 },
      "model": "gemini-2.0-flash",
      "provider": "gemini",
      "finish_reason": "stop",
      "created_at": "2026-05-20T10:23:45Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Message Fields

FieldTypeDescription
rolestringuser or assistant
contentstringPlain-text message content
partsarrayRich content: text segments and (assistant only) citation parts ({ type, recording_id, start_ms })
tokensobjectToken usage { input, output, cached }; null for user messages
model / providerstring | nullThe model and provider that produced an assistant message
finish_reasonstring | nullWhy generation stopped (assistant only)
created_atstringTimestamp