---
title: "Enable Chat Sharing"
method: POST
path: "/api/chat/sessions/{session_id}/share"
tags: ["v2", "chat", "share", "chat", "share"]
---

# Enable Chat Sharing

`POST /api/chat/sessions/{session_id}/share`

Enable sharing for a chat session.

Flag-gated: refuses with 403 when ``chat-sharing`` is off so a stale
frontend cannot enable shares post-rollback.

## Path parameters

- `session_id` string, required

## Request body

- EnableShareRequest — Whether to auto-link every ``run_agent`` execution in this chat. When true, the backend creates ``ChatLinkedShare`` rows for every existing agent run AND auto-links any new runs that land while the share is active. When false, only the chat messages are shared (cards in the viewer render in their "execution not shared" state).
  - `auto_share_executions` boolean

## Response `200`

Successful Response

- BackendApiFeaturesChatShareShareResponse
  - `share_url` string, required
  - `share_token` string, required

## Other responses

- `401` — Authentication required
- `403` — Chat sharing is not enabled for this user
- `404` — Chat session not found for user
- `422` — Validation Error

---

[API](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/versions/382041c7ecb2/schema)
