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

# Delete a category

> Delete a product category by id, detaching it from any assigned products. Requires the WRITE_CATEGORIES scope.

Deletes a category within the store; any products assigned to it are detached and the response reports how many were detached. The store is bound to your app token server-side — never send a shop id.


## OpenAPI

````yaml DELETE /categories/{id}
openapi: 3.1.0
info:
  title: Salesive Apps API — Customers & Categories
  version: 1.0.0
  description: >-
    Read and manage the store's customers and product categories from an
    installed third-party app. Every endpoint authenticates with an
    installed-app access token (prefix `app_`) and requires a specific OAuth
    scope. The target store is bound to the token server-side from the
    installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /categories/{id}:
    delete:
      tags:
        - Categories
      summary: Delete a category
      description: >-
        Deletes a category by id within the store. Any products assigned to the
        category are detached (their category field is unset); the response
        reports how many products were detached. Returns 404 if the category is
        not in this store. The store is bound to the app token server-side from
        the installation — never send a shop id. Requires the `WRITE_CATEGORIES`
        scope.
      operationId: deleteCategory
      parameters:
        - $ref: '#/components/parameters/CategoryId'
      responses:
        '200':
          description: The category was deleted; reports how many products were detached.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          detachedProducts:
                            type: integer
                            description: Number of products whose category field was unset.
              example:
                status: 200
                success: true
                message: Category deleted successfully
                data:
                  detachedProducts: 24
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/CategoryNotFound'
components:
  parameters:
    CategoryId:
      name: id
      in: path
      required: true
      description: The category id.
      schema:
        type: string
  schemas:
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
    CategoryNotFound:
      description: The category does not exist or is not in the installation's store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 404
            success: false
            message: Category not found
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````