> ## Documentation Index
> Fetch the complete documentation index at: https://docs.threetone.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Knowledge Base Document

> Get a specific knowledge base document by ID with full content.



## OpenAPI

````yaml https://api.threetone.in/openapi.json get /v1/voiceai/knowledge-base/{document_id}
openapi: 3.1.0
info:
  title: Threetone API Documentation
  version: 1.0.0
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/voiceai/knowledge-base/{document_id}:
    get:
      tags:
        - Knowledge Base
      summary: Get Knowledge Base Document
      description: Get a specific knowledge base document by ID with full content.
      operationId: get_knowledge_base_document
      parameters:
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            title: Document Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/GetKnowledgeBaseURLResponseModel'
                  - $ref: '#/components/schemas/GetKnowledgeBaseFileResponseModel'
                  - $ref: '#/components/schemas/GetKnowledgeBaseTextResponseModel'
                  - $ref: '#/components/schemas/GetKnowledgeBaseFolderResponseModel'
                discriminator:
                  propertyName: type
                  mapping:
                    url:
                      $ref: '#/components/schemas/GetKnowledgeBaseURLResponseModel'
                    file:
                      $ref: '#/components/schemas/GetKnowledgeBaseFileResponseModel'
                    text:
                      $ref: '#/components/schemas/GetKnowledgeBaseTextResponseModel'
                    folder:
                      $ref: '#/components/schemas/GetKnowledgeBaseFolderResponseModel'
                title: Response Get Knowledge Base Document
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    GetKnowledgeBaseURLResponseModel:
      properties:
        id:
          type: string
          title: Id
          description: Document ID
        name:
          type: string
          title: Name
          description: Document name
        metadata:
          $ref: '#/components/schemas/KnowledgeBaseDocumentMetadataResponseModel'
          description: Document metadata
        supported_usages:
          items:
            $ref: '#/components/schemas/DocumentUsageModeEnum'
          type: array
          title: Supported Usages
          description: Supported usage modes for this document
        access_info:
          $ref: '#/components/schemas/ResourceAccessInfo'
          description: Access information for the requesting user
        folder_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Folder Parent Id
          description: >-
            The ID of the parent folder, or null if the document is at the root
            level.
        folder_path:
          items:
            $ref: '#/components/schemas/KnowledgeBaseFolderPathSegmentResponseModel'
          type: array
          title: Folder Path
          description: >-
            The folder path segments leading to this entity, from root to parent
            folder.
        type:
          type: string
          const: url
          title: Type
          description: Document type discriminator
          default: url
        url:
          type: string
          title: Url
          description: The source URL
        extracted_inner_html:
          type: string
          title: Extracted Inner Html
          description: The extracted content from the URL
      type: object
      required:
        - id
        - name
        - metadata
        - access_info
        - url
        - extracted_inner_html
      title: GetKnowledgeBaseURLResponseModel
      description: Knowledge base document response for URL type
    GetKnowledgeBaseFileResponseModel:
      properties:
        id:
          type: string
          title: Id
          description: Document ID
        name:
          type: string
          title: Name
          description: Document name
        metadata:
          $ref: '#/components/schemas/KnowledgeBaseDocumentMetadataResponseModel'
          description: Document metadata
        supported_usages:
          items:
            $ref: '#/components/schemas/DocumentUsageModeEnum'
          type: array
          title: Supported Usages
          description: Supported usage modes for this document
        access_info:
          $ref: '#/components/schemas/ResourceAccessInfo'
          description: Access information for the requesting user
        folder_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Folder Parent Id
          description: >-
            The ID of the parent folder, or null if the document is at the root
            level.
        folder_path:
          items:
            $ref: '#/components/schemas/KnowledgeBaseFolderPathSegmentResponseModel'
          type: array
          title: Folder Path
          description: >-
            The folder path segments leading to this entity, from root to parent
            folder.
        type:
          type: string
          const: file
          title: Type
          description: Document type discriminator
          default: file
        extracted_inner_html:
          type: string
          title: Extracted Inner Html
          description: The extracted content from the file
        filename:
          type: string
          title: Filename
          description: Original filename
      type: object
      required:
        - id
        - name
        - metadata
        - access_info
        - extracted_inner_html
        - filename
      title: GetKnowledgeBaseFileResponseModel
      description: Knowledge base document response for file type
    GetKnowledgeBaseTextResponseModel:
      properties:
        id:
          type: string
          title: Id
          description: Document ID
        name:
          type: string
          title: Name
          description: Document name
        metadata:
          $ref: '#/components/schemas/KnowledgeBaseDocumentMetadataResponseModel'
          description: Document metadata
        supported_usages:
          items:
            $ref: '#/components/schemas/DocumentUsageModeEnum'
          type: array
          title: Supported Usages
          description: Supported usage modes for this document
        access_info:
          $ref: '#/components/schemas/ResourceAccessInfo'
          description: Access information for the requesting user
        folder_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Folder Parent Id
          description: >-
            The ID of the parent folder, or null if the document is at the root
            level.
        folder_path:
          items:
            $ref: '#/components/schemas/KnowledgeBaseFolderPathSegmentResponseModel'
          type: array
          title: Folder Path
          description: >-
            The folder path segments leading to this entity, from root to parent
            folder.
        type:
          type: string
          const: text
          title: Type
          description: Document type discriminator
          default: text
        extracted_inner_html:
          type: string
          title: Extracted Inner Html
          description: The text content
      type: object
      required:
        - id
        - name
        - metadata
        - access_info
        - extracted_inner_html
      title: GetKnowledgeBaseTextResponseModel
      description: Knowledge base document response for text type
    GetKnowledgeBaseFolderResponseModel:
      properties:
        id:
          type: string
          title: Id
          description: Document ID
        name:
          type: string
          title: Name
          description: Document name
        metadata:
          $ref: '#/components/schemas/KnowledgeBaseDocumentMetadataResponseModel'
          description: Document metadata
        supported_usages:
          items:
            $ref: '#/components/schemas/DocumentUsageModeEnum'
          type: array
          title: Supported Usages
          description: Supported usage modes for this document
        access_info:
          $ref: '#/components/schemas/ResourceAccessInfo'
          description: Access information for the requesting user
        folder_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Folder Parent Id
          description: >-
            The ID of the parent folder, or null if the document is at the root
            level.
        folder_path:
          items:
            $ref: '#/components/schemas/KnowledgeBaseFolderPathSegmentResponseModel'
          type: array
          title: Folder Path
          description: >-
            The folder path segments leading to this entity, from root to parent
            folder.
        type:
          type: string
          const: folder
          title: Type
          description: Document type discriminator
          default: folder
        children_count:
          type: integer
          title: Children Count
          description: Number of direct children in the folder
      type: object
      required:
        - id
        - name
        - metadata
        - access_info
        - children_count
      title: GetKnowledgeBaseFolderResponseModel
      description: >-
        Knowledge base document response for folder type (no
        extracted_inner_html)
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KnowledgeBaseDocumentMetadataResponseModel:
      properties:
        created_at_unix_secs:
          type: integer
          title: Created At Unix Secs
          description: Document creation time in unix seconds
        last_updated_at_unix_secs:
          type: integer
          title: Last Updated At Unix Secs
          description: Document last update time in unix seconds
        size_bytes:
          type: integer
          title: Size Bytes
          description: Document size in bytes
      type: object
      required:
        - created_at_unix_secs
        - last_updated_at_unix_secs
        - size_bytes
      title: KnowledgeBaseDocumentMetadataResponseModel
      description: Metadata for knowledge base documents - matches enterprise schema
    DocumentUsageModeEnum:
      type: string
      enum:
        - prompt
        - auto
      title: DocumentUsageModeEnum
      description: |-
        How the document is used in agent context.
        - prompt: Always include full document in LLM context
        - auto: Use RAG to retrieve relevant chunks
    ResourceAccessInfo:
      properties:
        is_creator:
          type: boolean
          title: Is Creator
          description: Whether the user making the request is the creator of the resource
        creator_name:
          type: string
          title: Creator Name
          description: Name of the resource's creator
        creator_email:
          type: string
          title: Creator Email
          description: Email of the resource's creator
        role:
          $ref: '#/components/schemas/ResourceRole'
          description: The role of the user making the request
      type: object
      required:
        - is_creator
        - creator_name
        - creator_email
        - role
      title: ResourceAccessInfo
      description: Access information for a resource
    KnowledgeBaseFolderPathSegmentResponseModel:
      properties:
        id:
          type: string
          title: Id
          description: Folder ID
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Folder name
      type: object
      required:
        - id
      title: KnowledgeBaseFolderPathSegmentResponseModel
      description: Folder path segment for hierarchical navigation
    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
    ResourceRole:
      type: string
      enum:
        - admin
        - editor
        - commenter
        - viewer
      title: ResourceRole
      description: Role for resource access control
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API key for programmatic access
      in: header
      name: x-api-key
    HTTPBearer:
      type: http
      description: JWT Bearer token for dashboard access
      scheme: bearer

````