---
title: "Turn sharing on and get the share link — idempotent; {\"access\": \"view\"} asks for a view-only link; {\"rotate\": true} replaces it [write]"
method: POST
path: "/sessions/{id}/share"
---

# Turn sharing on and get the share link — idempotent; {"access": "view"} asks for a view-only link; {"rotate": true} replaces it \[write\]

`POST /sessions/{id}/share`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/sessions/{id}/share`
- Auth: HTTP bearer

A guest link (access prompt, the default) has a shareUrl that opens the session's guest page for anyone holding it, with no account; turns sent through it bill the session's owner. A view-only link (access view) has no shareUrl: anyone holding its token reads the conversation's text at GET /links/{token}/events and can do nothing else. A session has one link; asking for the other access level replaces it with a new token, so the old URL dies. Rotating keeps the level and kills the old URL immediately; rotate cannot be combined with access.

## Path parameters

- `id` string, required

## Request body

- object
  - `rotate` boolean
  - `access` 'prompt' | 'view'

## Response `200`

OK

- SessionShareLink: token is null when sharing is off. A guest link carries shareUrl; a view-only link does not.
  - `token` string, nullable, required
  - `access` 'prompt' | 'view'
  - `shareUrl` string

## Other responses

- `default`: Error — { error: { code, message, request_id } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 breaking, 7 info
  - the response property `shareUrl` became optional for the status `200`
  - added the new optional request property `access`
  - added the optional property `access` to the response with the `200` status
  - added the optional property `error/request_id` to the response with the `default` status
  - …4 more

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/sessions/:id/share/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/8280a065ef6a?raw)
