---
title: "Share a chat session"
method: POST
path: "/shared_chats"
tags: ["Shared Chats"]
---

# Share a chat session

`POST /shared_chats`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/shared_chats`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/shared_chats/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a shared chat from an existing chat session. Returns a URL that can be used to access the shared chat.

## Request body

- ShareChatRequest
  - `chat_session_id` string, required: ID of the chat session to share.
  - `is_private` boolean: Whether the shared chat requires authentication to view.
  - `is_frozen` boolean: Whether to capture a snapshot of the chat at share time.
  - `includes_artifacts` boolean: Whether to include file artifacts in the shared chat.

## Response `201`

Successful operation

- ShareChatResponse
  - `url` string, required: Full URL to access the shared chat.
  - `relative_path` string, required: Relative path to the shared chat.

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
