---
title: "Set Session Visibility"
method: POST
path: "/sessions/{session_id}/sharing/visibility"
tags: ["Sharing"]
---

# Set Session Visibility

`POST /sessions/{session_id}/sharing/visibility`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/sessions/{session_id}/sharing/visibility`
- Auth: API key in header `Authorization`

## Path parameters

- `session_id` string, required

## Request body

- SessionVisibilityRequest
  - `visibility` 'private' | 'project', required

## Response `200`

Successful Response

- SessionSharingResponse
  - `count` integer
  - `sharing` SessionSharingState, required
    - `policy` AccessPolicy, required
      - `visibility` 'private' | 'project', required
      - `owner_user_id` string, uuid, nullable
    - `owner_is_active` boolean, required
    - `grants` SessionGrant[], required
      - `stream_id` string, uuid, required
      - `user_id` string, uuid, required
      - `role` 'viewer' | 'participant', required
      - `created_at` string, date-time, nullable
      - `created_by_id` string, uuid, nullable
    - `my_role` '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` 'channel' | 'ownerless' | 'no_agent': Why a session cannot be shared (the reason of `SessionNotShareable`).
    - `agent_hidden` boolean, nullable
  - `disclosure` ShareDisclosure: What sharing an agent or a session lets others reach. The three statements are always true; the UI owns their text.
    - `connections` DisclosedConnection[], required
      - `provider` string, required
      - `integration` string, required
      - `connection` string, required
    - `turns_use_run_credentials` boolean
    - `files_and_tool_results_shared` boolean
    - `trace_readers_can_read` boolean

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-26** `7adb3c40354e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/sessions/:session_id/sharing/visibility/post.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) - [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agenta-ai/apis/agenta-api/revisions/c73e2d6d0d56?raw)
