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

# Get KB Source

> Returns a single knowledge base source with full content.



## OpenAPI

````yaml get /knowledge-base/sources/{sourceId}
openapi: 3.0.1
info:
  title: Attention Service V2
  description: Attention Service API V2
  termsOfService: https://www.attention.com/terms-of-use
  contact:
    name: Attention Team
    url: https://docs.attention.com/welcome
    email: support@attention.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.8.0
servers:
  - url: https://api.attention.tech/v2
security:
  - APIKeyHeader: []
paths:
  /knowledge-base/sources/{sourceId}:
    get:
      tags:
        - Knowledge Base
      summary: Get KB Source
      description: Returns a single knowledge base source with full content.
      operationId: getKBSource
      parameters:
        - name: sourceId
          in: path
          description: The unique identifier of the KB source
          required: true
          schema:
            type: string
      responses:
        '200':
          description: KB source details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KBSourceResponse'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/KBSourceResponse'
        '401':
          description: Valid API key required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: KB source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    KBSourceResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/KBSource'
      example:
        data:
          type: kb_sources
          id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
          attributes:
            title: Q4 Product Launch Playbook
            source_type: manual
            content: |-
              # Product Launch Playbook

              ## Overview
              This document covers the key steps...
            format: text/markdown
            status: indexed
            file_size: 4096
            chunk_count: 12
            created_at: '2025-01-15T10:30:00Z'
            updated_at: '2025-01-15T10:35:00Z'
    Error:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for the error.
        status:
          type: string
          description: >-
            The HTTP status code applicable to this problem, expressed as a
            string value.
        code:
          type: string
          description: An application-specific error code, expressed as a string value.
        title:
          type: string
          description: A short, human-readable summary of the problem.
        detail:
          type: string
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        source:
          type: object
          properties:
            pointer:
              type: string
            parameter:
              type: string
        meta:
          type: object
          properties: {}
      example:
        id: not_found_error
        status: '404'
        code: '404'
        title: Not Found Error
        detail: The requested resource was not found
        source:
          pointer: /data/attributes/id
    KBSource:
      type: object
      properties:
        type:
          type: string
          description: Resource type
        id:
          type: string
          description: Unique identifier of the KB source
        attributes:
          $ref: '#/components/schemas/KBSourceAttributes'
      example:
        type: kb_sources
        id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        attributes:
          title: Q4 Product Launch Playbook
          source_type: manual
          format: text/markdown
          status: indexed
          file_size: 4096
          chunk_count: 12
          created_at: '2025-01-15T10:30:00Z'
          updated_at: '2025-01-15T10:35:00Z'
    KBSourceAttributes:
      type: object
      properties:
        title:
          type: string
          description: Title of the KB source
        source_type:
          type: string
          description: 'Type of source: manual (inline content) or upload (S3 file)'
          enum:
            - manual
            - upload
        content:
          type: string
          description: Content of the source (present on get, absent on list)
        format:
          type: string
          description: >-
            Content format (e.g. text/markdown, application/pdf, text/html,
            text/plain)
        status:
          type: string
          description: Processing status of the source
          enum:
            - pending
            - uploading
            - indexing
            - indexed
            - failed
        file_size:
          type: integer
          description: File size in bytes
        chunk_count:
          type: integer
          description: Number of indexed chunks
        created_at:
          type: string
          description: Creation timestamp
          format: date-time
        updated_at:
          type: string
          description: Last update timestamp
          format: date-time
      example:
        title: Q4 Product Launch Playbook
        source_type: manual
        content: |-
          # Product Launch Playbook

          ## Overview
          This document covers the key steps...
        format: text/markdown
        status: indexed
        file_size: 4096
        chunk_count: 12
        created_at: '2025-01-15T10:30:00Z'
        updated_at: '2025-01-15T10:35:00Z'
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: Authorization
      in: header

````