Skip to content

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.

List all chat sessions for the authenticated user.

Auth required: Yes

Terminal window
curl https://app.thogits.com/api/chats \
-b cookies.txt -c cookies.txt

Response (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"
}
]

Create a new chat session.

Auth required: Yes

Request body:

FieldTypeRequiredDescription
titlestringNoSession title (default: "New chat")
Terminal window
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"
}

Retrieve a single chat session by ID.

Auth required: Yes

Terminal window
curl https://app.thogits.com/api/chats/01HQ9C3D4EFGHIJKL5MNOPQ6R \
-b cookies.txt -c cookies.txt

Response (200): The chat session object.

Errors:

StatusCause
404Chat session not found

Update a chat session’s title.

Auth required: Yes

Request body:

FieldTypeRequiredDescription
titlestringNoNew title
Terminal window
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:

StatusCause
404Chat session not found

Delete a chat session and all its messages.

Auth required: Yes

Terminal window
curl -X DELETE https://app.thogits.com/api/chats/01HQ9C3D4EFGHIJKL5MNOPQ6R \
-b cookies.txt -c cookies.txt

Response (200): The deleted chat session object.

Errors:

StatusCause
404Chat session not found

Retrieve all messages in a chat session.

Auth required: Yes

Terminal window
curl https://app.thogits.com/api/chats/01HQ9C3D4EFGHIJKL5MNOPQ6R/messages \
-b cookies.txt -c cookies.txt

Response (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"
}
]
FieldTypeDescription
message_idstringULID of the message
chat_idstringParent chat session ULID
rolestring"user" or "assistant"
contentstringMessage text content
tool_callsarray | nullTools the assistant invoked (assistant messages only)
created_atstringISO 8601 timestamp