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

# Delete Brand

> Delete a Brand and all its child Brand Kits.

Postgres cascades the delete to brand_kits (FK is ON DELETE CASCADE as of
m2brand_req_001). However, tasks.brand_kit_id has no ondelete rule, so we
must NULL those refs first to avoid FK violations when Postgres attempts
the cascade. We still delete kits through the ORM so BrandKit.files
cascade fires (removing R2 metadata rows).



## OpenAPI

````yaml /openapi.json delete /api/v1/brands/{brand_id}
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/brands/{brand_id}:
    delete:
      tags:
        - Brands
        - Brands
      summary: Delete Brand
      description: >-
        Delete a Brand and all its child Brand Kits.


        Postgres cascades the delete to brand_kits (FK is ON DELETE CASCADE as
        of

        m2brand_req_001). However, tasks.brand_kit_id has no ondelete rule, so
        we

        must NULL those refs first to avoid FK violations when Postgres attempts

        the cascade. We still delete kits through the ORM so BrandKit.files

        cascade fires (removing R2 metadata rows).
      operationId: delete_brand_api_v1_brands__brand_id__delete
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Brand Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````