> ## Documentation Index
> Fetch the complete documentation index at: https://hub.hcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Force an answer

> Ask the agent to emit a final answer on its next step.

Injects a `force_answer` flow-control event into the session. The agent stops exploring and produces a final answer on its next step, based on whatever context it has gathered so far. Like [pause](/computer-use-agents/sessions/pause) and [resume](/computer-use-agents/sessions/resume), this request takes no body, requires authentication, and does not wait for the agent to act.

If the session has [subagents](/computer-use-agents/multi-agent) still running, `force_answer` propagates down to them: each in-flight subagent is asked to wrap up, gets a short grace window to finalize, and any that don't finish in time are cancelled. Their partial results are folded into the parent's answer. The same cascade repeats through any deeper subagents.

On a [`queued`](/computer-use-agents/observe-and-steer#queued-sessions) session the event is buffered and delivered when the agent starts. On a finished session it behaves like [sending a message](/computer-use-agents/sessions/send-messages): the session restarts and the relaunched agent answers immediately.

**Returns** `202 Accepted`. The command is delivered asynchronously.

***

## Path parameters

<ParamField path="id" type="string" required>
  The session ID.
</ParamField>

***

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/force_answer \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  client.sessions.force_session_answer(session_id)
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  await client.sessions.forceSessionAnswer({ id: sessionId });
  ```
</CodeGroup>

***

## Errors

| Status | Cause                                        |
| ------ | -------------------------------------------- |
| `404`  | Session not found, or you don't have access. |
