Skip to main content
POST
/
v1
/
threads
/
{thread_id}
/
messages
Create Thread Message Handler
curl --request POST \
  --url http://localhost:8000/v1/threads/{thread_id}/messages \
  --header 'Content-Type: application/json' \
  --data '
{
  "role": "USER",
  "content": {
    "text": "<string>",
    "is_error": true,
    "citations": [
      {
        "chunk_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "quote": "<string>",
        "start_char": 1,
        "length": 123
      }
    ],
    "references": [
      {
        "ref_type": "FOLDER",
        "entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "display_name": "<string>",
        "materialized_path": "<string>"
      }
    ]
  },
  "message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "details": {
    "steps": [
      {
        "id": "<string>",
        "name": "<string>",
        "kind": "reasoning",
        "start_time": "2023-11-07T05:31:56Z",
        "args": "<string>",
        "detail": "<string>",
        "end_time": "2023-11-07T05:31:56Z",
        "steps": "<array>"
      }
    ]
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sequence": 123,
  "role": "USER",
  "content": {
    "text": "<string>",
    "is_error": true,
    "citations": [
      {
        "chunk_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "quote": "<string>",
        "start_char": 1,
        "length": 123,
        "document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "document_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "document_name": "<string>",
        "version_number": 123,
        "path_part_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "materialized_path": "<string>"
      }
    ],
    "references": [
      {
        "ref_type": "<string>",
        "entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "display_name": "<string>",
        "materialized_path": "<string>"
      }
    ]
  },
  "parent_path_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "materialized_path": "<string>",
  "tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "details": {
    "steps": [
      {
        "id": "<string>",
        "name": "<string>",
        "kind": "reasoning",
        "start_time": "2023-11-07T05:31:56Z",
        "args": "<string>",
        "detail": "<string>",
        "end_time": "2023-11-07T05:31:56Z",
        "steps": "<array>"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.knowledgestack.ai/llms.txt

Use this file to discover all available pages before exploring further.

Headers

authorization
string | null

Path Parameters

thread_id
string<uuid>
required

Cookies

ks_uat
string | null

Body

application/json

Request to create a new thread message.

role
enum<string>
required

Role of the message author (USER, ASSISTANT, SYSTEM)

Available options:
USER,
ASSISTANT,
SYSTEM
content
ThreadMessageContent · object
required

Message content (text + citations)

message_id
string<uuid> | null

Optional caller-supplied ThreadMessage ID for idempotent creates.

details
ThreadMessageDetails · object

Message details (execution steps). Omit for user messages.

Response

Successful Response

Thread message response model.

id
string<uuid>
required

ThreadMessage ID

path_part_id
string<uuid>
required

PathPart ID

sequence
integer
required

Sequence number (from path_part.name)

role
enum<string>
required

Message role

Available options:
USER,
ASSISTANT,
SYSTEM
content
EnrichedThreadMessageContent · object
required

Message content

parent_path_id
string<uuid>
required

Thread's PathPart ID

materialized_path
string
required

Full materialized path from root

tenant_id
string<uuid>
required

Tenant ID

created_at
string<date-time>
required

Creation timestamp

updated_at
string<date-time>
required

Last update timestamp

details
ThreadMessageDetails · object

Message details (None when not requested via with_details)