REST API Specs¶
The Angular library talks to the backend through a small REST API. The Spring Boot integration implements it, and any other backend that implements the same contract works with the Angular library too.
The full machine-readable contract is the OpenAPI spec in
docs/openapi.yaml
in the
repository. This page sums it up.
Conventions¶
- All endpoints live under
/assistant. - Every session belongs to one agent, and a session id is only unique within that agent. Sessions are therefore always
addressed under their agent:
/assistant/agents/{agentId}/sessions/{sessionId}. - Request and response bodies are JSON. The chat endpoint is the exception: it answers with server-sent events.
- The API does not authenticate requests itself. The host application secures
/assistant/**, for example with Spring Security (see Spring Integration). - The endpoints that read or change chat history (
sessions,events,close,grants) answer404when the backend keeps no history. The question endpoint answers404when the backend doesn't support questions. - When the backend checks access, any endpoint can answer
401(the caller is not authenticated) or403(the caller is not allowed, for example on a session it doesn't own and that wasn't shared with it).
Endpoints¶
| Method | Path | Operation |
|---|---|---|
GET |
/assistant/agents |
List the agents |
POST |
/assistant/agents/{agentId}/chat |
Chat with an agent |
GET |
/assistant/agents/{agentId}/sessions |
List sessions |
DELETE |
/assistant/agents/{agentId}/sessions |
Delete all sessions |
DELETE |
/assistant/agents/{agentId}/sessions/{sessionId} |
Delete a session |
PUT |
/assistant/agents/{agentId}/sessions/{sessionId}/title |
Rename a session |
GET |
/assistant/agents/{agentId}/sessions/{sessionId}/events |
Read session history |
POST |
/assistant/agents/{agentId}/sessions/{sessionId}/close |
Close a session |
POST |
/assistant/agents/{agentId}/sessions/{sessionId}/questions/{questionId} |
Answer a question |
POST |
/assistant/agents/{agentId}/sessions/{sessionId}/grants |
Share a session |
GET |
/assistant/agents/{agentId}/sessions/{sessionId}/grants |
List grants |
DELETE |
/assistant/agents/{agentId}/sessions/{sessionId}/grants |
Revoke a grant |
List the agents¶
GET /assistant/agents
Returns the public agents as an array of AgentDetails. The first agent is the default. Private
agents, such as the internal title-agent, are left out.
[
{
"id": "memory-agent",
"name": "Memory Agent",
"description": null,
"hasMemory": true,
"reportToolCalls": true,
"reportThinking": true
}
]
Chat with an agent¶
POST /assistant/agents/{agentId}/chat
Sends the conversation to the agent and streams the run back as server-sent events. The body is a
ChatRequest:
{
"sessionId": null,
"messages": [
{ "role": "user", "content": [{ "type": "text", "text": "Hello!" }] }
]
}
- A request without a
sessionId(or with a blank one) starts a new session. The new id is sent in the firsttitleevent. - The latest
usermessage is the prompt of this turn. A request with noassistantmessage is treated as the first turn, and the backend generates a title for the conversation. - The backend drops
systemanddevelopermessages sent by the client, unlessaeon.assistant.allow-client-system-messagesis enabled. - A session runs one request at a time.
- The stream times out after one hour. Closing the stream cancels the run.
| Status | Meaning |
|---|---|
200 |
The run is streamed as text/event-stream. |
400 |
The request is malformed: a message, role or content is missing. |
404 |
No agent has that id. |
409 |
The session is closed, or a request is already running on it. |
The error statuses are only returned before streaming starts. If the run fails after the stream has started, the stream is aborted.
Chat stream¶
The event field of each server-sent event names the kind of event, and data holds its JSON payload:
| Event | Payload | When |
|---|---|---|
title |
TitleEvent |
Always first. Carries the session id, and the generated title on the first turn only. |
message |
Message |
The agent's answer. The user's prompt is never streamed back. |
text |
TextEvent |
Text the model wrote between tool calls, if the agent reports tool calls. |
tool |
ToolExecutionEvent |
A tool call started, then completed or failed, if the agent reports tool calls. |
thinking |
ThinkingEvent |
Reasoning produced by the model, if the agent reports its thinking. |
question |
QuestionRequest |
A question the agent is waiting on. Answer it with the question endpoint. |
event:title
data:{"title":"Greetings","sessionId":"0b6c6f0e-2f4e-4b8e-9f3e-5c1d2a7b9e10"}
event:message
data:{"timestamp":"2026-10-05T09:25:00Z","role":"assistant","content":[{"type":"text","text":"Hi! How can I help?"}],"agentId":"assistant","agentName":"Assistant","type":"message"}
List sessions¶
GET /assistant/agents/{agentId}/sessions
Returns the sessions of the agent as an array of ChatSession, most recently used first.
| Status | Meaning |
|---|---|
200 |
The list of sessions. |
404 |
No history is kept. |
Delete all sessions¶
DELETE /assistant/agents/{agentId}/sessions
Deletes every session of the agent along with its history. A run still in progress is allowed to finish, and anything it reports afterwards is recorded as a new session.
| Status | Meaning |
|---|---|
200 |
The sessions are deleted. |
404 |
No history is kept. |
Delete a session¶
DELETE /assistant/agents/{agentId}/sessions/{sessionId}
Deletes a session along with its history. A run still in progress is allowed to finish, and anything it reports afterwards is recorded as a new session.
| Status | Meaning |
|---|---|
200 |
The session is deleted. |
404 |
No history is kept, or the session is unknown. |
Rename a session¶
PUT /assistant/agents/{agentId}/sessions/{sessionId}/title
Renames a session. Only its owner can do this. Once renamed, the session keeps this title: the title generated on the
first turn no longer replaces it. The body is a SessionTitle:
| Status | Meaning |
|---|---|
200 |
The session is renamed. |
400 |
The title is missing or blank. |
403 |
The caller is not the owner of the session. |
404 |
No history is kept, or the session is unknown. |
Read history¶
GET /assistant/agents/{agentId}/sessions/{sessionId}/events?from={timestamp}
Returns the events of a session in the order they happened, as an array of ChatEvent, so the client
can show the conversation again. Events the client would not have seen live are left out: tool calls, the text written
between them, and the reasoning of agents that don't report it.
The optional from query parameter (ISO-8601 date-time, for example 2026-10-05T09:00:00Z) only returns the events
that happened at that time or later.
| Status | Meaning |
|---|---|
200 |
The events. Empty if nothing was recorded for the session. |
404 |
No history is kept. |
Close a session¶
POST /assistant/agents/{agentId}/sessions/{sessionId}/close
Closes a session. It no longer accepts messages: later chat requests on it fail with 409. A run still in progress is
allowed to finish.
| Status | Meaning |
|---|---|
200 |
The session is closed. |
404 |
No history is kept, or the session is unknown. |
Answer a question¶
POST /assistant/agents/{agentId}/sessions/{sessionId}/questions/{questionId}
Sends the user's answers to a question the agent is waiting on, as announced by a question event of the chat stream.
The body is an array of QuestionAnswer:
| Status | Meaning |
|---|---|
200 |
The waiting run received the answers. |
404 |
The session has no such pending question (including a question from another session or another agent), or the backend doesn't support questions. |
409 |
The question has already been answered. |
Session grants¶
The owner of a session can share it with other users. A grantee can send messages, read the history, close the session and answer its questions, but can't rename it, delete it or manage its grants. Only the owner can call these endpoints.
| Method | Path | Description |
|---|---|---|
POST |
/assistant/agents/{agentId}/sessions/{sessionId}/grants |
Adds a grant. The body is a SessionGrant. |
GET |
/assistant/agents/{agentId}/sessions/{sessionId}/grants |
Returns the grants as an array of SessionGrant, in the order they were added. |
DELETE |
/assistant/agents/{agentId}/sessions/{sessionId}/grants?type=USER&grantee=alice |
Revokes a grant. Use ?type=ALL to revoke a grant to everyone. |
| Status | Meaning |
|---|---|
200 |
The grant was added or revoked, or the grants are returned. |
400 |
The type or grantee is invalid, or the sessionId of the body doesn't match the path. |
403 |
The caller is not the owner of the session. |
404 |
No history is kept, or the session is unknown. For DELETE, also when the session has no such grant. |
Schemas¶
Fields marked "nullable" may be null or missing.
AgentDetails¶
An agent the client can talk to.
| Field | Type | Description |
|---|---|---|
id |
string |
Id of the agent, used in every path. |
name |
string |
Display name. |
description |
string, nullable |
Description of the agent. |
hasMemory |
boolean |
Whether the agent remembers the previous turns of the session. |
reportToolCalls |
boolean |
Whether the agent reports the tools it calls while it works. |
reportThinking |
boolean |
Whether the agent reports its reasoning while it works. |
Info
Agents with hasMemory: true only need the new message. For other agents, the client sends the whole conversation
with every request.
ChatSession¶
An existing session.
| Field | Type | Description |
|---|---|---|
sessionId |
string |
Id of the session. |
title |
string, nullable |
New Chat until a title is generated on the first turn, or the title set by the owner. null if none was recorded. |
open |
boolean |
Whether the session still accepts messages. |
SessionTitle¶
| Field | Type | Description |
|---|---|---|
title |
string |
New title. Trimmed before it is recorded. |
ChatRequest¶
| Field | Type | Description |
|---|---|---|
id |
string, nullable |
Optional id of the request. |
sessionId |
string, nullable |
Session to chat in. A new session is started when missing or blank. |
messages |
Message[] |
The conversation. The latest user message is the prompt. |
TitleEvent¶
The first event of every chat stream.
| Field | Type | Description |
|---|---|---|
sessionId |
string |
Id of the session the run belongs to. |
title |
string |
Generated title, on the first turn only. New Chat if no title could be generated. |
ChatEvent¶
An event of a conversation, as returned by the history endpoint. It is one of Message,
TextEvent, ThinkingEvent or ToolExecutionEvent, told
apart by type. Every event has these fields:
| Field | Type | Description |
|---|---|---|
type |
string |
Kind of event, also the name of the stream event it is sent as. |
timestamp |
date-time, nullable | When the event happened. null if it hasn't been recorded yet. |
The server writes type but doesn't need it when reading: a payload without type is read the same way.
Message¶
A message of the conversation (type: message).
| Field | Type | Description |
|---|---|---|
role |
string |
user or assistant. system and developer messages from the client are dropped unless the backend allows them. |
content |
Content[] |
Parts of the message. |
agentId |
string, nullable |
Agent that wrote an assistant message. |
agentName |
string, nullable |
Name of the agent that wrote an assistant message. |
TextEvent¶
Text the model wrote between tool calls (type: text).
| Field | Type | Description |
|---|---|---|
content |
string |
The text. |
ThinkingEvent¶
Reasoning the model produced before answering (type: thinking).
| Field | Type | Description |
|---|---|---|
content |
string |
The reasoning. |
ToolExecutionEvent¶
A tool call (type: tool). Each call is reported twice: first as STARTED, then as COMPLETED or FAILED, both
with the same toolCallId.
| Field | Type | Description |
|---|---|---|
toolCallId |
string, nullable |
Id the model gave the call. When null, the outcome is matched to the call by tool name only. |
toolName |
string |
Name of the tool. |
toolDescription |
string, nullable |
Description of the tool. |
arguments |
string, nullable |
Arguments as the model wrote them, normally a JSON object. |
result |
string, nullable |
What the tool returned. COMPLETED only. |
error |
string, nullable |
Why the call failed. FAILED only. |
status |
string |
STARTED, COMPLETED or FAILED. |
Content¶
A part of a message, told apart by type. A part without a type is read as text.
| Field | Type | Description |
|---|---|---|
type |
text |
|
text |
string |
The text. |
| Field | Type | Description |
|---|---|---|
type |
image |
|
imageUrl |
string |
URL of the image, usually a data: URI (data:image/png;base64,...). |
| Field | Type | Description |
|---|---|---|
type |
audio |
|
data |
string, nullable |
The recording, base64-encoded. |
transcript |
string, nullable |
Transcript of the recording. |
A question the agent asked the user, kept in the transcript with its answers.
| Field | Type | Description |
|---|---|---|
type |
question |
|
questionId |
string |
Id of the question. |
questions |
UserQuestion[] |
The questions asked. |
answers |
QuestionAnswer[], nullable |
The answers received. |
status |
string |
pending, answered or cancelled. |
QuestionRequest¶
A set of questions sent to the client while a run is in progress (question event). Answer it with the
question endpoint.
| Field | Type | Description |
|---|---|---|
questionId |
string |
Id of the question, used in the question endpoint. |
questions |
UserQuestion[] |
The questions to ask. |
UserQuestion¶
A single question asked to the user. Free-form text is always accepted in addition to the options.
| Field | Type | Description |
|---|---|---|
name |
string |
Identifies the question. The answer refers to it. |
question |
string |
The question text. |
options |
QuestionOption[], nullable |
Ordered choices. The first one is the recommended choice. |
allowMultiple |
boolean |
Whether several options may be selected. |
QuestionOption¶
| Field | Type | Description |
|---|---|---|
title |
string |
Label of the choice. |
description |
string, nullable |
Explanation of the choice. |
SessionGrant¶
| Field | Type | Description |
|---|---|---|
sessionId |
string |
Id of the session. Must match the path. |
type |
string |
USER shares the session with one user, ALL with every user allowed to use the assistant. |
grantee |
string, nullable |
The user the session is shared with. Required for USER, ignored for ALL. |
QuestionAnswer¶
The user's answer to one question.
| Field | Type | Description |
|---|---|---|
name |
string |
Name of the question answered. |
selected |
string[], nullable |
Titles of the selected options. |
text |
string, nullable |
Free-form text entered by the user. |