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

# List contexts

> List conversation contexts with pagination. Filter by tags, agent source, or memory type.



## OpenAPI

````yaml /openapi-docs.yaml get /contexts
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:
  /contexts:
    get:
      tags:
        - Context Sharing
      summary: List contexts
      description: >-
        List conversation contexts with pagination. Filter by tags, agent
        source, or memory type.
      operationId: list_contexts_v2_v2_contexts_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Number of contexts to return
            default: 20
            title: Limit
          description: Number of contexts to return
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of contexts to skip
            default: 0
            title: Offset
          description: Number of contexts to skip
        - name: tags
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Comma-separated tags to filter by
            title: Tags
          description: Comma-separated tags to filter by
        - name: agent_source
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by agent source
            title: Agent Source
          description: Filter by agent source
        - name: memory_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Filter by memory type: scratchpad, episodic, fact, procedural'
            title: Memory Type
          description: 'Filter by memory type: scratchpad, episodic, fact, procedural'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextListCompatResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ContextListCompatResponse:
      properties:
        items:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Items
          description: List of contexts
        pagination:
          $ref: '#/components/schemas/PaginationInfo'
          description: Pagination metadata
        contexts:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Contexts
          description: Legacy contexts list
        total:
          type: integer
          title: Total
          description: Legacy total count
      type: object
      required:
        - pagination
        - total
      title: ContextListCompatResponse
      description: Backwards-compatible context list response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PaginationInfo:
      properties:
        total:
          type: integer
          title: Total
          description: Total number of items
        limit:
          type: integer
          title: Limit
          description: Items per page
        offset:
          type: integer
          title: Offset
          description: Current offset
        has_more:
          type: boolean
          title: Has More
          description: Whether more items exist
      type: object
      required:
        - total
        - limit
        - offset
        - has_more
      title: PaginationInfo
      description: Pagination metadata.
    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

````