Desktop reference · Local API
Turns and approvals
TALOS Desktop local API — Follow a session live, answer its approvals and questions, queue and redirect messages, run your own commands, and give it a goal.
Reference for TALOS Desktop 0.2.4
Follow a session live, answer its approvals and questions, queue and redirect messages, run your own commands, and give it a goal. Paths are relative to /api/v1.
GET /sessions/{sessionId}/events
Section titled “GET /sessions/{sessionId}/events”The live event stream of a session (server-sent events): every message, tool call, approval and state change as it happens.
On reconnection the browser sends Last-Event-ID and the stream resumes after that sequence number (it wins over after). The events are described on the Events page of this reference.
Path
sessionId- The session.
Query
after- The last sequence number already seen, to open the stream after it the first time (a browser sends no
Last-Event-IDon its first connection). Once at most, never empty.
Answers An event stream (text/event-stream).
Errors1
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/cancel
Section titled “POST /sessions/{sessionId}/cancel”Stop a running session.
Path
sessionId- The session.
Body
None: the body is empty.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/stop
Section titled “POST /sessions/{sessionId}/stop”Stop the session’s current turn.
The body may be empty; with { redirectId } it also cancels a redirection in flight.
Path
sessionId- The session.
Body
figlie- Not yet described.
redirectId- The redirection to cancel (a UUID).
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/mcp-elicitation
Section titled “POST /sessions/{sessionId}/mcp-elicitation”Answer an MCP server that asked you for data (a form) or to open a page.
The content of the form goes to the MCP server only: it is not in the answer, the history or the logs.
Path
sessionId- The session.
Body
requestIdrequired- The request, from
McpElicitationRequested. actionrequiredaccept,declineorcancel.content- With
acceptof a form only: the values, matching the schema the server asked for.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/redirect
Section titled “POST /sessions/{sessionId}/redirect”Redirect the running turn with a new message: the agent takes it into account without starting over.
Path
sessionId- The session.
Body
messaggiorequired- The message.
redirectId- An id for this redirection (a UUID), to cancel it with
…/stop.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/shell
Section titled “POST /sessions/{sessionId}/shell”Run a command of yours in the session’s folder (a ! command in the chat); it is recorded in the process ledger.
Path
sessionId- The session.
Body
comandorequired- The command.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/dove-girano-i-comandi
Section titled “POST /sessions/{sessionId}/dove-girano-i-comandi”Choose where the session’s commands run on Windows: WSL 2 or Windows itself.
Path
sessionId- The session.
Body
dovewsl2,windows, ornullfor the default.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/comandi-nella-conversazione
Section titled “POST /sessions/{sessionId}/comandi-nella-conversazione”Choose whether your ! commands and their output enter the model’s conversation (off by default).
Path
sessionId- The session.
Body
accesotrueto include them.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
GET /sessions/{sessionId}/impostazioni-comandi
Section titled “GET /sessions/{sessionId}/impostazioni-comandi”Read the two command settings of a session: where commands run, and whether they enter the conversation.
Path
sessionId- The session.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
GET /sessions/{sessionId}/pending
Section titled “GET /sessions/{sessionId}/pending”The approval or question a session is waiting on, read only: { pending: null } when it waits for nothing.
A parent reads it when a delegated agent below it waits, to draw the card in the parent; the answer goes through that agent’s …/approve or …/question with rispostoDa.
Path
sessionId- The session.
Query
capacita- Not yet described.
Answers The JSON envelope.
Errors1
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/approve
Section titled “POST /sessions/{sessionId}/approve”Answer an approval request of the agent (with the “On request” permission): allow or deny that one action.
The request id is required: there is never an answer “to the last pending request”.
Path
sessionId- The session.
Body
requestIdrequired- The request.
approvatorequiredtrueto allow,falseto deny.ambito- With
approvato: trueonly:cartellato allow the same action in that folder until the session ends,percorsofor that path. Which folder or path is taken from the request, never from the client. rispostoDa- The session you answer from, when the card of a delegated agent is shown in its parent; the server checks it is the agent itself or one of its ancestors.
automazioneModificata- With
approvato: falseonly: “Edit” on an automation card, the changed draft to show instead. obiettivoModificato- With
approvato: falseonly, and not withambitoorautomazioneModificata: “Edit the checks” on the card of a goal the agent proposed (goal_create), the id of the goal you set yourself instead (ob-…). domandaModificata- Not yet described.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/question
Section titled “POST /sessions/{sessionId}/question”Answer a question the agent asked you.
Path
sessionId- The session.
Body
requestIdrequired- The question.
statusrequiredanswered,skipped,cancelledorexpired.answers- With
answeredonly: the answers, by question. rispostoDa- The session you answer from, when the question of a delegated agent is shown in its parent.
showsDetails- Not yet described.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/plan-decision
Section titled “POST /sessions/{sessionId}/plan-decision”Decide on a plan the agent proposed: proceed, proceed accepting its changes, start a clean conversation with it, or keep planning.
The body must be application/json and come from this TALOS window (or carry the token from a client that is not a browser): proceeding raises the session’s permission. The answer is sent once the decision is on disk; the same decision again is idempotent.
Path
sessionId- The session.
Body
requestIdrequired- The plan request.
decisionerequiredprocedi-con-conferma,procedi-accetta-modifiche,conversazione-pulitaorcontinua-a-pianificare.hashrequired- The plan’s fingerprint,
sha256:and 64 hexadecimal digits. feedback- With
continua-a-pianificareonly: what to change (up to 4,000 characters).
Answers The JSON envelope.
Errors3
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
PAYLOAD_LIMIT | 413 | The body is larger than the server accepts: shorten it, or put the text in a file and attach it. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
GET /sessions/{sessionId}/queue
Section titled “GET /sessions/{sessionId}/queue”The messages waiting in the session’s queue, sent after the current turn.
Path
sessionId- The session.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/queue
Section titled “POST /sessions/{sessionId}/queue”Queue a message to send after the current turn.
Path
sessionId- The session.
Body
paginaBrowser- Not yet described.
messaggiorequired- The message.
allegaSeTroppoGrande- Not yet described.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/queue/annulla
Section titled “POST /sessions/{sessionId}/queue/annulla”Remove a queued message, or empty the queue.
Path
sessionId- The session.
Body
id- One message to remove; without it, the whole queue.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/queue/invia
Section titled “POST /sessions/{sessionId}/queue/invia”Send a queued message now: during a turn it enters as a correction, otherwise it resumes the session.
Path
sessionId- The session.
Body
idrequired- The queued message.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
GET /sessions/{sessionId}/goal
Section titled “GET /sessions/{sessionId}/goal”The goal of the conversation as it stands, or null when it has none.
A goal belongs to the main conversation: its text, its state (attivo, in-pausa, bloccato, tetto when a limit of turns or tokens was reached, fatto), why it paused, and its contract — the checks that prove it done — with the last result of each. Setting a goal starts nothing by itself.
Path
sessionId- The session.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/goal
Section titled “POST /sessions/{sessionId}/goal”Set a new goal for the conversation, replacing the one before in whatever state it was; with criteri, the goal is born with its contract.
Not for a delegated agent, a Workflow step or a conversation nobody is in front of (an automation): GOAL_NOT_ALLOWED. A check that is not in shape refuses the whole goal (GOAL_CONTRACT_INVALID).
Path
sessionId- The session.
Body
testorequired- The goal, in your words (up to 4,000 characters).
criteri- The checks that prove it done, up to 20. Each one has a
testo(up to 300 characters) and averifica:{ tipo: "comando", comando, uscita? }(a command run in the session’s folder and the exit code it must give, 0 by default; one whose result could hide behind a pipe,||,;or&is refused),{ tipo: "file", percorso, fatto, testo? }(fattoisesiste,non-esiste,contieneornon-contiene) or{ tipo: "giudizio" }(what no command can tell, weighed by a judge).
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/goal/pausa
Section titled “POST /sessions/{sessionId}/goal/pausa”Pause the active goal (the body must be empty). Already paused: it stays as it is, with its reason.
Path
sessionId- The session.
Body
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/goal/riprendi
Section titled “POST /sessions/{sessionId}/goal/riprendi”Resume a paused or blocked goal (the body must be empty). With the session idle, its checks run and work continues at once.
Path
sessionId- The session.
Body
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/goal/togli
Section titled “POST /sessions/{sessionId}/goal/togli”Clear the goal (the body must be empty). Its history stays in the conversation’s journal.
Path
sessionId- The session.
Body
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/goal/contratto
Section titled “POST /sessions/{sessionId}/goal/contratto”Replace the whole contract of the goal: the full list of checks, the ones kept with their id.
Adding checks is free; removing or changing one needs conferma, the fingerprint of the contract you were shown. Without it the answer is GOAL_CONTRACT_NEEDS_CONFIRMATION, naming the checks removed and changed, and nothing changes.
Path
sessionId- The session.
Body
criterirequired- The checks, in the same form as for
POST …/goal; the ones kept carry theirid(c1,c2…). conferma- The fingerprint of the contract you confirmed (
sha256:and 64 hexadecimal digits), orfalsefor an explicit no.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/goal/criteri
Section titled “POST /sessions/{sessionId}/goal/criteri”Add checks to the goal, after the ones it has (they get their id). Adding asks for more, so no confirmation is needed.
Path
sessionId- The session.
Body
criterirequired- The checks to add, in the same form as for
POST …/goal, withoutid.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/goal/proposta
Section titled “POST /sessions/{sessionId}/goal/proposta”Ask the conversation’s own model to propose the checks for a goal, from its text and the project’s context. Nothing is saved: confirm the checks with POST …/goal.
A proposal that does not succeed is not an error: the answer says so (pavimento: true, with the reason), and the goal can still be set without checks.
Path
sessionId- The session.
Body
testorequired- The goal (up to 4,000 characters).
lingua- The language to write the checks in:
itoren.
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.
POST /sessions/{sessionId}/goal/verifica
Section titled “POST /sessions/{sessionId}/goal/verifica”Run the goal’s checks now, in the session’s folder on this computer, and save their results (it can take minutes).
Refused while a turn, an agent, a Workflow step or one of your commands is working in that folder, while another check is running, and for a goal that is done or has no contract. A check that would need your approval is reported as not verifiable.
Path
sessionId- The session.
Body
Answers The JSON envelope.
Errors2
| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Nothing answers at this address, or the resource it names does not exist. |
QUERY_INVALID | 400 | The request is not valid: a query parameter or a body field is missing, unknown or malformed. |
Any operation can also answer the common errors.