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

# Get Source Content



## OpenAPI

````yaml /openapi-docs.yaml get /sources/{source_id}/content
openapi: 3.1.0
info:
  title: Nia AI API
  version: 1.1.0
  description: >-
    Nia AI API provides a single, consistent `sources` resource for all indexed
    content.


    ## Core Resources


    **Sources** (`/sources`)

    - `repository`

    - `documentation`

    - `research_paper`

    - `huggingface_dataset`

    - `local_folder`


    **Search** (`/search`)

    - `mode`: query | web | deep | universal


    Legacy endpoints are deprecated and will be removed in a future version.
    Prefer `/sources` and `/search` for new integrations.
servers:
  - url: https://apigcp.trynia.ai/v2
    description: Production API
  - url: http://localhost:8000/v2
    description: Local development
security:
  - ApiKeyAuth: []
tags:
  - name: Auth
    description: API-first signup, login, and API key bootstrapping
  - name: Sources
    description: >-
      Unified source management (repositories, documentation, papers, datasets,
      local folders)
  - name: Search
    description: Unified search endpoint with mode discriminator
  - name: Context Sharing
    description: Cross-agent context management and retrieval
  - name: Categories
    description: Category management for organizing indexed sources
  - name: GitHub Search
    description: Live GitHub search and repository exploration
  - name: Advisor
    description: Context-aware code advisor against indexed documentation
  - name: Dependencies
    description: Dependency analysis and documentation subscription
  - name: Usage
    description: Usage tracking and bulk operations
paths:
  /sources/{source_id}/content:
    get:
      tags:
        - Sources
      summary: Get Source Content
      operationId: get_source_content_v2_sources__source_id__content_get
      parameters:
        - name: source_id
          in: path
          required: true
          schema:
            type: string
            title: Source Id
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - repository
                  - documentation
                  - research_paper
                  - huggingface_dataset
                  - local_folder
                  - slack
                  - google_drive
                  - connector
                type: string
              - type: 'null'
            description: Source type hint
            title: Type
          description: Source type hint
        - name: path
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Path or virtual path
            title: Path
          description: Path or virtual path
        - name: url
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Direct URL (documentation)
            title: Url
          description: Direct URL (documentation)
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Repository branch
            title: Branch
          description: Repository branch
        - name: page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: PDF page number
            title: Page
          description: PDF page number
        - name: tree_node_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: PDF tree node identifier
            title: Tree Node Id
          description: PDF tree node identifier
        - name: line_start
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Starting line number
            title: Line Start
          description: Starting line number
        - name: line_end
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Ending line number
            title: Line End
          description: Ending line number
        - name: max_length
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Maximum content length
            title: Max Length
          description: Maximum content length
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceContentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SourceContentResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether retrieval succeeded
        content:
          type: string
          title: Content
          description: Source content
          default: ''
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Content metadata
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message if failed
      type: object
      required:
        - success
      title: SourceContentResponse
      description: Response for source content retrieval.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key must be provided in the Authorization header

````