curl -X POST "https://your-domain.com/api/chats/550e8400-e29b-41d4-a716-446655440000/share" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user-123",
"title": "AI Assistant Conversation",
"chat": {
"title": "AI Assistant Conversation",
"history": {
"messages": {
"msg-1": {
"id": "msg-1",
"role": "user",
"content": "Hello, how can you help me?",
"timestamp": 1709164800
},
"msg-2": {
"id": "msg-2",
"role": "assistant",
"content": "I'm here to help! What do you need?",
"model": "gpt-4",
"timestamp": 1709164805
}
},
"currentId": "msg-2"
}
},
"created_at": 1709164800,
"updated_at": 1709251200,
"share_id": "880h1733-h5ce-74g7-d049-779988773333",
"archived": false,
"pinned": false,
"meta": {
"tags": ["work", "ai_help"]
},
"folder_id": null
}
Chat & Messages
Share Chat
Share a chat to make it publicly accessible
POST
/
api
/
chats
/
{id}
/
share
curl -X POST "https://your-domain.com/api/chats/550e8400-e29b-41d4-a716-446655440000/share" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user-123",
"title": "AI Assistant Conversation",
"chat": {
"title": "AI Assistant Conversation",
"history": {
"messages": {
"msg-1": {
"id": "msg-1",
"role": "user",
"content": "Hello, how can you help me?",
"timestamp": 1709164800
},
"msg-2": {
"id": "msg-2",
"role": "assistant",
"content": "I'm here to help! What do you need?",
"model": "gpt-4",
"timestamp": 1709164805
}
},
"currentId": "msg-2"
}
},
"created_at": 1709164800,
"updated_at": 1709251200,
"share_id": "880h1733-h5ce-74g7-d049-779988773333",
"archived": false,
"pinned": false,
"meta": {
"tags": ["work", "ai_help"]
},
"folder_id": null
}
Creates a publicly shareable version of the chat. If the chat is already shared, updates the shared version with the latest chat data.
Users require the
chat.share permission to share chats. Admin users can share any chat.Path Parameters
string
required
The unique identifier of the chat to share
Response
string
required
Unique identifier for the chat
string
required
ID of the user who owns the chat
string
required
Chat title
object
required
Complete chat data object
integer
required
Unix timestamp (epoch seconds) when chat was created
integer
required
Unix timestamp (epoch seconds) when chat was last updated
string
required
ID for accessing the shared chat publicly. Use this ID to construct the share URL.
boolean
required
Whether the chat is archived
boolean
required
Whether the chat is pinned
object
Metadata object
string
ID of the folder containing this chat
curl -X POST "https://your-domain.com/api/chats/550e8400-e29b-41d4-a716-446655440000/share" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user-123",
"title": "AI Assistant Conversation",
"chat": {
"title": "AI Assistant Conversation",
"history": {
"messages": {
"msg-1": {
"id": "msg-1",
"role": "user",
"content": "Hello, how can you help me?",
"timestamp": 1709164800
},
"msg-2": {
"id": "msg-2",
"role": "assistant",
"content": "I'm here to help! What do you need?",
"model": "gpt-4",
"timestamp": 1709164805
}
},
"currentId": "msg-2"
}
},
"created_at": 1709164800,
"updated_at": 1709251200,
"share_id": "880h1733-h5ce-74g7-d049-779988773333",
"archived": false,
"pinned": false,
"meta": {
"tags": ["work", "ai_help"]
},
"folder_id": null
}
Notes
- The
share_idin the response can be used to construct a public share URL - If the chat is already shared, this endpoint updates the shared version with the latest chat content
- Shared chats are stored as separate chat records with a
user_idofshared-{original_chat_id} - To unshare a chat, use the
DELETE /api/chats/{id}/shareendpoint - Non-admin users require
chat.sharepermission to use this endpoint