Skip to main content
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

id
string
required
The unique identifier of the chat to update

Request Body

chat
object
required
Chat data object to merge with existing chat. Any fields provided will update the corresponding fields in the existing chat.
folder_id
string
Update the folder assignment

Response

id
string
required
Unique identifier for the chat
user_id
string
required
ID of the user who owns the chat
title
string
required
Updated chat title
chat
object
required
Complete updated chat data object
created_at
integer
required
Unix timestamp (epoch seconds) when chat was created
updated_at
integer
required
Unix timestamp (epoch seconds) when chat was last updated
share_id
string
ID for sharing the chat
archived
boolean
required
Whether the chat is archived
pinned
boolean
required
Whether the chat is pinned
meta
object
Metadata object
folder_id
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
}