# Share a session via the API

> Create a shareable read-only link for any session via the API.

canonical: https://agentsky.dev/help/session-sharing-api
source: https://agentsky.dev/help/session-sharing-api.md
updated: 2026-10-21

---

**Create a shareable read-only link for any session via the API.**

A shared session link lets anyone with the URL read the transcript and fork it — without needing an AgentSky account. You can also embed a shared session in your own page.

**How to create a share link:**

1. `POST /api/v1/sessions/{id}/share` with `{ "enabled": true }`.
2. The response includes `shareUrl` — a link in the form `/s/{token}`.
3. Share that URL. Anyone who opens it can read the full transcript and fork the session to their own workspace.

**Embedding a shared session:**

Add `?embed=1` and optionally `?theme=light` or `?theme=dark` to the share URL when embedding it in an iframe:

```html
<iframe src="https://agentsky.dev/s/abc123?embed=1&theme=light"></iframe>
```

**To revoke a share link:**

`POST /api/v1/sessions/{id}/share` with `{ "enabled": false }`. The link stops working immediately.

Where: API

**Good to know:** The link holder can read and fork the session but never edit it or send messages to it. One active share link per session. Related: [Share a chat with someone](https://agentsky.dev/help/share-a-chat), [Use the AgentSky API](https://agentsky.dev/help/api-overview).
