> ## Documentation Index
> Fetch the complete documentation index at: https://hub.hcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Share a session

> Make a session publicly viewable through a share URL.

Makes a session publicly accessible via a share URL. Anyone with the link can view the session without authentication. Revoke it with [Unshare](/agents-api/sessions/unshare).

**Returns** `200` with a `ShareLink` object.

***

## Path parameters

<ParamField path="id" type="string" required>
  The session ID.
</ParamField>

***

## Response

```json Response theme={"system"}
{
  "share_url": "/share/api/v1/trajectories/{id}"
}
```

`share_url` is a path relative to the API host you called, so prepend your regional base URL (for example `https://agp.eu.hcompany.ai`) before handing it out.

***

## Examples

<CodeGroup>
  ```bash cURL theme={"system"}
  curl -X POST https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/share \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={"system"}
  from hai_agents import Client

  client = Client()

  link = client.sessions.share_session(session_id)
  print(link.share_url)
  ```

  ```typescript TypeScript theme={"system"}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  const link = await client.sessions.shareSession({ id: sessionId });
  console.log(link.shareUrl);
  ```

  ```bash CLI theme={"system"}
  hai sessions share "$SESSION_ID"
  ```
</CodeGroup>
