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

# Ingest Telemetry



## OpenAPI

````yaml /openapi-docs.yaml post /shell-docs/telemetry
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:
  /shell-docs/telemetry:
    post:
      tags:
        - Usage
      summary: Ingest Telemetry
      operationId: ingest_telemetry_v2_shell_docs_telemetry_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TelemetryPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TelemetryPayload:
      properties:
        session_id:
          type: string
          title: Session Id
        namespace:
          type: string
          title: Namespace
        domain:
          type: string
          title: Domain
        url:
          type: string
          title: Url
        mode:
          type: string
          title: Mode
        started_at:
          type: string
          title: Started At
        ended_at:
          type: string
          title: Ended At
        file_count:
          type: integer
          title: File Count
          default: 0
        events:
          items:
            $ref: '#/components/schemas/TelemetryEvent'
          type: array
          maxItems: 1000
          title: Events
      type: object
      required:
        - session_id
        - namespace
        - domain
        - url
        - mode
        - started_at
        - ended_at
      title: TelemetryPayload
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TelemetryEvent:
      properties:
        seq:
          type: integer
          title: Seq
        ts:
          type: string
          title: Ts
        type:
          type: string
          title: Type
          default: command
        raw:
          type: string
          title: Raw
        name:
          type: string
          title: Name
        args:
          items: {}
          type: array
          title: Args
          default: []
        cwd:
          type: string
          title: Cwd
          default: ''
        exit_code:
          type: integer
          title: Exit Code
          default: 0
        stdout_bytes:
          type: integer
          title: Stdout Bytes
          default: 0
        stderr_bytes:
          type: integer
          title: Stderr Bytes
          default: 0
        duration_ms:
          type: integer
          title: Duration Ms
          default: 0
        pattern:
          anyOf:
            - type: string
            - type: 'null'
          title: Pattern
        paths:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Paths
        flags:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Flags
        result_files:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Result Files
      type: object
      required:
        - seq
        - ts
        - raw
        - name
      title: TelemetryEvent
    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

````