# Undo application form draft

`client_intake_application_editor.undo`

Reverse only the latest reversible edit in your Portal's unpublished draft. First call review_undo and copy its revisions and digest, then apply directly without requesting approval. This does not publish or notify participants, and does not restore deleted answers from earlier publication. Read get_config next. Retry only the identical call with the same client_request_id. This toolset requires a specific grant and is not assigned by default; request access through Support.

[Client intake application editor guide](https://docs.staging.levr.ai/mcp/resources/client_intake_application_editor.md)

Availability depends on live discovery and your access to the record. Do not infer MCP calls from REST paths.

Operation: write. Required OAuth scopes: mcp.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "business_id": {
      "description": "Exact Business id from businesses.list or businesses.get in the selected provider workspace; do not pass an application or runtime ID.",
      "maxLength": 32,
      "minLength": 1,
      "pattern": "^biz_[a-z0-9]+$",
      "type": "string"
    },
    "client_request_id": {
      "description": "Unique request key; reuse only when retrying this identical operation.",
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
    },
    "expected_draft_revision": {
      "description": "Copy draft_revision from the same current action review.",
      "pattern": "^[0-9a-f]{64}$",
      "type": "string"
    },
    "expected_live_revision": {
      "description": "Copy live_revision from the current action review.",
      "pattern": "^[0-9a-f]{64}$",
      "type": "string"
    },
    "provider_slug": {
      "description": "Provider workspace returned by providers.list.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "review_digest": {
      "description": "SHA-256 fingerprint of the exact document content.",
      "pattern": "^[0-9a-f]{64}$",
      "type": "string"
    },
    "user_confirmed": {
      "description": "Legacy compatibility field; draft recovery does not require confirmation.",
      "type": "boolean"
    }
  },
  "required": [
    "provider_slug",
    "business_id",
    "expected_live_revision",
    "expected_draft_revision",
    "review_digest",
    "client_request_id"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "oneOf": [
    {
      "not": {
        "required": [
          "error"
        ]
      },
      "properties": {
        "ok": {
          "const": true
        }
      },
      "required": [
        "data"
      ]
    },
    {
      "not": {
        "required": [
          "data"
        ]
      },
      "properties": {
        "ok": {
          "const": false
        }
      },
      "required": [
        "error"
      ]
    }
  ],
  "properties": {
    "data": {
      "additionalProperties": false,
      "properties": {
        "attachments": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "file_name": {
                "anyOf": [
                  {
                    "maxLength": 1000,
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "has_attachment": {
                "type": "boolean"
              },
              "source": {
                "description": "Whether this draft uses a published template, a staged override, or no attachment.",
                "enum": [
                  "live",
                  "draft",
                  "none"
                ],
                "type": "string"
              },
              "stable_block_id": {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              }
            },
            "required": [
              "stable_block_id",
              "has_attachment",
              "file_name",
              "source"
            ],
            "type": "object"
          },
          "maxItems": 1000,
          "type": "array"
        },
        "config": {
          "additionalProperties": false,
          "properties": {
            "application_runtime_structure": {
              "description": "Complete editable structure for the selected application runtime.",
              "type": "object"
            },
            "config_type": {
              "const": "application_runtime_structure",
              "description": "Document kind used to distinguish this config from other portable documents."
            },
            "config_version": {
              "const": 1,
              "description": "Version of the portable Runtime Editor config contract."
            }
          },
          "required": [
            "config_version",
            "config_type",
            "application_runtime_structure"
          ],
          "type": "object"
        },
        "config_source": {
          "enum": [
            "live",
            "draft"
          ],
          "type": "string"
        },
        "draft_revision": {
          "anyOf": [
            {
              "description": "Draft state token, or null before opening a draft.",
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Draft state token, or null before opening a draft."
        },
        "frontend_link": {
          "anyOf": [
            {
              "format": "uri",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "has_draft": {
          "description": "Whether your Portal has an editable draft.",
          "type": "boolean"
        },
        "live_revision": {
          "description": "Live form state token; preserve for the next reviewed change.",
          "pattern": "^[0-9a-f]{64}$",
          "type": "string"
        },
        "owner_kind": {
          "enum": [
            "client_intake",
            "deal",
            "matchmaking"
          ],
          "type": "string"
        },
        "owner_name": {
          "anyOf": [
            {
              "description": "Current application's owner display name.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Current application's owner display name."
        },
        "owner_slug": {
          "anyOf": [
            {
              "description": "Canonical owning workspace ID. Use it as deal_id, business_id or workspace_slug in this editor.",
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Canonical owning workspace ID. Use it as deal_id, business_id or workspace_slug in this editor."
        },
        "provider_slug": {
          "description": "Stable public identifier for the referenced resource.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "runtime_slug": {
          "description": "Stable public identifier for the referenced resource.",
          "maxLength": 255,
          "minLength": 1,
          "pattern": "^apprun_[a-z0-9]+$",
          "type": "string"
        }
      },
      "required": [
        "owner_kind",
        "owner_slug",
        "owner_name",
        "frontend_link",
        "runtime_slug",
        "provider_slug",
        "has_draft",
        "config",
        "config_source",
        "attachments",
        "live_revision",
        "draft_revision"
      ],
      "type": "object"
    },
    "error": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "details": {
          "additionalProperties": true,
          "description": "Optional bounded, agent-safe correction or recovery facts.",
          "type": "object"
        },
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        }
      },
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "type": "object"
    },
    "meta": {
      "additionalProperties": false,
      "properties": {
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "request_id"
      ],
      "type": "object"
    },
    "ok": {
      "description": "Whether the tool completed successfully.",
      "type": "boolean"
    }
  },
  "required": [
    "ok",
    "meta"
  ],
  "type": "object"
}
```

Check the result, then read the affected record to confirm your change.
