---
title: "Send To Session"
method: POST
path: "/api/v1/sessions/{session_id}/send"
---

# Send To Session

`POST /api/v1/sessions/{session_id}/send`

Pipe one line of operator input into ``session_id``'s stdin.

The send-bar tile on the dashboard POSTs ``{"text": "..."}`` here; we
forward through :func:`bernstein.core.agents.agent_ipc.send_message`,
which writes the line into the agent's registered stdin pipe.

Args:
    session_id: Slug-shaped session id; must pass the same validator
        as the peek endpoint.
    request: FastAPI request (unused beyond routing-level checks but
        present so the bearer-auth middleware sees the same shape as
        our other mutating routes).
    payload: JSON body with a single ``text`` field. Empty / missing
        text is rejected with ``400``; oversize payloads above
        :data:`MAX_SEND_BYTES` are rejected with ``413``.

Returns:
    JSON envelope with ``session_id`` and ``delivered`` (``True`` if
    the line reached a registered stdin pipe, ``False`` if no pipe
    is registered for this session).  The 200/404 split lets the
    front-end keep the input enabled but warn the operator when the
    agent has no live pipe yet.

## Path parameters

- `session_id` string, required

## Request body

- object

## 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)
