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

# Delete category

> Soft-deletes the category and cascades `isDeleted` onto its sub-categories.



## OpenAPI

````yaml /api-reference/ai-cms/openapi.json delete /categories/delete/{id}
openapi: 3.1.0
info:
  title: Blog API
  version: 1.0.0
servers:
  - url: https://api.octaviatech.app/cms
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Tags
    description: Tag management endpoints
paths:
  /categories/delete/{id}:
    delete:
      tags:
        - Categories
      summary: Delete category
      description: >-
        Soft-deletes the category and cascades `isDeleted` onto its
        sub-categories.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
            example: '{{objectId}}'
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              examples:
                Deleted:
                  value:
                    success: true
                    statusCode: 200
                    message: Category and related subcategories deleted successfully!
                    data:
                      category:
                        _id: '{{objectId}}'
                        isDeleted: true
                      subCategoriesAffected: 2
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    success: false
                    statusCode: 401
                    message: Unauthorized
                    data: null
        '403':
          description: Forbidden
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    success: false
                    statusCode: 403
                    message: Forbidden
                    data: null
        '404':
          description: Not found
          content:
            application/json:
              examples:
                NotFound:
                  value:
                    success: false
                    statusCode: 404
                    message: Category not found or already deleted
                    data: null
        '500':
          description: >-
            Server error (a non-ObjectId `id` is reported as 406 internally and
            coerced to 500)
          content:
            application/json:
              examples:
                ServerError:
                  value:
                    success: false
                    statusCode: 500
                    message: Internal server error
                    data: null
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````