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

# Create classification



## OpenAPI

````yaml /openapi/openapi.yaml post /v3/classifications
openapi: 3.0.3
info:
  title: Qanapi
  version: 3.0.0
  description: Secure API with enforced API Key headers. Supports V2 and V3 endpoints.
servers:
  - url: https://{subdomain}.qanapi.cloud/api
    description: The Qanapi API server
    variables:
      subdomain:
        default: ''
        description: Customer-specific subdomain.
security:
  - ApiKeyAuth: []
paths:
  /v3/classifications:
    post:
      summary: Create classification
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClassificationRequest'
      responses:
        '201':
          description: Classification created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Classification'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    ClassificationRequest:
      type: object
      required:
        - name
        - bg_color
        - fg_color
      properties:
        name:
          type: string
          maxLength: 32
        description:
          type: string
          maxLength: 255
          nullable: true
        bg_color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
        fg_color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
        emoji:
          type: string
          nullable: true
        provider_container_id:
          type: integer
          description: Required if gws_groups is provided.
        gws_groups:
          type: array
          items:
            $ref: '#/components/schemas/GoogleGroup'
        users:
          type: array
          items:
            type: integer
          description: Array of user IDs.
        roles:
          type: array
          items:
            type: integer
          description: Array of role IDs.
    Classification:
      type: object
      required:
        - id
        - name
        - slug
        - bg_color
        - fg_color
      properties:
        id:
          type: integer
        name:
          type: string
          maxLength: 32
        slug:
          type: string
        description:
          type: string
          maxLength: 255
          nullable: true
        bg_color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
        fg_color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
        emoji:
          type: string
          nullable: true
        providers:
          type: array
          items:
            type: object
            properties:
              uuid:
                type: string
                format: uuid
              name:
                type: string
              gws_groups:
                type: array
                items:
                  $ref: '#/components/schemas/GoogleGroup'
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
        roles:
          type: array
          items:
            $ref: '#/components/schemas/Role'
    GoogleGroup:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
    User:
      type: object
      required:
        - id
        - name
        - email
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
          format: email
        two_factor_enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        roles:
          type: array
          items:
            $ref: '#/components/schemas/Role'
    Role:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        description:
          type: string
          nullable: true
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: An error occurred.
    ValidationError:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
          example: Validation failed.
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          example:
            field_name:
              - The field_name field is required.
    Permission:
      type: object
      required:
        - name
      properties:
        name:
          type: string
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Unauthorized.
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: User does not have the right permissions.
    UnprocessableEntity:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-qanapi-authorization

````