Chats
Chat sessions organize conversations with the AI assistant. Each session has a title and contains a history of messages. For sending messages and receiving AI responses, see AI Chat.
GET /chats
Section titled “GET /chats”List all chat sessions for the authenticated user.
Auth required: Yes
curl https://app.thogits.com/api/chats \ -b cookies.txt -c cookies.txtResponse (200):
[ { "chat_id": "01HQ9B2C3DEFGHIJK4LMNOP5Q", "title": "Help me organize my reading list", "created_at": "2025-01-15T10:00:00Z", "updated_at": "2025-01-15T10:45:00Z" }, { "chat_id": "01HQ9A1B2CDEFGHIJK3LMNOP4Q", "title": "New chat", "created_at": "2025-01-14T16:00:00Z", "updated_at": "2025-01-14T16:00:00Z" }]POST /chats
Section titled “POST /chats”Create a new chat session.
Auth required: Yes
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
title | string | No | Session title (default: "New chat") |
curl -X POST https://app.thogits.com/api/chats \ -H "Content-Type: application/json" \ -b cookies.txt -c cookies.txt \ -d '{"title": "Project planning"}'Response (200): The full chat session object.
{ "chat_id": "01HQ9C3D4EFGHIJKL5MNOPQ6R", "title": "Project planning", "created_at": "2025-01-15T11:00:00Z", "updated_at": "2025-01-15T11:00:00Z"}GET /chats/{chat_id}
Section titled “GET /chats/{chat_id}”Retrieve a single chat session by ID.
Auth required: Yes
curl https://app.thogits.com/api/chats/01HQ9C3D4EFGHIJKL5MNOPQ6R \ -b cookies.txt -c cookies.txtResponse (200): The chat session object.
Errors:
| Status | Cause |
|---|---|
| 404 | Chat session not found |
PUT /chats/{chat_id}
Section titled “PUT /chats/{chat_id}”Update a chat session’s title.
Auth required: Yes
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
title | string | No | New title |
curl -X PUT https://app.thogits.com/api/chats/01HQ9C3D4EFGHIJKL5MNOPQ6R \ -H "Content-Type: application/json" \ -b cookies.txt -c cookies.txt \ -d '{"title": "Q1 Project Planning"}'Response (200): The updated chat session object.
Errors:
| Status | Cause |
|---|---|
| 404 | Chat session not found |
DELETE /chats/{chat_id}
Section titled “DELETE /chats/{chat_id}”Delete a chat session and all its messages.
Auth required: Yes
curl -X DELETE https://app.thogits.com/api/chats/01HQ9C3D4EFGHIJKL5MNOPQ6R \ -b cookies.txt -c cookies.txtResponse (200): The deleted chat session object.
Errors:
| Status | Cause |
|---|---|
| 404 | Chat session not found |
GET /chats/{chat_id}/messages
Section titled “GET /chats/{chat_id}/messages”Retrieve all messages in a chat session.
Auth required: Yes
curl https://app.thogits.com/api/chats/01HQ9C3D4EFGHIJKL5MNOPQ6R/messages \ -b cookies.txt -c cookies.txtResponse (200):
[ { "message_id": "01HQ9D4E5FGHIJKLM6NOPQR7S", "chat_id": "01HQ9C3D4EFGHIJKL5MNOPQ6R", "role": "user", "content": "Create a tag called Project with status and priority fields", "tool_calls": null, "created_at": "2025-01-15T11:01:00Z" }, { "message_id": "01HQ9D5F6GHIJKLMN7OPQRS8T", "chat_id": "01HQ9C3D4EFGHIJKL5MNOPQ6R", "role": "assistant", "content": "I've created the Project tag with a Select field for status and a String field for priority.", "tool_calls": [ { "name": "create_tag", "arguments": {"name": "Project", "fields": {"status": {"type": "Select", "variants": ["Active", "Completed"]}, "priority": "String"}} } ], "created_at": "2025-01-15T11:01:05Z" }]| Field | Type | Description |
|---|---|---|
message_id | string | ULID of the message |
chat_id | string | Parent chat session ULID |
role | string | "user" or "assistant" |
content | string | Message text content |
tool_calls | array | null | Tools the assistant invoked (assistant messages only) |
created_at | string | ISO 8601 timestamp |