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

# Undo all of a rule's corrections

> Removes every correction the rule wrote, across all of its versions, and puts each value back to the one it replaced. The corrections are removed rather than reverted, so each value reads as original again, as it does after undoing a rule run. The call returns at once with the number of corrections the rule still holds, and the work runs in the background. When that number is 0, nothing runs.

A correction inside a reported batch, or one somebody has corrected since, is left in place.

To track the undo, list the rule's runs with [List a rule's runs](/api-reference/rule-runs/get-all). The undo appears there as a run with `trigger` set to `on_demand` and `state` set to `reversing`, which moves to `reversed` once it finishes. Its `reversal_summary` counts the corrections removed as `corrections_deleted` and the ones left in place as `refused`. Nothing else on the run marks it as an undo rather than a reversed evaluation.



## OpenAPI

````yaml POST /projects/{project_id}/rules/{rule_id}/revert_corrections
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /projects/{project_id}/rules/{rule_id}/revert_corrections:
    post:
      summary: Undo all of a rule's corrections
      description: >-
        Removes every correction the rule wrote, across all of its versions, and
        puts each value back to the one it replaced. The corrections are removed
        rather than reverted, so each value reads as original again, as it does
        after undoing a rule run. The call returns at once with the number of
        corrections the rule still holds, and the work runs in the background.
        When that number is 0, nothing runs.


        A correction inside a reported batch, or one somebody has corrected
        since, is left in place.


        To track the undo, list the rule's runs with [List a rule's
        runs](/api-reference/rule-runs/get-all). The undo appears there as a run
        with `trigger` set to `on_demand` and `state` set to `reversing`, which
        moves to `reversed` once it finishes. Its `reversal_summary` counts the
        corrections removed as `corrections_deleted` and the ones left in place
        as `refused`. Nothing else on the run marks it as an undo rather than a
        reversed evaluation.
      operationId: revert-project-rule-corrections
      parameters:
        - name: project_id
          in: path
          schema:
            type: string
          required: true
        - name: rule_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '202':
          description: '202'
          content:
            application/json:
              examples:
                Result:
                  value:
                    corrections_outstanding: 42
              schema:
                type: object
                properties:
                  corrections_outstanding:
                    type: integer
                    description: >-
                      Corrections the rule still held when the request was
                      accepted. This includes corrections inside a reported
                      batch, which the undo then leaves in place, so it is an
                      upper bound on how many will be removed.
        '422':
          description: '422'
          content:
            application/json:
              examples:
                Result:
                  value:
                    errors:
                      - message: >-
                          An evaluation is in progress for this rule. Undo is
                          available once it finishes.
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````