# Navigator Sessions

Source: https://zshot-cli.com/reference/server/sessions/
Markdown: https://zshot-cli.com/reference/server/sessions/index.md
Section: [Reference](https://zshot-cli.com/reference/) › [Server](https://zshot-cli.com/reference/server/)

Drive a [navigator](/reference/navigator) session interactively, one action per call, while the server holds the browser open between requests. All endpoints accept `POST` JSON bodies under the server's [authentication](/reference/server/authentication).

| Endpoint | Body | Response |
| --- | --- | --- |
| `/sessions/start` | Render request with `navigate` set to the goal | First frame |
| `/sessions/act` | `session`, `seq`, `reply` | Next frame |
| `/sessions/finish` | `session`, and optionally `outcome`, `statement`, `discard` | Final render |

## Frames

Each frame contains the navigator prompt: the goal, the page accessibility text with element refs such as `@e7`, and available actions.

```json
{
  "session": "6dfd8976-d2fa-4c8a-8b8c-137e04354f41",
  "seq": 1,
  "frame": {
    "text": "…",
    "images": [{ "media_type": "image/png", "data": "<base64>" }]
  }
}
```

`images` includes a page screenshot when available, such as after a `VISION` action.

Set [`navigator_frames`](/reference/flags/navigator/navigator-frames) to `compact` in `/sessions/start` and each frame after the first holds only the sections that changed. A reply of `FULL_FRAME` returns every section again. A compact frame re-sent for a mismatched `seq` notes the mismatch on its first line.

## Acting

`reply` carries one action such as `CLICK @e4` or `FILL @e7: Ada`, and `seq` identifies the frame being answered. Requests with a mismatched `seq` are no-ops that return the current frame, making retries safe after lost responses. Only one call can act on a session at a time; concurrent calls return `409`.

```sh
curl -X POST localhost:3000/sessions/act \
  -H 'Content-Type: application/json' \
  -d '{"session": "6dfd8976-d2fa-4c8a-8b8c-137e04354f41", "seq": 1, "reply": "CLICK @e4"}'
```

## Finishing

`/sessions/finish` closes the session and returns the same response as `POST /`: the output in the session's `output_type`, plus `Link` headers for any [additional assets](/reference/server/additional-assets) such as `with_navigator_video`.

| Field | Meaning |
| --- | --- |
| `outcome` | `done` by default, or `impossible`, which returns `502` |
| `statement` | Caller-provided summary returned by `goal` output |
| `discard` | Set `true` to close the session without rendering, returning `204` |

Send `DONE` and `IMPOSSIBLE` through `/sessions/finish`; `/sessions/act` rejects them with `400`. If the navigator needs another turn, such as when a [`--navigator-goal`](/reference/flags/navigator/navigator-goal) condition is unmet, `/sessions/finish` returns `409` with the next frame and keeps the session open.

## Limits

Idle sessions are closed after [`--server-session-idle-timeout`](/reference/flags/server/server-session-idle-timeout). Requests to closed sessions return `404`. `navigator_max_steps` defaults to 100.

Each open session counts as an active render toward [`--server-max-concurrency`](/reference/flags/server/server-max-concurrency) and `/status`.

## Related

Flags:

- [`--server-session-idle-timeout`](https://zshot-cli.com/reference/flags/server/server-session-idle-timeout/)
- [`--navigate`](https://zshot-cli.com/reference/flags/navigator/navigate/)

Topics:

- [Navigator](https://zshot-cli.com/reference/navigator/)
- [MCP](https://zshot-cli.com/reference/agents/mcp/)

## Navigation

- [Examples](https://zshot-cli.com/examples/)
- [Download](https://zshot-cli.com/download/)
- [Purchase](https://zshot-cli.com/purchase/)
- [Reference](https://zshot-cli.com/reference/)
  - [Formats](https://zshot-cli.com/reference/formats/)
  - [Flags](https://zshot-cli.com/reference/flags/)
  - [Agents](https://zshot-cli.com/reference/agents/)
  - [Configuration](https://zshot-cli.com/reference/configuration/)
  - [Crawling](https://zshot-cli.com/reference/crawling/)
  - [Devices](https://zshot-cli.com/reference/devices/)
  - [Docker](https://zshot-cli.com/reference/docker/)
  - [Exit Codes](https://zshot-cli.com/reference/exit_codes/)
  - [Linux](https://zshot-cli.com/reference/linux/)
  - [LLM Connections](https://zshot-cli.com/reference/llm_connections/)
  - [npm](https://zshot-cli.com/reference/npm/)
  - [LLM Formatting](https://zshot-cli.com/reference/llm_formatting/)
  - [Local Inputs](https://zshot-cli.com/reference/inputs/)
  - [Navigator](https://zshot-cli.com/reference/navigator/)
  - [Security](https://zshot-cli.com/reference/security/)
  - [Server](https://zshot-cli.com/reference/server/)
    - [API](https://zshot-cli.com/reference/server/api/)
    - [Endpoints](https://zshot-cli.com/reference/server/endpoints/)
    - [Metrics](https://zshot-cli.com/reference/server/metrics/)
    - **Navigator Sessions**
    - [Additional Assets](https://zshot-cli.com/reference/server/additional-assets/)
    - [Authentication](https://zshot-cli.com/reference/server/authentication/)
    - [Caching](https://zshot-cli.com/reference/server/caching/)
    - [Benchmarks](https://zshot-cli.com/reference/server/benchmarks/)
  - [Shell completions](https://zshot-cli.com/reference/shell_completions/)
  - [Storage](https://zshot-cli.com/reference/storage/)
  - [Timeouts](https://zshot-cli.com/reference/timeouts/)
  - [Web Bot Auth](https://zshot-cli.com/reference/web_bot_auth/)
- [Support](https://zshot-cli.com/support/)
- [Changelog](https://zshot-cli.com/changelog/)

Site index: https://zshot-cli.com/llms.txt

