The agent sessions API governs the full lifecycle of a Hoody agent session — create, attach, fork, dispatch turns, answer gates, trim history, and reconfigure the running session’s model, effort, verbosity, chat agent, and auto-reply posture. Sessions freeze their start binding (realm, container, cwd, tool mode, dir scope, backend) at creation time; subsequent per-request realm or container headers that contradict that binding are rejected. Use these endpoints when you are building a control surface that drives the agent over the public, proxied endpoint.
All routes are scoped to the per-request container’s agent service and resolve through hoody-proxy. Sessions are identified by a 24-character lowercase hexadecimal id.
Create a new session, fork an existing session, or attach to a live session. The session freezes its realm, container, cwd, tool mode, dir scope, and backend at start. Set backend: "acp" together with delegated_agent to delegate the session to an external CLI agent (BYOA; only "claude" is supported). Use attach to rejoin a live session and fork to branch from an existing session.
This endpoint takes no path parameters. The realm and container headers, if supplied, must match the parent’s binding for fork and the session’s frozen binding for attach; otherwise a realm_conflict or container_conflict is returned.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
"cwd": "/Users/me/projects/acme",
"model": "anthropic/claude-opus-4-8",
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . createSession ({
cwd : ' /Users/me/projects/acme ' ,
model : ' anthropic/claude-opus-4-8 ' ,
" id " : " 67e89abc123def456789abcd " ,
" container " : " 67e89abc123def456789abcd " ,
" cwd " : " /Users/me/projects/acme " ,
" config_dir " : " ~/.hoody " ,
" model " : " anthropic/claude-opus-4-8 " ,
" created_at " : " 2026-01-15T18:42:11Z "
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_blockedRealm blocked The requested realm is blocked or corrupt; the request fails closed before dispatch. Select a valid, reachable realm. realm_corruptRealm record corrupt The attach target’s persisted realm binding is corrupt; the session cannot be re-bound and the request fails closed. Recreate the session in a valid realm. realm_conflictRealm conflict The supplied realm conflicts with the parent’s (fork) or the session’s frozen (attach) realm binding. Omit the realm header to inherit, or match the existing binding. invalid_realmInvalid realm selector The realm selector is malformed (not ""/"global"/a 24-hex id). Pass a valid realm selector. container_conflictContainer conflict The supplied container conflicts with the parent’s (fork) or the session’s frozen (attach) container binding. Omit the container header to inherit, or match the existing binding. delegated_agent_invalidDelegated agent invalid The delegated_agent value (for backend: "acp") is not a known BYOA backend. Use "claude" — the only BYOA backend.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy), not by connecting to the container directly.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" message " : " session is already live in another connection "
Error Code Title Description Resolution session_busySession busy The session is already live in another connection (single-writer-per-session). Close the other attach, or attach a fork instead. session_not_attachableSession not attachable The attach target is a daemon-managed session (e.g. a todo worker) and cannot be attached over HTTP. Attach a user session, or fork the target instead of attaching it.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap (MaxBodyBytes). The gateway rejects an oversized body at the edge before the handler reads it. Reduce the request body below the configured limit (default 8 MiB); split a large payload into smaller requests.
" message " : " working directory does not exist "
Error Code Title Description Resolution cwd_not_foundWorking directory not found The requested working directory does not exist on the daemon host (validated at session start for a self-bound session). Create the directory or pass an existing cwd. container_goneBound container no longer exists The session’s frozen REMOTE container no longer exists in its realm (validated at session start). Start a new session and pick another container (or this computer).
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit). Honor Retry-After and retry.
Name In Type Required Description X-Hoody-Cwdheader string No Per-request working-directory scope: the .hoody project layer / record cwd / tool+workflow cwd. Required by routes that resolve a cwd. X-Hoody-Config-Dirheader string No Per-request --config-dir override selecting which on-disk .hoody install a stateless read/write resolves (HoodyPaths). X-Hoody-Containerheader string No Per-request bound remote container (omitted = local). Rejected (400) on routes with no container dimension. X-Hoody-Realmheader string No Per-request realm selector: "global" or a 24-hex id. Rejected (400 realm_scope_unsupported) on active-only / no-realm routes. realmquery string No In-query alias of the X-Hoody-Realm header (read only when the header is absent).
Name Type Required Description realmstring No Realm selector to scope the session (frozen at start). containerstring No Container id/selector to run tools on (frozen at start). cwdstring No Working directory for the session (frozen at start). config_dirstring No Config directory override. modelstring No Model for this session. On a fresh create/fork it overrides the chat agent’s pinned model for this session only. Rejected (400) together with attach or backend: "acp". agentstring No Initial chat-agent name. Rejected (400) together with fork or attach. tool_modestring No Initial tool mode (frozen at start). dir_scopestring No Initial directory-access scope: home/full (frozen at start). attachstring No attach_session_id — attach to an existing session instead of creating one.forkstring No fork_session_id — fork from an existing session.fork_turn_idxinteger No Turn index to fork at (with fork). backendstring No Session backend: "" (Hoody LLM) or "acp" (BYOA delegated agent). delegated_agentstring No BYOA agent when backend: "acp": claude. headlessboolean No Start the session in headless posture.
Closes the live session connection (the daemon cancels the session). With ?hard=true, also removes the persisted record. A session created with a body config_dir override is persisted under that override’s sessions dir; to hard-delete it, send the same directory as X-Hoody-Config-Dir.
-H " Authorization: Bearer <token> " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd?hard= true
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . deleteSession ( ' 67e89abc123def456789abcd ' , { hard : true });
" id " : " 67e89abc123def456789abcd " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route, or open a session to scope by realm. invalid_realmInvalid realm selector The realm selector is malformed (not ""/"global"/a 24-hex id). Pass a valid realm selector.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy, not by connecting to the container directly.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. hardquery boolean No When true, also remove the persisted session record (not just the live connection). X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. Required for hard-delete when the session was created with a body config_dir override. X-Hoody-Containerheader string No Per-request bound remote container (omitted = local). Rejected (400) on routes with no container dimension. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Lists persisted sessions for the requesting cwd (open + closed), with an attached flag for live sessions. Pagination via page/limit is honored; omit limit (default 0) to receive the full set. meta.total is always the full pre-slice count; meta.page and meta.limit echo the window when limit is supplied.
-H " Authorization: Bearer <token> " \
" https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions?page=1&limit=20 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . listSessionsIterator ({ page : 1 , limit : 20 });
" id " : " 67e89abc123def456789abcd " ,
" title " : " Triage bug 1821 " ,
" cwd " : " /Users/me/projects/acme " ,
" model " : " anthropic/claude-opus-4-8 " ,
" created_at " : " 2026-01-15T18:42:11Z " ,
" last_active_at " : " 2026-01-15T19:01:09Z "
" id " : " 890abcdef12345678901cdef " ,
" title " : " Refactor session.py " ,
" cwd " : " /Users/me/projects/acme " ,
" model " : " anthropic/claude-opus-4-8 " ,
" created_at " : " 2026-01-12T10:00:00Z " ,
" last_active_at " : " 2026-01-12T11:14:42Z "
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route, or open a session to scope by realm.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy, not by connecting to the container directly.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
Name In Type Required Description include_systemquery boolean No When true, also include daemon-owned system/resident sessions in the listing. pagequery integer No 1-based page number for pagination. limitquery integer No Maximum items per page (0 = no pagination). X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Returns the persisted summary for a session (live or closed). A live session also surfaces its frozen start binding (realm/container/modes) and attached: true.
-H " Authorization: Bearer <token> " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . getSession ( ' 67e89abc123def456789abcd ' );
" id " : " 67e89abc123def456789abcd " ,
" title " : " Triage bug 1821 " ,
" cwd " : " /Users/me/projects/acme " ,
" model " : " anthropic/claude-opus-4-8 " ,
" container " : " 67e89abc123def456789abcd " ,
" created_at " : " 2026-01-15T18:42:11Z " ,
" last_active_at " : " 2026-01-15T19:01:09Z "
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Returns the distinct working directories across all persisted sessions, most-recent first.
-H " Authorization: Bearer <token> " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/cwds
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . listSessionCwds ();
" /Users/me/projects/acme " ,
" /Users/me/projects/orbit " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
Name In Type Required Description X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Returns 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, use /transcript to read the persisted conversation without attaching, or attach to receive the daemon’s event.replay.
-H " Authorization: Bearer <token> " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/replay
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . replaySession ( ' 67e89abc123def456789abcd ' );
{ " seq " : 101 , " type " : " message " , " role " : " assistant " , " text " : " Looking at the stack trace… " },
{ " seq " : 102 , " type " : " tool_use " , " name " : " bash " , " input " : { " cmd " : " ls -la " } },
{ " seq " : 103 , " type " : " tool_result " , " output " : " total 24 \n drwxr-xr-x 5 me staff 160 Jan 15 19:00 . " }
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
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 gap past eviction emits event: lagged {code:replay_gap} then streams from min_seq). A slow client is dropped lagged and never backpressures the daemon. WS clients may post inline answer frames (confirm/answer/cancel/workflow_message).
-H " Authorization: Bearer <token> " \
-H " Accept: text/event-stream " \
-H " Last-Event-ID: 152 " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/stream
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . streamSession ( ' 67e89abc123def456789abcd ' , { since : 152 });
WebSocket upgrade accepted (WS transport). No body; the connection switches to the WS frame protocol.
data: {"role":"assistant","text":"Looking at the stack trace..."}
data: {"name":"bash","input":{"cmd":"ls -la"}}
" code " : " realm_scope_unsupported " ,
" message " : " realm scope not supported on this route "
Error Code Title Description Resolution realm_scope_unsupportedRealm scope unsupported A per-request realm header contradicts the session’s frozen binding. Omit the realm header on this route, or open a session to scope by realm.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. sincequery integer No Resume from this gateway int64 seq (also accepted as the Last-Event-ID header). Last-Event-IDheader string No SSE resume cursor — the gateway int64 seq to resume from; sent automatically by an SSE client on reconnect. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Returns the persisted conversation — the event.replay message projection (text/thinking/tool_use/tool_result blocks) plus turn boundaries — for a live or closed session, read from the session record. It never attaches, never resumes, and never consumes the exclusive attach slot. Use after_turn=N to skip completed turns 1..N (exclusive cursor; 0 = full transcript; past-end values clamp; the response echoes the applied value).
-H " Authorization: Bearer <token> " \
" https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/transcript?after_turn=0 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . getSessionTranscript ( ' 67e89abc123def456789abcd ' , { after_turn : 0 });
{ " role " : " user " , " text " : " Why is the build failing? " },
{ " role " : " assistant " , " text " : " The stack trace shows a missing import. " },
{ " role " : " tool_use " , " name " : " bash " , " input " : { " cmd " : " grep -rn 'unreachable' src " } },
{ " role " : " tool_result " , " output " : " src/legacy/notes.md:7: unreachable note " }
" turn_boundaries " : [ 1 , 4 , 7 ]
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters (e.g. negative or non-integer after_turn). Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
Name In Type Required Description idpath string Yes Session identifier. after_turnquery integer No Exclusive completed-turn skip cursor: return content strictly after completed turn N (0 = full transcript; values past the end clamp; negative/non-integer = 400). X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Dispatches a user turn and returns {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) or a turn is already running (409 turn_in_flight) — single-writer, no duplicate parked turns.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"text": "Explain the bug in src/main.go"} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/messages
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . postSessionMessage ( ' 67e89abc123def456789abcd ' , { text : ' Explain the bug in src/main.go ' });
" job_id " : " 67e89abc123def456789abcd-job-7 " ,
" session_id " : " 67e89abc123def456789abcd " ,
" turn_started_at " : " 2026-01-15T19:02:11Z "
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" message " : " a gate is parked on this session " ,
Error Code Title Description Resolution gate_parkedGate parked A confirm/question gate is parked on this session, so a new turn/workflow run is refused until it is answered. The parked gate is surfaced under details.pending_gate. Answer the parked gate (/confirm or /answer) and retry; read it via GET /sessions/{id} or details.pending_gate. turn_in_flightTurn in flight A turn is already running on this session; the single serial turn slot is occupied. Wait for the running turn to finish (observe agent_done on the session stream), then retry.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap (MaxBodyBytes). Reduce the request body below the configured limit (default 8 MiB).
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description textstring No The user message text for this turn. tool_modestring No Optional per-turn tool mode override. dir_scopestring No Optional per-turn directory-access scope override: home/full.
Dispatches a turn and streams 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.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-H " Accept: text/event-stream " \
-H " X-Hoody-Gate-Policy: auto_approve " \
-d ' {"text": "Summarize the diff"} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/prompt:stream
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . promptStream ( ' 67e89abc123def456789abcd ' , { text : ' Summarize the diff ' }, { policy : ' auto_approve ' });
data: {"role":"assistant","text":"The diff adds three files..."}
data: {"status":"done","turn":7}
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" message " : " a gate is parked on this session " ,
Error Code Title Description Resolution gate_parkedGate parked A confirm/question gate is parked on this session. Answer the parked gate (/confirm or /answer) and retry. turn_in_flightTurn in flight A turn is already running on this session. Wait for the running turn to finish, then retry.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. policyquery string No auto_approve auto-answers confirm gates for the life of the stream; off by default.X-Hoody-Gate-Policyheader string No Confirm-gate posture: "auto_approve". Any other value is rejected 400. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description textstring No The user message text for this turn. tool_modestring No Optional per-turn tool mode override. dir_scopestring No Optional per-turn directory-access scope override: home/full.
Dispatches a turn and blocks until agent_done. By default (interactive posture) it returns {pending_gate} the moment a turn parks — it NEVER auto-approves implicitly. Repeated calls against a parked session return 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. A server read-timeout prevents a parked turn from wedging the request.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"text": "Run the tests"} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/prompt:sync
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . promptSync ( ' 67e89abc123def456789abcd ' , { text : ' Run the tests ' });
" session_id " : " 67e89abc123def456789abcd " ,
" result " : " All tests passed. " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " turn_in_flight " ,
" message " : " a turn is already running on this session "
Error Code Title Description Resolution turn_in_flightTurn in flight A turn is already running on this session; the single serial turn slot is occupied. Wait for the running turn to finish, then retry.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. policyquery string No auto_approve adopts the headless auto-answer posture; off by default.X-Hoody-Gate-Policyheader string No Confirm-gate posture: "auto_approve". Any other value is rejected 400. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description textstring No The user message text for this turn. tool_modestring No Optional per-turn tool mode override. dir_scopestring No Optional per-turn directory-access scope override: home/full.
Answers a parked ask-the-user question. Use answer/text for a free-form reply, or answers (a map) for a structured multi-field question. gate_id/generation are optional echoes (a mismatch is 409). Returns 409 no_pending_gate / stale_gate / gate_already_answered / gate_type_mismatch on mismatch.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"answer": "Yes, go ahead", "gate_id": "gate-3", "generation": 3} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/answer
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . answerQuestion ( ' 67e89abc123def456789abcd ' , { answer : ' Yes, go ahead ' , gate_id : ' gate-3 ' , generation : 3 });
" session_id " : " 67e89abc123def456789abcd "
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " no_pending_gate " ,
" message " : " no gate is parked for this session "
Error Code Title Description Resolution no_pending_gateNo pending gate No confirm/question gate is parked for this session, so there is nothing to answer. Dispatch a turn and answer the gate it parks; check the pending gate via GET /sessions/{id}. stale_gateStale gate The supplied gate_id/generation does not match the currently parked gate. Re-read the pending gate and answer the current id/generation. gate_already_answeredGate already answered The parked gate was already answered by an earlier request (first valid answer wins). Wait for the next gate; do not re-answer. gate_type_mismatchGate type mismatch The parked gate is a different type than this endpoint answers (e.g. answering a question gate via /confirm). Use the endpoint matching the parked gate type (/confirm for a confirm gate, /answer for a question gate).
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description gate_idstring No Optional echo of the parked gate id (stale/mismatch returns 409). generationinteger No Optional echo of the parked gate generation. answerstring No Free-form answer text. textstring No Alternate answer text field (forwarded alongside answer). answersobject No Structured per-field answers for a multi-field question.
Runs a one-shot helper-model call that proposes answers for the parked question (emits event.question_suggestion). The real answer still travels via /answer — the daemon never answers itself. Returns 409 no_pending_gate when no question is parked, or assist_in_flight if a suggestion job is already running.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"mode": "suggest", "model": "anthropic/claude-haiku-4-5", "gen": 7} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/answer:assist
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . answerAssist ( ' 67e89abc123def456789abcd ' , { mode : ' suggest ' , model : ' anthropic/claude-haiku-4-5 ' , gen : 7 });
" job_id " : " 67e89abc123def456789abcd-assist-7 " ,
" session_id " : " 67e89abc123def456789abcd " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " no_pending_gate " ,
" message " : " no gate is parked for this session "
Error Code Title Description Resolution no_pending_gateNo pending gate No confirm/question gate is parked for this session. Dispatch a turn and answer the gate it parks. assist_in_flightAssist in flight An answer:assist suggestion job is already running for this session; only one in-flight assist per session is allowed. Wait for the prior suggestion (observe event.question_suggestion / poll the job), then retry.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description modestring No Suggestion mode (default "suggest"). modelstring No Helper model override; empty uses the configured helper. geninteger No Generation counter to correlate the suggestion event.
Approves or denies a parked tool/dir confirmation. Returns 409 no_pending_gate when nothing is parked, or stale_gate / gate_already_answered on mismatch (the gateway never fires a command that would be silently dropped). Set persist_dirs: true on an approved directory grant to persist it to settings.json (WS/REST parity).
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"approved": true, "persist_dirs": true, "gate_id": "gate-3", "generation": 3} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/confirm
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . confirmGate ( ' 67e89abc123def456789abcd ' , { approved : true , persist_dirs : true , gate_id : ' gate-3 ' , generation : 3 });
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " no_pending_gate " ,
" message " : " no gate is parked for this session "
Error Code Title Description Resolution no_pending_gateNo pending gate No confirm/question gate is parked for this session. Dispatch a turn and answer the gate it parks. stale_gateStale gate The supplied gate_id/generation does not match the currently parked gate. Re-read the pending gate and answer the current id/generation. gate_already_answeredGate already answered The parked gate was already answered by an earlier request. Wait for the next gate; do not re-answer. gate_type_mismatchGate type mismatch The parked gate is a different type than this endpoint answers. Use the endpoint matching the parked gate type (/confirm for a confirm gate, /answer for a question gate).
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description gate_idstring No Optional echo of the parked gate id (stale/mismatch returns 409). generationinteger No Optional echo of the parked gate generation. approvedboolean No true to approve, false to deny (defaults to true if omitted).persist_dirsboolean No Persist an approved directory grant to settings.json.
Stops 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 — it holds the same serial turn slot.
-H " Authorization: Bearer <token> " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/cancel
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . cancelSession ( ' 67e89abc123def456789abcd ' );
" session_id " : " 67e89abc123def456789abcd " ,
" aborted_tools " : [ " bash " ]
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Tears the session down (the daemon cancels it and removes the live session).
-H " Authorization: Bearer <token> " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/close
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . closeSession ( ' 67e89abc123def456789abcd ' );
" session_id " : " 67e89abc123def456789abcd "
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Injects user feedback/input into a running workflow (maps to session.workflow_message → workflowMsgChan, not commandChan).
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"text": "Stop at step 4 and summarize"} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/workflow/messages
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . postWorkflowMessage ( ' 67e89abc123def456789abcd ' , { text : ' Stop at step 4 and summarize ' });
" session_id " : " 67e89abc123def456789abcd "
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description textstring No Feedback/input text fed to the running workflow.
Live chat-agent switch (echoed as an event).
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"agent": "code-reviewer"} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/agent
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . setSessionAgent ( ' 67e89abc123def456789abcd ' , { agent : ' code-reviewer ' });
" session_id " : " 67e89abc123def456789abcd " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description agentstring No Chat-agent name to switch to.
Arm or disarm the self-driving auto-reply loop (rounds, replier model, write opt-in).
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"armed": true, "rounds": 4, "model": "anthropic/claude-haiku-4-5", "allow_writes": false} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/auto-reply
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . setSessionAutoReply ( ' 67e89abc123def456789abcd ' , { armed : true , rounds : 4 , model : ' anthropic/claude-haiku-4-5 ' , allow_writes : false });
" session_id " : " 67e89abc123def456789abcd " ,
" model " : " anthropic/claude-haiku-4-5 " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description armedboolean No true to arm the auto-reply loop, false to disarm.roundsinteger No Number of auto-reply rounds budgeted. modelstring No Replier model override. allow_writesboolean No Opt in to write-class actions during auto-reply.
Flip the write-class opt-in on an already-armed auto-reply loop WITHOUT re-arming (no budget reset).
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"allow_writes": true} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/auto-reply/writes
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . setSessionAutoReplyWrites ( ' 67e89abc123def456789abcd ' , { allow_writes : true });
" session_id " : " 67e89abc123def456789abcd " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description allow_writesboolean No New write-class opt-in state.
Live reasoning-effort change (low/medium/high/xhigh, or "" for the model default).
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"effort": "high"} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/effort
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . setSessionEffort ( ' 67e89abc123def456789abcd ' , { effort : ' high ' });
" session_id " : " 67e89abc123def456789abcd " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters (e.g. unknown effort level). Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description effortstring No low/medium/high/xhigh, or "" for the model default.
Live toggle of the session’s HOODY_* shell-env contract for the bash tool.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/hoody-env
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . setSessionHoodyEnv ( ' 67e89abc123def456789abcd ' , { enabled : true });
" session_id " : " 67e89abc123def456789abcd " ,
" hoody_env_enabled " : true
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description enabledboolean No Whether to inject the HOODY_* shell-env contract.
SYNCHRONOUS live model switch: applies the model inline and answers what actually happened. Returns {status: "ok", model, persisted} on success; persisted=false indicates the frontmatter write failed (the live switch stands but reverts next session). 409 gate_parked/turn_in_flight while the session is busy, 404 for an unknown/closed session, 400 for a blank model, 409 delegated_session on external-agent sessions, 422 model_unavailable for a spec that cannot be constructed. A successful switch persists into the chat agent’s frontmatter — a GLOBAL repin for future sessions of that agent, not a session-scoped choice.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"model": "anthropic/claude-opus-4-8"} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/model
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . setSessionModel ( ' 67e89abc123def456789abcd ' , { model : ' anthropic/claude-opus-4-8 ' });
" model " : " anthropic/claude-opus-4-8 " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters (e.g. blank model). Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" code " : " session_not_found " ,
" message " : " session not found or not live "
Error Code Title Description Resolution session_not_foundSession not found Unknown, closed (including the close-vs-switch race), cross-realm, or foreign-owner session — all collapsed into one code so nothing leaks. List sessions and retry against a live one.
" message " : " a gate is parked on this session; answer or cancel it, then retry the model switch "
Error Code Title Description Resolution gate_parkedGate parked A confirm/question gate is parked; the switch cannot apply until it resolves. Answer or cancel the gate under details.pending_gate, then retry. turn_in_flightTurn in flight A turn is running (or parked) on the session’s single-writer slot. Retry when the session is idle. delegated_sessionDelegated session The external agent owns its model; switching is unavailable. Use the external agent’s own configuration.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" code " : " model_unavailable " ,
" message " : " cannot switch to model \" x/y \" : unknown provider "
Error Code Title Description Resolution model_unavailableModel unavailable Unknown model, missing credential, or invalid fusion composite. Check the spec and provider credentials.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
" message " : " session still initializing "
Error Code Title Description Resolution timeoutInitialization wait cut short The switch waited on session readiness and the request context ended first. Retry once the session finishes initializing.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description modelstring Yes Model spec to switch to (provider-prefixed, e.g. anthropic/claude-opus-4-8, or fusion/<slug>). A blank value is rejected, never a silent no-op.
Live verbosity change (normal/concise/terse/minimal).
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"level": "concise"} ' \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/verbosity
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . setSessionVerbosity ( ' 67e89abc123def456789abcd ' , { level : ' concise ' });
" session_id " : " 67e89abc123def456789abcd " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters (e.g. unknown level). Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description levelstring No normal/concise/terse/minimal.
Truncates the session’s conversation history to (and including) the given turn index.
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/sessions/67e89abc123def456789abcd/trim
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . agent . sessions . trimSession ( ' 67e89abc123def456789abcd ' , { turn_idx : 4 });
" session_id " : " 67e89abc123def456789abcd " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy.
" message " : " resource not found "
Error Code Title Description Resolution not_foundNot found The requested resource does not exist. Verify the path and identifier.
" code " : " payload_too_large " ,
" message " : " request body exceeds the configured size limit "
Error Code Title Description Resolution payload_too_largePayload too large The request body exceeds the configured size cap. Reduce the request body below the configured limit.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded. Honor the Retry-After header and retry.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request. Honor Retry-After and retry.
Name In Type Required Description idpath string Yes Session identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. Rejected (400) on this route. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400) on this route. realmquery string No In-query alias of X-Hoody-Realm.
Name Type Required Description turn_idxinteger No Turn index to truncate history to (and including).