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

# Delete a rule

> Delete a governance rule and its rule results.

Only rules you created can be deleted. Rules that ship with Openlayer report `immutable: true`
and cannot be deleted -- exclude one from compliance by setting `deactivated` with
`PUT /rules/{ruleId}` instead.




## OpenAPI

````yaml delete /rules/{ruleId}
openapi: 3.0.3
info:
  contact:
    email: support@openlayer.com
    name: Openlayer
    url: https://openlayer.com/
  description: API for interacting with the Openlayer server.
  title: Openlayer API
  version: '1.0'
  x-logo:
    url: https://logo.clearbit.com/openlayer.com
servers:
  - url: https://api.openlayer.com/v1
    description: Our prod backend
security:
  - bearerAuth: []
paths:
  /rules/{ruleId}:
    delete:
      tags:
        - Governance
      summary: Delete a rule
      description: >
        Delete a governance rule and its rule results.


        Only rules you created can be deleted. Rules that ship with Openlayer
        report `immutable: true`

        and cannot be deleted -- exclude one from compliance by setting
        `deactivated` with

        `PUT /rules/{ruleId}` instead.
      operationId: deleteRule
      parameters:
        - $ref: '#/components/parameters/ruleId'
      responses:
        '204':
          description: Rule deleted. No content.
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: curl
          source: |
            curl --request DELETE \
              --url https://api.openlayer.com/v1/rules/7c9a1e2b-3d4f-4a5b-8c6d-7e8f9a0b1c2d \
              --header 'Authorization: Bearer <token>'
components:
  parameters:
    ruleId:
      name: ruleId
      in: path
      description: The rule id.
      required: true
      schema:
        type: string
        format: uuid
  responses:
    UnexpectedError:
      description: Unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - error
            properties:
              code:
                type: integer
                format: int32
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your workspace API key. See [Find your API
        key](https://www.openlayer.com/docs/workspace-and-projects/find-your-api-key)
        for more information.

````