Dashboard
DocsAPI ReferenceChats API

Chats API

Endpoints for managing conversations and sending messages within a project.

GET/api/projects/{project_id}/chats
List all conversations in a project.

Response

json
[
  {
    "id": "uuid",
    "title": "Research Questions",
    "project_id": "uuid",
    "created_at": "2025-01-01T00:00:00Z"
  }
]
POST/api/projects/{project_id}/chats
Create a new conversation in a project.

Response

json
{
  "id": "uuid",
  "title": "New Chat",
  "project_id": "uuid",
  "created_at": "2025-01-01T00:00:00Z"
}
DELETE/api/projects/{project_id}/chats/{chat_id}
Delete a conversation and all its messages.

Path Parameters

ParameterTypeDescription
chat_id requireduuidID of the conversation to delete
POST/api/projects/{project_id}/chats/{chat_id}/messages
Send a message to the AI assistant and receive a response with citations.

Request Body

ParameterTypeDescription
message requiredstringThe user's question or message

Response

json
{
  "response": "Based on the documents, the key findings are...",
  "citations": [
    {
      "document_name": "research-paper.pdf",
      "page_number": 5,
      "content": "The study found that...",
      "chunk_id": "uuid"
    }
  ]
}
GET/api/projects/{project_id}/chats/{chat_id}/messages
Retrieve all messages in a conversation.

Response

json
[
  {
    "id": "uuid",
    "role": "user",
    "content": "What are the key findings?",
    "created_at": "2025-01-01T00:00:00Z"
  },
  {
    "id": "uuid",
    "role": "assistant",
    "content": "Based on the documents...",
    "citations": [...],
    "created_at": "2025-01-01T00:00:01Z"
  }
]
Was this page helpful?