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

# Delete Macro

> Delete a SQL macro.

Requires superadmin privileges.
Fails if macro is used in any active permission rules.



## OpenAPI

````yaml delete /api/v1/macros/{macro_id}
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/macros/{macro_id}:
    delete:
      tags:
        - macros
      summary: Delete Macro
      description: |-
        Delete a SQL macro.

        Requires superadmin privileges.
        Fails if macro is used in any active permission rules.
      operationId: delete_macro_api_v1_macros__macro_id__delete
      parameters:
        - name: macro_id
          in: path
          required: true
          schema:
            type: integer
            title: Macro Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````