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

# Add Document Category

> Create a new category. Returns the category with count 0. The category is persisted to the database when first assigned to a document.



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json post /api/v3/documents/categories
openapi: 3.1.0
info:
  title: Nugen Intelligence API
  description: 'Nugen Intelligence : Powering Specialized Intelligence At Scale'
  version: 25.4.20
servers: []
security: []
paths:
  /api/v3/documents/categories:
    post:
      tags:
        - Documents
      summary: Add Document Category
      description: >-
        Create a new category. Returns the category with count 0. The category
        is persisted to the database when first assigned to a document.
      operationId: add_document_category
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddCategoryRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentCategory'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AddCategoryRequest:
      properties:
        name:
          type: string
          title: Name
          description: Name of the new category to create
          example: legal
      type: object
      required:
        - name
      title: AddCategoryRequest
    DocumentCategory:
      properties:
        name:
          type: string
          title: Name
          description: Name of the category
          example:
            - financial
            - customer_support
            - legal
            - 2024-q1
        count:
          type: integer
          minimum: 0
          title: Count
          description: Number of documents tagged with this category
          example:
            - 5
            - 12
            - 8
      type: object
      required:
        - name
        - count
      title: DocumentCategory
      examples:
        - count: 5
          name: financial
        - count: 12
          name: customer_support
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````