---
title: "Share an AI conversation"
method: POST
path: "/api/{org_id}/ai/chats/{session_id}/shares"
tags: ["AI"]
---

# Share an AI conversation

`POST /api/{org_id}/ai/chats/{session_id}/shares`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/ai/chats/{session_id}/shares`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/ai/chats/:session_id/shares/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a share link for the caller's conversation: a snapshot of its history as of now, or a live view of it, for org members or (when public chat links are enabled) anyone holding the link. Tool inputs and outputs are part of the share unless `redact_tools` is set, which is the default for public links. Public links must expire.

## Path parameters

- `org_id` string, required
- `session_id` string, required

## Request body

- object
  - `expires_in_secs` integer, nullable: 60 s to 365 days, absent = never; public shares need one within the public maximum.
  - `mode` string, required: `snapshot` or `live`.
  - `redact_tools` boolean, nullable: Hide tool inputs and outputs from readers; defaults to true for public shares.
  - `visibility` string, required: `org` or `public`.

## Response `201`

The new share

- object: A share as its owner sees it.
  - `access_count` integer, required
  - `created_at` integer, required
  - `expires_at` integer, nullable: Microseconds since the epoch; absent when the share never expires.
  - `id` string, required
  - `last_accessed_at` integer, nullable
  - `mode` string, required
  - `owner_email` string, nullable: The creator's email; only in the org-wide admin listing.
  - `owner_name` string, nullable: The creator's display name (email when unnamed); only in the org-wide admin listing.
  - `redact_tools` boolean, required: Readers see assistant text and tool names, never tool inputs or outputs.
  - `session_id` string, required
  - `snapshot_seq` integer, nullable
  - `title` string, required
  - `token` string, nullable: Bearer secret of the link; absent on other creators' rows of the org-wide listing.
  - `updated_at` integer, required
  - `url_path` string, nullable: Path of the web page that shows the share; absent whenever `token` is.
  - `visibility` string, required

## Other responses

- `400`: Invalid request or nothing to share
- `404`: Unknown conversation
- `415`: The body is not JSON

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
