---
title: "Peek Session"
method: GET
path: "/sessions/{session_id}/peek"
---

# Peek Session

`GET /sessions/{session_id}/peek`

Return the recent stream-tail entries for ``session_id``.

Args:
    session_id: Bernstein session whose tail to read.
    request: FastAPI request - used to resolve the workdir and the
        ``tail`` query argument.

Returns:
    JSON envelope with ``session_id`` plus a ``tail`` list of
    ``{ts, surface, text}`` entries in chronological order. An
    empty list signals "buffer not initialised yet" rather than an
    error so the polling page renders a blank pane while it waits.

## Path parameters

- `session_id` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server.md) · [All operations](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sipyourdrink-ltd/bernstein-task-server/revisions/86f514b4e920/schema)
