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

# Delete a rule

> Delete a rule and its results.



## 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 rule and its results.
      operationId: deleteRule
      parameters:
        - $ref: '#/components/parameters/ruleId'
      responses:
        '204':
          description: Rule deleted. No content.
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: >
            from openlayer import Openlayer


            client = Openlayer()


            client.governance.rules.delete("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d")
        - lang: typescript
          source: >
            import Openlayer from 'openlayer';


            const client = new Openlayer();


            await
            client.governance.rules.delete('4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d');
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nerr := client.Governance.Rules.Delete(context.TODO(), \"4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d\")\nif err != nil {\n\tpanic(err.Error())\n}\n"
        - lang: java
          source: >
            import com.openlayer.api.client.OpenlayerClient;

            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;


            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();


            client.governance().rules().delete("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d");
        - lang: ruby
          source: >
            require "openlayer"


            openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])


            openlayer.governance.rules.delete("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d")
        - 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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.