Skip to main content
POST
/
api
/
v1
/
shares
Create a shared history snapshot
curl --request POST \
  --url https://api.webless.ai/api/v1/shares \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_id": "a1c2d3e4-1111-2222-3333-444455556666",
  "template_id": "mr"
}
'
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({session_id: 'a1c2d3e4-1111-2222-3333-444455556666', template_id: 'mr'})
};

fetch('https://api.webless.ai/api/v1/shares', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.webless.ai/api/v1/shares"

payload = {
"session_id": "a1c2d3e4-1111-2222-3333-444455556666",
"template_id": "mr"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "conversation_history_id": "<string>",
  "session_id": "<string>",
  "history": [
    {
      "timestamp": 123,
      "query": "<string>",
      "summary": "<string>",
      "metadata": {},
      "responses": [
        "<unknown>"
      ],
      "user_id": "<string>"
    }
  ],
  "conversation_history": [
    "<unknown>"
  ]
}
{
"detail": "<string>",
"error": "<string>"
}
{
"detail": "<string>",
"error": "<string>"
}
Private sessions cannot be shared. Requests with is_private_session: true return 403.

Body

application/json
session_id
string
required

Session ID to share.

template_id
enum<string>
required

mr shares the full multi-request history. sr shares only the latest request.

Available options:
mr,
sr
use_history
boolean
default:false

When true, include query history and persist a reloadable snapshot.

is_private_session
boolean
default:false

Response

Share snapshot

conversation_history_id
string
template_id
enum<string>
Available options:
mr,
sr
session_id
string
history
object[]
conversation_history
any[]

Only present when use_history is true.