> ## 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.

# Get Thread Message Handler

> Get a specific message by its ID.

Use `with_details=false` to exclude execution step data and reduce payload size.



## OpenAPI

````yaml /openapi.yaml get /v1/threads/{thread_id}/messages/{message_id}
openapi: 3.1.0
info:
  title: Knowledge Stack API
  description: Knowledge Stack backend API for authentication and knowledge management
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Knowledge Stack API local dev server
security: []
tags:
  - name: auth
    description: Authentication and identity management
  - name: users
    description: User accounts
  - name: tenants
    description: Tenant management
  - name: invites
    description: Tenant invitations
  - name: folders
    description: Folder management
  - name: documents
    description: Document management
  - name: document-versions
    description: Document version management
  - name: sections
    description: Document sections
  - name: chunks
    description: Chunk CRUD and semantic search
  - name: chunk-lineages
    description: Chunk lineage tracking
  - name: tags
    description: Tag management
  - name: path-parts
    description: Path part traversal and tagging
  - name: Threads
    description: Thread conversations
  - name: Thread Messages
    description: Thread message management
  - name: user-permissions
    description: User path permissions
  - name: workflows
    description: Ingestion workflows
paths:
  /v1/threads/{thread_id}/messages/{message_id}:
    get:
      tags:
        - Thread Messages
      summary: Get Thread Message Handler
      description: >-
        Get a specific message by its ID.


        Use `with_details=false` to exclude execution step data and reduce
        payload size.
      operationId: get_thread_message
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Thread Id
        - name: message_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Message Id
        - name: with_details
          in: query
          required: false
          schema:
            type: boolean
            description: Include execution steps in response (default true)
            default: true
            title: With Details
          description: Include execution steps in response (default true)
        - name: authorization
          in: header
          required: false
          schema:
            type: string
            nullable: true
            title: Authorization
        - name: ks_uat
          in: cookie
          required: false
          schema:
            type: string
            nullable: true
            title: Ks Uat
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadMessageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ThreadMessageResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: ThreadMessage ID
        path_part_id:
          type: string
          format: uuid
          title: Path Part Id
          description: PathPart ID
        sequence:
          type: integer
          title: Sequence
          description: Sequence number (from path_part.name)
        role:
          $ref: '#/components/schemas/MessageRole'
          description: Message role
        content:
          $ref: '#/components/schemas/EnrichedThreadMessageContent'
          description: Message content
        details:
          $ref: '#/components/schemas/ThreadMessageDetails-Output'
          nullable: true
          description: Message details (None when not requested via with_details)
        parent_path_id:
          type: string
          format: uuid
          title: Parent Path Id
          description: Thread's PathPart ID
        materialized_path:
          type: string
          title: Materialized Path
          description: Full materialized path from root
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
          description: Tenant ID
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Last update timestamp
      additionalProperties: false
      type: object
      required:
        - id
        - path_part_id
        - sequence
        - role
        - content
        - parent_path_id
        - materialized_path
        - tenant_id
        - created_at
        - updated_at
      title: ThreadMessageResponse
      description: Thread message response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MessageRole:
      type: string
      enum:
        - USER
        - ASSISTANT
        - SYSTEM
      title: MessageRole
      description: Role of message author in thread.
    EnrichedThreadMessageContent:
      properties:
        text:
          type: string
          title: Text
          description: The text content of the message
        is_error:
          type: boolean
          nullable: true
          title: Is Error
          description: Whether this message represents a terminal assistant error
        citations:
          items:
            $ref: '#/components/schemas/EnrichedCitation'
          type: array
          nullable: true
          title: Citations
          description: A list of citations with document context
        references:
          items:
            $ref: '#/components/schemas/ResolvedReference-Output'
          type: array
          nullable: true
          title: References
          description: Resolved inline references attached to this message
      additionalProperties: false
      type: object
      required:
        - text
      title: EnrichedThreadMessageContent
      description: ThreadMessageContent with enriched citations for API responses.
    ThreadMessageDetails-Output:
      properties:
        steps:
          items:
            $ref: '#/components/schemas/Step-Output'
          type: array
          title: Steps
      additionalProperties: false
      type: object
      title: ThreadMessageDetails
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    EnrichedCitation:
      properties:
        chunk_id:
          type: string
          format: uuid
          title: Chunk Id
        quote:
          type: string
          title: Quote
          description: The quote from the chunk
        start_char:
          type: integer
          minimum: 0
          title: Start Char
          description: The 0-based start character of the quote in the chunk
        length:
          type: integer
          exclusiveMinimum: 0
          title: Length
          description: The length of the quote
        document_id:
          type: string
          format: uuid
          nullable: true
          title: Document Id
        document_version_id:
          type: string
          format: uuid
          nullable: true
          title: Document Version Id
        document_name:
          type: string
          nullable: true
          title: Document Name
        version_number:
          type: integer
          nullable: true
          title: Version Number
        path_part_id:
          type: string
          format: uuid
          nullable: true
          title: Path Part Id
        materialized_path:
          type: string
          nullable: true
          title: Materialized Path
      additionalProperties: false
      type: object
      required:
        - chunk_id
        - quote
        - start_char
        - length
      title: EnrichedCitation
      description: Citation with optional document context, populated at read time.
    ResolvedReference-Output:
      properties:
        ref_type:
          type: string
        entity_id:
          type: string
          format: uuid
          title: Entity Id
        display_name:
          type: string
          title: Display Name
          description: Human-readable name for the entity
        materialized_path:
          type: string
          nullable: true
          title: Materialized Path
          description: >-
            Full materialized path (None for entities without path parts, e.g.
            tags, users)
      type: object
      required:
        - ref_type
        - entity_id
        - display_name
      title: ResolvedReference
      description: >-
        A parsed reference enriched with display name and path from the
        database.


        Uses ``extra="ignore"`` (not ``"forbid"``) because SDK dicts may contain

        fields not yet modelled here.  Adding ``"forbid"`` would cause runtime

        deserialization failures whenever the SDK adds a new field.
    Step-Output:
      properties:
        id:
          type: string
          title: Id
          description: Stable step identifier within the message
        name:
          type: string
          title: Name
          description: The name of the step
        kind:
          $ref: '#/components/schemas/StepKind'
        args:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
          title: Args
          nullable: true
        detail:
          type: string
          nullable: true
          title: Detail
        start_time:
          type: string
          format: date-time
          title: Start Time
          description: The start time of the step
        end_time:
          type: string
          format: date-time
          nullable: true
          title: End Time
        steps:
          items:
            $ref: '#/components/schemas/Step-Output'
          type: array
          nullable: true
          title: Steps
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - kind
        - start_time
      title: Step
    StepKind:
      type: string
      enum:
        - reasoning
        - tool_call
        - subagent
      title: StepKind

````