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

# Delete a rule

> Delete a rule.



## OpenAPI

````yaml /api-reference/saas/cs-rules-rewrites.json delete /em-rules/{id}
openapi: 3.0.3
info:
  title: Rules & Rewrites API
  description: >-
    Manage Commerce Studio rules and query rewrites. Rules control search result
    behavior including boosting, burying, pinning, redirects, banners, and facet
    configuration. Query rewrites handle synonym expansion, misspelling
    correction, phrase matching, and query term manipulation.


    The endpoints require an authentication token with scope
    `commercestudio.rules` for rule operations and `commercestudio.rewrites` for
    query rewrite operations.
  version: 1.0.0
  contact:
    name: Lucidworks
    url: https://lucidworks.com/
    email: support@lucidworks.com
servers:
  - url: https://{commerce_studio_id}.experiencemanager.lucidworks.com
    description: Production.
    variables:
      commerce_studio_id:
        default: commerce_studio_id
        description: The ID of your Commerce Studio instance.
security:
  - authToken: []
tags:
  - name: Rule Management
    description: Create/Read/Update/Delete (CRUD) operations for Commerce Studio rules.
  - name: Query Rewrite Management
    description: >-
      Create/Read/Update/Delete (CRUD) operations for Commerce Studio query
      rewrites.
paths:
  /em-rules/{id}:
    delete:
      tags:
        - Rule Management
      summary: Delete a rule
      description: Delete a rule.
      operationId: deleteRule
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: >-
            The rule's Universally-Unique Identifier (UUID). You can also use
            the `externalId`, if the rule has one.
      responses:
        '204':
          description: No Content.
        '404':
          description: Rule not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message describing what went wrong.
        timestamp:
          type: string
          description: When the error occurred (ISO 8601 format).
          format: date-time
        status:
          type: integer
          description: HTTP status code.
        error:
          type: string
          description: HTTP status text (e.g., "Bad Request", "Not Found").
        path:
          type: string
          description: API endpoint path that generated the error.
      title: ErrorResponse
  securitySchemes:
    authToken:
      type: http
      scheme: bearer

````