> ## 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.

# Update a rule result

> Update a rule result.



## OpenAPI

````yaml patch /rule-results/{ruleResultId}
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:
  /rule-results/{ruleResultId}:
    patch:
      tags:
        - Governance
      summary: Update a rule result
      description: Update a rule result.
      operationId: updateRuleResult
      parameters:
        - $ref: '#/components/parameters/ruleResultId'
      requestBody:
        description: Only the fields you send are changed.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                deactivated: 7d771e0d-0605-45f2-a448-d2de734955ef
                deactivatedReason: af213ac5-bed6-41c4-9d75-13a82eccd252
                assigneeId: 9091bba1-8dc7-4650-af17-db4ce11b7db0
                blockedBy: c66af096-d82f-4e85-8bb6-12355ab3fa34
                blocking: 946a1cce-243e-4f47-a33a-52f3f2c9a40a
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleResult'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rule_result = client.governance.rule_results.update(
                "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
                deactivated=True,
                deactivated_reason="This project does not process personal data.",
            )
            print(rule_result.deactivated)
        - lang: typescript
          source: >
            import Openlayer from 'openlayer';


            const client = new Openlayer();


            const ruleResult = await
            client.governance.ruleResults.update('6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c',
            {
              deactivated: true,
              deactivatedReason: 'Not applicable to internal tools.',
            });


            console.log(ruleResult.status);
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nresult, err := client.Governance.RuleResults.Update(\n\tcontext.TODO(),\n\t\"6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c\",\n\topenlayer.GovernanceRuleResultUpdateParams{\n\t\tAssigneeID: openlayer.F(\"d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", result.AssigneeID)\n"
        - lang: java
          source: >
            import com.openlayer.api.client.OpenlayerClient;

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

            import
            com.openlayer.api.models.governance.ruleresults.RuleResultUpdateParams;

            import
            com.openlayer.api.models.governance.ruleresults.RuleResultUpdateResponse;


            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();


            RuleResultUpdateParams params = RuleResultUpdateParams.builder()
                .ruleResultId("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c")
                .assigneeId("d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a")
                .build();
            RuleResultUpdateResponse ruleResult =
            client.governance().ruleResults().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rule_result = openlayer.governance.rule_results.update(
              "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
              deactivated: true,
              deactivated_reason: "Not applicable to this project."
            )

            puts(rule_result)
        - lang: curl
          source: |
            curl --request PATCH \
              --url https://api.openlayer.com/v1/rule-results/2c4e6a8b-1d3f-4b5c-9e7a-0f1b2c3d4e5f \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "deactivated": true,
                "deactivatedReason": "Not applicable to this project."
              }'
components:
  parameters:
    ruleResultId:
      name: ruleResultId
      in: path
      description: The rule result id.
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    RuleResult:
      type: object
      description: >
        The compliance status of one rule for one entity: a project for
        project-scoped rules, or the workspace for workspace-scoped rules.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The rule result id.
          example: 5b7d9f1a-2c3e-4d5f-8a6b-9c0d1e2f3a4b
        workspaceId:
          type: string
          format: uuid
          readOnly: true
          description: The id of the workspace the rule result belongs to.
        ruleId:
          type: string
          format: uuid
          readOnly: true
          description: The rule this result belongs to.
        projectId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: >-
            The project this result was evaluated for. `null` for
            workspace-scoped rules.
        status:
          type: string
          enum:
            - running
            - passing
            - failing
            - skipped
            - error
            - pending
            - due_soon
          description: >
            The compliance status of the rule for this entity. Computed by
            Openlayer and can't be set directly.
          example: passing
        statusMessage:
          type: string
          nullable: true
          description: A human-readable explanation of the status.
        dateLastEvaluated:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: When the rule was last evaluated. Platform rules only.
        dateOfNextEvaluation:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: When the rule will next be evaluated. Platform rules only.
        dateOfLatestEvidence:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: >-
            When the most recent piece of evidence was attached. Evidence rules
            only.
        dateOfRenewal:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: >-
            When the evidence must be renewed. Evidence rules with a renewal
            cadence only.
        deactivated:
          type: boolean
          default: false
          description: >
            Whether this result is excluded from compliance calculations.
            Excludes just this result, without deactivating the rule everywhere.
        deactivatedReason:
          type: string
          nullable: true
          description: >-
            Why the result was excluded. Required when setting `deactivated` to
            `true`.
        assigneeId:
          type: string
          format: uuid
          nullable: true
          description: The user responsible for this result.
        blockedBy:
          type: array
          default: []
          description: Rule results that must pass before this one can be satisfied.
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              status: c8d6dae9-615f-4f41-9ec2-c7ddf3c322a0
        blocking:
          type: array
          default: []
          description: Rule results that this one blocks.
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              status: c8d6dae9-615f-4f41-9ec2-c7ddf3c322a0
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2026-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last update date.
          example: '2026-03-22T11:31:01.185Z'
      required:
        - id
        - workspaceId
        - ruleId
        - status
        - deactivated
        - dateCreated
        - dateUpdated
  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.