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

# Update category

> Update an existing category.



## OpenAPI

````yaml /openapi-docs.yaml patch /categories/{category_id}
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:
  /categories/{category_id}:
    patch:
      tags:
        - Categories
      summary: Update category
      description: Update an existing category.
      operationId: update_category_v2_categories__category_id__patch
      parameters:
        - name: category_id
          in: path
          required: true
          schema:
            type: string
            title: Category Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/routes__v2__categories__CategoryUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    routes__v2__categories__CategoryUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 50
              minLength: 1
            - type: 'null'
          title: Name
          description: Category name
        color:
          anyOf:
            - type: string
              maxLength: 7
            - type: 'null'
          title: Color
          description: 'Hex color (e.g., #FF5733)'
        order:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Order
          description: Display order
      type: object
      title: CategoryUpdate
    CategoryResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        user_id:
          type: string
          title: User Id
        organization_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Organization Id
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        order:
          type: integer
          title: Order
          default: 0
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
      type: object
      required:
        - id
        - name
        - user_id
        - created_at
        - updated_at
      title: CategoryResponse
    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

````