Skip to content

Sessions are the persistent containers for Hoody’s LLM-driven workflows. Each session holds a conversation history, a frozen start binding (realm, container, cwd, tool mode, dir scope, backend), and an attached event stream. This page covers every operation on a session: discovery, lifecycle, turn dispatch, gate handling, live configuration, and per-session workflow input. Use these endpoints to wire a UI or backend service into the Hoody agent.

List persisted sessions for the requesting cwd (open and closed), with an Attached flag for live sessions. Pagination is honored via ?page=N&limit=M; omit limit to receive the full set.

SDK: client.agent.sessions.listSessionsIterator()

NameInTypeRequiredDescription
include_systemquerybooleanNoWhen true, also include daemon-owned system/resident sessions in the listing.
pagequeryintegerNo1-based page number for pagination.
limitqueryintegerNoMaximum items per page (0 = no pagination).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
{
"items": [
{
"id": "5f9a8b2c3d4e5f6a7b8c9d0e",
"title": "Refactor auth middleware",
"model": "claude-opus-4-6",
"agent": "build",
"cwd": "/home/user/projects/api",
"attached": true,
"created_at": "2025-01-15T10:23:45Z",
"updated_at": "2025-01-15T10:42:11Z"
}
],
"meta": {
"total": 42,
"page": 1,
"limit": 20
}
}
const iterator = await client.agent.sessions.listSessionsIterator({
includeSystem: false,
page: 1,
limit: 20
});

Return the persisted summary for a session (live or closed). A live session also surfaces its frozen start binding (realm, container, modes) and attached: true.

SDK: client.agent.sessions.getSession()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
{
"id": "5f9a8b2c3d4e5f6a7b8c9d0e",
"title": "Refactor auth middleware",
"model": "claude-opus-4-6",
"agent": "build",
"tool_mode": "code",
"dir_scope": "home",
"cwd": "/home/user/projects/api",
"attached": true,
"pending_gate": null,
"created_at": "2025-01-15T10:23:45Z",
"updated_at": "2025-01-15T10:42:11Z"
}
const session = await client.agent.sessions.getSession({
id: "5f9a8b2c3d4e5f6a7b8c9d0e"
});

Return the gateway’s buffered event tail for a LIVE session (the daemon’s full viewport snapshot already streamed into the replay ring), with min_seq/max_seq for resume. For a non-live session, attach to receive the daemon’s event.replay.

SDK: client.agent.sessions.replaySession()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
{
"events": [
{
"seq": 12,
"type": "agent_text",
"data": {
"text": "I'll start by reading the auth middleware file."
}
},
{
"seq": 13,
"type": "agent_tool_call",
"data": {
"name": "read_file",
"args": { "path": "/src/auth/middleware.ts" }
}
}
],
"min_seq": 1,
"max_seq": 13
}
const replay = await client.agent.sessions.replaySession({
id: "5f9a8b2c3d4e5f6a7b8c9d0e"
});

WebSocket (primary) or SSE attach to a live session’s full event.* taxonomy. Events carry a gateway-stamped monotonic int64 seq; ?since=<seq> / Last-Event-ID resume from the 1024-event replay ring. A slow client is dropped lagged and never backpressures the daemon. WS clients may post inline answer frames (confirm/answer/cancel/workflow_message).

SDK: client.agent.sessions.streamSession()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
sincequeryintegerNoResume from this gateway int64 seq (also accepted as the Last-Event-ID header).
Last-Event-IDheaderstringNoSSE resume cursor — the gateway int64 seq to resume from; sent automatically by an SSE client on reconnect.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.

WebSocket upgrade accepted (WS transport). No body; the connection switches to the WS frame protocol.

const stream = await client.agent.sessions.streamSession({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
since: 13
});

Return the distinct working directories across all persisted sessions, most-recent first.

SDK: client.agent.sessions.listSessionCwds()

NameInTypeRequiredDescription
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
{
"cwds": [
"/home/user/projects/api",
"/home/user/projects/web",
"/home/user/notes"
]
}
const cwds = await client.agent.sessions.listSessionCwds();

Open a new agent session (or fork/attach an existing one), freezing realm/container/cwd/tool_mode/dir_scope/backend at start. BYOA: backend:"acp" + delegated_agent delegates the session to an external CLI agent.

SDK: client.agent.sessions.createSession()

NameInTypeRequiredDescription
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
realmstringNoRealm selector to scope the session (frozen at start).
containerstringNoContainer id/selector to run tools on (frozen at start).
cwdstringNoWorking directory for the session (frozen at start).
config_dirstringNoConfig directory override.
modelstringNoInitial model id.
agentstringNoInitial chat-agent name.
tool_modestringNoInitial tool mode (frozen at start).
dir_scopestringNoInitial directory-access scope: home|full (frozen at start).
attachstringNoattach_session_id — attach to an existing session instead of creating one.
forkstringNofork_session_id — fork from an existing session.
fork_turn_idxintegerNoTurn index to fork at (with fork).
backendstringNoSession backend: "" (Hoody LLM) or acp (BYOA delegated agent).
delegated_agentstringNoBYOA agent when backend:"acp": codex|claude|gemini|opencode.
headlessbooleanNoStart the session in headless posture.
{
"id": "5f9a8b2c3d4e5f6a7b8c9d0e",
"attached": true,
"model": "claude-opus-4-6",
"agent": "build",
"cwd": "/home/user/projects/api",
"tool_mode": "code",
"dir_scope": "home",
"backend": ""
}
const session = await client.agent.sessions.createSession({
data: {
realm: "global",
cwd: "/home/user/projects/api",
model: "claude-opus-4-6",
agent: "build",
tool_mode: "code",
dir_scope: "home"
}
});

Tear the session down (the daemon cancels it and removes it from the live map).

SDK: client.agent.sessions.closeSession()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.

This endpoint takes no parameters beyond the path and headers.

{
"id": "5f9a8b2c3d4e5f6a7b8c9d0e",
"closed": true
}
await client.agent.sessions.closeSession({
id: "5f9a8b2c3d4e5f6a7b8c9d0e"
});

Stop the active turn at the server layer; spares the session and background tasks (distinct from close). Also aborts an in-flight in-session direct tool run (e.g. POST /sessions/{id}/tools/{name}:run) — it holds the same serial turn slot.

SDK: client.agent.sessions.cancelSession()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.

This endpoint takes no parameters beyond the path and headers.

{
"id": "5f9a8b2c3d4e5f6a7b8c9d0e",
"cancelled": true
}
await client.agent.sessions.cancelSession({
id: "5f9a8b2c3d4e5f6a7b8c9d0e"
});

Close the live session connection (the daemon cancels the session). ?hard=true also removes the persisted record. A hard delete resolves the persisted record under the request’s X-Hoody-Config-Dir header (not a body field) — to hard-delete a session that was CREATED with a body config_dir override, send the same directory as X-Hoody-Config-Dir, otherwise the delete resolves the home sessions dir, finds nothing, and returns 404.

SDK: client.agent.sessions.deleteSession()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
hardquerybooleanNoWhen true, also remove the persisted session record (not just the live connection).
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.

This endpoint takes no request body.

{
"id": "5f9a8b2c3d4e5f6a7b8c9d0e",
"closed": true,
"hard": true
}
await client.agent.sessions.deleteSession({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
hard: true
});

Dispatch a user turn and return {job_id}; observe agent_done on the session’s stream. Refuses a new turn when the session already has a parked gate (409 gate_parked, the parked gate under details.pending_gate) or a turn is already running (409 turn_in_flight) — single-writer, no duplicate parked turns.

SDK: client.agent.sessions.postSessionMessage()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
textstringNoThe user message text for this turn.
tool_modestringNoOptional per-turn tool mode override.
dir_scopestringNoOptional per-turn directory-access scope override: home|full.
{
"job_id": "job-7c4f2a1b9d3e8f5c",
"session_id": "5f9a8b2c3d4e5f6a7b8c9d0e"
}
const { jobId } = await client.agent.sessions.postSessionMessage({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: {
text: "Refactor the auth middleware to use async/await."
}
});

POST /api/v1/agent/sessions/{id}/prompt:stream

Section titled “POST /api/v1/agent/sessions/{id}/prompt:stream”

Dispatch a turn and stream the resulting events over SSE from the seq captured just before the dispatch — only this turn’s events, not the whole retained ring. The explicit X-Hoody-Gate-Policy: auto_approve header (or ?policy=auto_approve) auto-answers confirm gates with approved=true for the life of the stream — off by default.

SDK: client.agent.sessions.promptStream()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
policyquerystringNoauto_approve auto-answers confirm gates for the life of the stream (alias of the X-Hoody-Gate-Policy header); off by default.
X-Hoody-Gate-PolicyheaderstringNoConfirm-gate posture (§6): auto_approve adopts the headless auto-answer posture (off by default; the in-query alias is ?policy=). Any other value is rejected 400.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
textstringNoThe user message text for this turn.
tool_modestringNoOptional per-turn tool mode override.
dir_scopestringNoOptional per-turn directory-access scope override: home|full.

Event stream (SSE):

event: agent_text
id: 14
data: {"text":"Reading the auth middleware file..."}
event: agent_tool_call
id: 15
data: {"name":"read_file","args":{"path":"/src/auth/middleware.ts"}}
event: agent_done
id: 16
data: {"status":"done"}
const stream = await client.agent.sessions.promptStream({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
policy: "auto_approve",
data: {
text: "Refactor the auth middleware to use async/await."
}
});

POST /api/v1/agent/sessions/{id}/prompt:sync

Section titled “POST /api/v1/agent/sessions/{id}/prompt:sync”

Dispatch a turn and block until agent_done. By default (interactive posture) it returns {pending_gate} the moment a turn parks — it never auto-approves implicitly. Repeated prompt:sync against a parked session returns the same pending_gate (no duplicate parked turns). The explicit X-Hoody-Gate-Policy: auto_approve header (or ?policy=auto_approve) adopts the headless posture and auto-answers confirm gates with approved=true — off by default.

SDK: client.agent.sessions.promptSync()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
policyquerystringNoauto_approve adopts the headless auto-answer posture (alias of the X-Hoody-Gate-Policy header); off by default.
X-Hoody-Gate-PolicyheaderstringNoConfirm-gate posture (§6): auto_approve adopts the headless auto-answer posture (off by default; the in-query alias is ?policy=). Any other value is rejected 400.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
textstringNoThe user message text for this turn.
tool_modestringNoOptional per-turn tool mode override.
dir_scopestringNoOptional per-turn directory-access scope override: home|full.
{
"status": "done",
"text": "I refactored the auth middleware. All 12 tests pass.",
"usage": {
"input_tokens": 4521,
"output_tokens": 312
}
}

A pending_gate is returned the moment a turn parks (interactive posture), status:"error" when the turn surfaced a fatal error, status:"canceled" when a concurrent /cancel (or WS cancel frame) stopped the turn, or status:"quit" on /exit.

const result = await client.agent.sessions.promptSync({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: {
text: "Refactor the auth middleware to use async/await."
}
});

Approve or deny a parked tool/dir confirmation. 409 no_pending_gate when nothing is parked; 409 stale_gate / gate_already_answered on mismatch — the gateway never fires a command that would be silently dropped.

SDK: client.agent.sessions.confirmGate()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
gate_idstringNoOptional echo of the parked gate id (stale/mismatch → 409).
generationintegerNoOptional echo of the parked gate generation.
approvedbooleanNotrue to approve, false to deny (defaults to true if omitted).
persist_dirsbooleanNoPersist an approved directory grant to settings.json (WS↔REST parity).
{
"gate_id": "gate-3",
"generation": 3,
"approved": true
}
await client.agent.sessions.confirmGate({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: {
gate_id: "gate-3",
generation: 3,
approved: true,
persist_dirs: true
}
});

Answer a parked ask-the-user question. 409 no_pending_gate / stale_gate / gate_already_answered / gate_type_mismatch on mismatch.

SDK: client.agent.sessions.answerQuestion()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
gate_idstringNoOptional echo of the parked gate id (stale/mismatch → 409).
generationintegerNoOptional echo of the parked gate generation.
answerstringNoFree-form answer text.
textstringNoAlternate answer text field (forwarded alongside answer).
answersobjectNoStructured per-field answers for a multi-field question.
{
"gate_id": "gate-4",
"generation": 4,
"answered": true
}
await client.agent.sessions.answerQuestion({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: {
gate_id: "gate-4",
generation: 4,
answer: "Use PostgreSQL with a connection pool of 10."
}
});

POST /api/v1/agent/sessions/{id}/answer:assist

Section titled “POST /api/v1/agent/sessions/{id}/answer:assist”

Run a one-shot helper-model call that proposes answers for the parked question (event.question_suggestion). The real answer still travels via /answer — the daemon never answers itself. 409 no_pending_gate when no question is parked.

SDK: client.agent.sessions.answerAssist()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
modestringNoSuggestion mode (default suggest).
modelstringNoHelper model override; empty uses the configured helper.
genintegerNoGeneration counter to correlate the suggestion event.
{
"job_id": "job-assist-9a1b2c3d",
"session_id": "5f9a8b2c3d4e5f6a7b8c9d0e"
}

Suggestion job dispatched; observe its result via GET /jobs/{id}/result.

const { jobId } = await client.agent.sessions.answerAssist({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { mode: "suggest" }
});

Live model switch (echoed as an event).

SDK: client.agent.sessions.setSessionModel()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
modelstringNoModel id to switch to.
{
"model": "claude-opus-4-6"
}
await client.agent.sessions.setSessionModel({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { model: "claude-opus-4-6" }
});

Live reasoning-effort change (low|medium|high|xhigh, or "" for the model default).

SDK: client.agent.sessions.setSessionEffort()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
effortstringNolow|medium|high|xhigh, or "" for the model default.
{
"effort": "high"
}
await client.agent.sessions.setSessionEffort({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { effort: "high" }
});

PATCH /api/v1/agent/sessions/{id}/verbosity

Section titled “PATCH /api/v1/agent/sessions/{id}/verbosity”

Live verbosity change (normal|concise|terse|minimal).

SDK: client.agent.sessions.setSessionVerbosity()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
levelstringNonormal|concise|terse|minimal.
{
"level": "concise"
}
await client.agent.sessions.setSessionVerbosity({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { level: "concise" }
});

Live chat-agent switch (echoed as an event).

SDK: client.agent.sessions.setSessionAgent()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
agentstringNoChat-agent name to switch to.
{
"agent": "build"
}
await client.agent.sessions.setSessionAgent({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { agent: "build" }
});

PATCH /api/v1/agent/sessions/{id}/auto-reply

Section titled “PATCH /api/v1/agent/sessions/{id}/auto-reply”

Arm or disarm the self-driving auto-reply loop (rounds, replier model, write opt-in).

SDK: client.agent.sessions.setSessionAutoReply()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
armedbooleanNotrue to arm the auto-reply loop, false to disarm.
roundsintegerNoNumber of auto-reply rounds budgeted.
modelstringNoReplier model override.
allow_writesbooleanNoOpt in to write-class actions during auto-reply.
{
"armed": true,
"rounds": 5,
"allow_writes": false
}
await client.agent.sessions.setSessionAutoReply({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { armed: true, rounds: 5, allow_writes: false }
});

PATCH /api/v1/agent/sessions/{id}/auto-reply/writes

Section titled “PATCH /api/v1/agent/sessions/{id}/auto-reply/writes”

Flip the write-class opt-in on an already-armed auto-reply loop WITHOUT re-arming (no budget reset).

SDK: client.agent.sessions.setSessionAutoReplyWrites()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
allow_writesbooleanNoNew write-class opt-in state.
{
"allow_writes": true
}
await client.agent.sessions.setSessionAutoReplyWrites({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { allow_writes: true }
});

PATCH /api/v1/agent/sessions/{id}/hoody-env

Section titled “PATCH /api/v1/agent/sessions/{id}/hoody-env”

Live toggle of the session’s HOODY_* shell-env contract for the bash tool.

SDK: client.agent.sessions.setSessionHoodyEnv()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
enabledbooleanNoWhether to inject the HOODY_* shell-env contract.
{
"enabled": true
}
await client.agent.sessions.setSessionHoodyEnv({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { enabled: true }
});

Truncate the session’s conversation history to (and including) the given turn index.

SDK: client.agent.sessions.trimSession()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
turn_idxintegerNoTurn index to truncate history to (and including).
{
"trimmed_to": 4,
"remaining_turns": 5
}
await client.agent.sessions.trimSession({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { turn_idx: 4 }
});

POST /api/v1/agent/sessions/{id}/workflow/messages

Section titled “POST /api/v1/agent/sessions/{id}/workflow/messages”

Inject user feedback/input into a running workflow (maps to session.workflow_messageworkflowMsgChan, not commandChan).

SDK: client.agent.sessions.postWorkflowMessage()

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector. Rejected (400) on active-only / no-realm routes.
realmquerystringNoIn-query alias of the X-Hoody-Realm header.
FieldTypeRequiredDescription
textstringNoFeedback/input text fed to the running workflow.
{
"delivered": true
}
await client.agent.sessions.postWorkflowMessage({
id: "5f9a8b2c3d4e5f6a7b8c9d0e",
data: { text: "Skip the file upload step." }
});