# Restrict Session To Owner

Source: https://agenta.ai/docs/reference/api/restrict-session-to-owner

`POST /sessions/{session_id}/sharing/only-me`

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`.

Restrict Session To Owner

## Parameters

- `session_id` (in path, string, required)

## Response schemas

### 200: Successful Response

- `count` (integer) Default: `1`.
- `sharing` (object, required)
  - `policy` (object, required)
    - `visibility` (string, one of: "private", "project", required)
    - `owner_user_id` (string (uuid), nullable)
  - `owner_is_active` (boolean, required)
  - `grants` (array of object, required)
    - `stream_id` (string (uuid), required)
    - `user_id` (string (uuid), required)
    - `role` (string, one of: "viewer", "participant", required)
    - `created_at` (string (date-time), nullable)
    - `created_by_id` (string (uuid), nullable)
  - `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)
- `disclosure` (object, nullable): What sharing discloses. None when the session cannot be shared.
  - `connections` (array of object, required)
    - `provider` (string, required)
    - `integration` (string, required)
    - `connection` (string, nullable)
    - `account_source` (string, one of: "agent", "user", nullable)
  - `private_drives` (array of string) Default: `[]`.
  - `agents_using_private_drives` (array of string) Default: `[]`.
  - `turns_use_run_credentials` (boolean) Default: `true`.
  - `files_and_tool_results_shared` (boolean) Default: `true`.
  - `trace_readers_can_read` (boolean) Default: `true`.

### 422: Validation Error

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