curl -X POST "https://your-domain.com/api/chats/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat": {
"title": "Updated Chat Title",
"history": {
"messages": {
"msg-3": {
"id": "msg-3",
"role": "user",
"content": "Can you help me with coding?",
"timestamp": 1709338000
}
},
"currentId": "msg-3"
}
}
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user-123",
"title": "Updated Chat Title",
"chat": {
"title": "Updated Chat Title",
"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
},
"msg-3": {
"id": "msg-3",
"role": "user",
"content": "Can you help me with coding?",
"timestamp": 1709338000
}
},
"currentId": "msg-3"
}
},
"created_at": 1709164800,
"updated_at": 1709338000,
"share_id": null,
"archived": false,
"pinned": false,
"meta": {
"tags": ["work", "ai_help"]
},
"folder_id": null
}
Chat & Messages
Update Chat
Update an existing chat’s data
POST
/
api
/
chats
/
{id}
curl -X POST "https://your-domain.com/api/chats/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat": {
"title": "Updated Chat Title",
"history": {
"messages": {
"msg-3": {
"id": "msg-3",
"role": "user",
"content": "Can you help me with coding?",
"timestamp": 1709338000
}
},
"currentId": "msg-3"
}
}
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user-123",
"title": "Updated Chat Title",
"chat": {
"title": "Updated Chat Title",
"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
},
"msg-3": {
"id": "msg-3",
"role": "user",
"content": "Can you help me with coding?",
"timestamp": 1709338000
}
},
"currentId": "msg-3"
}
},
"created_at": 1709164800,
"updated_at": 1709338000,
"share_id": null,
"archived": false,
"pinned": false,
"meta": {
"tags": ["work", "ai_help"]
},
"folder_id": null
}
Updates a chat by merging the provided chat data with the existing chat. Only fields included in the request will be updated.
Path Parameters
string
required
The unique identifier of the chat to update
Request Body
object
required
Chat data object to merge with existing chat. Any fields provided will update the corresponding fields in the existing chat.
string
Update the folder assignment
Response
string
required
Unique identifier for the chat
string
required
ID of the user who owns the chat
string
required
Updated chat title
object
required
Complete updated 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
ID for sharing the chat
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" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat": {
"title": "Updated Chat Title",
"history": {
"messages": {
"msg-3": {
"id": "msg-3",
"role": "user",
"content": "Can you help me with coding?",
"timestamp": 1709338000
}
},
"currentId": "msg-3"
}
}
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user-123",
"title": "Updated Chat Title",
"chat": {
"title": "Updated Chat Title",
"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
},
"msg-3": {
"id": "msg-3",
"role": "user",
"content": "Can you help me with coding?",
"timestamp": 1709338000
}
},
"currentId": "msg-3"
}
},
"created_at": 1709164800,
"updated_at": 1709338000,
"share_id": null,
"archived": false,
"pinned": false,
"meta": {
"tags": ["work", "ai_help"]
},
"folder_id": null
}