# Set Session Stream Header

Source: https://agenta.ai/docs/reference/api/set-session-stream-header

`PUT /sessions/streams/header`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Rename a session.

`name_source` says where the name came from: `manual` (the default) is a person
typing one, and `automatic` is a program proposing one — the agent's
`rename_session`, or the browser's auto-title. An `automatic` edit is refused with
409 when it would change a name a person controls, unless the body names the exact
name and revision it replaces.

It is a query parameter rather than a body field on purpose. The `rename_session`
catalog entry fixes `name_source=automatic` inside its path and the model fills only
the body, so an agent cannot claim a person chose its name.

`author` is the transitional spelling, hidden from the schema. A warm agent session
holds the tool descriptors it opened with, so a sandbox that started under an
earlier build of this change can still execute `?author=auto` after the service has
moved on. Reading it costs one branch and keeps that call on the guarded path; the
alternative is a rename that silently claims a person made it. Delete this parameter
once no such session can still be alive.

`visibility` is the visibility a header call that creates the session asks for. It
is ignored on an existing session, and a `private` without an owner is dropped.
A call with a `visibility` may carry no header field: it only creates the session
(the /w pre-create of a new chat) and changes nothing on an existing one. Without
a `visibility`, a body with no header field (an empty or wrapped body) is refused.

## Parameters

- `session_id` (in query, string, required)
- `name_source` (in query, string, one of: "manual", "automatic")
- `visibility` (in query, string, one of: "private", "project")

## Request body schema

Content type: `application/json` (required)

- `name` (string, nullable)
- `description` (string, nullable)
- `replacing_name` (string, nullable)
- `replacing_revision` (integer, nullable)

## Response schemas

### 200: Successful Response

- `stream` (object, nullable)
  - `created_at` (string (date-time), nullable)
  - `updated_at` (string (date-time), nullable)
  - `deleted_at` (string (date-time), nullable)
  - `created_by_id` (string (uuid), nullable)
  - `updated_by_id` (string (uuid), nullable)
  - `deleted_by_id` (string (uuid), nullable)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `id` (string (uuid), nullable)
  - `project_id` (string (uuid), required)
  - `session_id` (string, required)
  - `flags` (object): The nest as primitive bools (alive ⊇ running ⊇ attached). resumable (alive & !running) and reattachable (running & !attached) are derived client-side, never stored. Default: `{"is_alive":false,"is_running":false,"is_attached":false}`.
    - `is_alive` (boolean) Default: `false`.
    - `is_running` (boolean) Default: `false`.
    - `is_attached` (boolean) Default: `false`.
  - `capabilities` (object) Default: `{"shared_reader":false}`.
    - `shared_reader` (boolean): Deployment-wide shared-reader switch; version one has no project allowlist. Default: `false`.
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `turn_id` (string, nullable)
  - `turn_started_at` (string (date-time), nullable)
  - `stopping_turn_id` (string, nullable)
  - `references` (array of object, nullable)
    - `version` (string, nullable)
    - `slug` (string, nullable)
    - `id` (string (uuid), nullable)
    - `key` (string, nullable)
  - `archived_at` (string (date-time), nullable)
  - `origin` (string, one of: "manual", "trigger", "channel", "api", "calling_session", nullable)
  - `trigger` (object, nullable)
    - `id` (string (uuid), required)
    - `kind` (string, one of: "schedule", "subscription", required)
    - `name` (string, nullable)
  - `delivery` (object, nullable)
    - `id` (string (uuid), required)
  - `calling_session` (object, nullable)
    - `id` (string, required)
    - `turn_id` (string, required)
    - `agent_id` (string (uuid), required)
    - `revision_id` (string (uuid), nullable)
  - `visibility` (string, one of: "private", "project") Default: `"project"`.
  - `owner_user_id` (string (uuid), nullable)
  - `sharing` (object, nullable)
    - `policy` (object, required)
    - `owner_is_active` (boolean, required)
    - `grants` (array of object, required)
    - `my_role` (string, one of: "owner", "participant", "viewer", "none", required): What the caller is on an item. Computed, never stored.
    - `can_send` (boolean, required)
    - `shareable` (boolean, required)
    - `not_shareable_reason` (string, one of: "channel", "ownerless", "no_agent", nullable)
    - `agent_hidden` (boolean, nullable)
- `capabilities` (object)
  - `durable_approvals` (boolean) Default: `true`.
  - `queue` (boolean) Default: `true`.
  - `steer` (boolean) Default: `true`.
- `runner_address` (string): The address of the runner pod that ran the stream's last turn. Filled only for a caller that proves it is runner infrastructure; empty when unknown. A routing hint, not proof that the pod is alive. Default: `""`.
- `runner_replica_id` (string): The replica id of the runner pod at runner_address. The caller checks it against the pod's health answer before it uses the address, because a dead pod's IP can pass to another pod. Filled under the same condition as runner_address; empty when unknown. Default: `""`.
- … more fields: see the OpenAPI specification.

### 422: Validation Error

- `detail` (array of object)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (Context)
