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
The unique identifier of the chat to update
Request Body
Chat data object to merge with existing chat. Any fields provided will update the corresponding fields in the existing chat.
Update the folder assignment
Response
Unique identifier for the chat
ID of the user who owns the chat
Updated chat title
Complete updated chat data object
Unix timestamp (epoch seconds) when chat was created
Unix timestamp (epoch seconds) when chat was last updated
ID for sharing the chat
Whether the chat is archived
Whether the chat is pinned
Metadata object
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
}
⌘I