Skip to content
Svanja

Docs API reference

Assistant

Read summaries of the assistant's chats and runs.

The assistant is Svanja’s built-in AI. It replies in Chat and handles the work you give it. These endpoints let you read chats and runs for the person who owns the API key. A run is a single attempt by the assistant to answer a message or complete a piece of work.

Use these endpoints to check what was asked and how much it cost. Rather than returning the full conversation, they give you summaries with short excerpts and usage details. Your API key needs the Assistant area, which is included in both Full access and Read-only keys. For more on how the assistant works, see Chat with the assistant.

Both endpoints use cursor-based pagination. To list the runs for a specific chat:

curl "https://app.svanja.com/api/v1/assistant/runs?chat_id=CHAT_ID" \
  -H "Authorization: Bearer $SVANJA_API_KEY"

When meta.pagination.has_more is true, pass meta.pagination.next_cursor as the cursor parameter to get the next page. If you want to give the assistant work through the API, start a task.

Operations

An operation is one thing you can do, like reading a task or starting one. Its effect says what it changes. Some operations that act outside Svanja or change access wait for a person's approval; the approval flow is on the API overview.

assistant.chat.read Reads only

Read assistant chats.

GET /assistant/chats GET /assistant/chats/{chat_id}

assistant.run.read Reads only

Read assistant runs.

GET /assistant/runs GET /assistant/runs/{run_id}

Endpoints

Paths start at https://app.svanja.com/api/v1. Every endpoint needs an API key unless it says otherwise. A required Idempotency-Key header is listed with the parameters.

GET /assistant/chats List assistant chats

Lists assistant chat summaries owned by the API key's bound visibility user. Provider runtime state, prompts, tools, events, page context, billing internals, and numeric ids are not exposed.

Parameter In Type Required Notes
per_page query integer no Page size. Defaults to 25 and is capped at 100.
cursor query string no Signed cursor returned by the previous assistant chat page.
status query one of active, archived, all no Filter assistant chats by archive state.
created_from query string no Inclusive created_at lower bound. Must include seconds and Z or an explicit UTC offset.
created_to query string no Inclusive created_at upper bound. Must include seconds and Z or an explicit UTC offset.

Status codes: 200, 401, 403, 422, 429

GET /assistant/chats/{chat_id} Show assistant chat

Shows one assistant chat summary for the bound visibility user. Missing, malformed, cross-team, other-user, and deleted chats return the same resource_not_found envelope after capability checks.

Parameter In Type Required Notes
chat_id path string yes Assistant chat public ULID. This is not the internal numeric chat id.

Status codes: 200, 401, 403, 404, 429

GET /assistant/runs List assistant runs

Lists assistant run summaries owned by the API key's bound visibility user. The response includes bounded text excerpts and aggregate usage facts only; raw prompts, tool payloads, events, provider ids, runtime state, page context, billing internals, and numeric ids are excluded.

Parameter In Type Required Notes
per_page query integer no Page size. Defaults to 25 and is capped at 100.
cursor query string no Signed cursor returned by the previous assistant run page.
chat_id query string no Filter runs to one assistant chat public ULID.
status query one of pending, running, awaiting_confirmation, awaiting_user_input, cancelled, completed, denied, failed no Filter assistant runs by status.
created_from query string no Inclusive created_at lower bound. Must include seconds and Z or an explicit UTC offset.
created_to query string no Inclusive created_at upper bound. Must include seconds and Z or an explicit UTC offset.

Status codes: 200, 401, 403, 422, 429

GET /assistant/runs/{run_id} Show assistant run

Shows one assistant run summary for the bound visibility user. Missing, malformed, cross-team, other-user, and deleted runs return the same resource_not_found envelope after capability checks.

Parameter In Type Required Notes
run_id path string yes Assistant run public ULID. This is not the internal numeric run id.

Status codes: 200, 401, 403, 404, 429

This page as plain Markdown, for AI tools: assistant.md

Try Svanja with your own mailbox

Sign up now, and you get an email when your account is ready.