# Remove Autofill supporting document

`client_intake_applications.delete_autofill_file`

Remove one supporting document from Autofill preparation, preserving application answers and accepted submission originals. Read preparation first and confirm the exact document with the user. Pass its current revision and file id. Reuse the same idempotency_key only for an identical retry. This does not start Autofill or submit the application.

[Intake applications guide](https://docs.levr.ai/mcp/resources/client_intake_applications.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.

## Client portal input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "application_id": {
      "description": "Application ID from client_workspace.get in this workspace; not the Business ID.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "expected_preparation_revision": {
      "minimum": 1,
      "type": "integer"
    },
    "file_id": {
      "description": "Copy files[].id from this application's current Autofill preparation.",
      "maxLength": 70,
      "pattern": "^afdoc_[0-9a-f]{64}$",
      "type": "string"
    },
    "idempotency_key": {
      "format": "uuid",
      "type": "string"
    },
    "organization_slug": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "provider_slug": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "user_confirmed": {
      "const": true,
      "type": "boolean"
    }
  },
  "required": [
    "provider_slug",
    "application_id",
    "file_id",
    "expected_preparation_revision",
    "idempotency_key",
    "organization_slug",
    "user_confirmed"
  ],
  "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": {
        "file_count": {
          "minimum": 0,
          "type": "integer"
        },
        "files": {
          "description": "Supporting documents in preparation order, with their current processing status.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "id": {
                "description": "Opaque supporting-document handle for removal or extraction retry.",
                "pattern": "^afdoc_[0-9a-f]{64}$",
                "type": "string"
              },
              "name": {
                "description": "Document name shown in the Portal.",
                "example": "financial-statement.pdf",
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "description": "Document processing: pending is queued; running is reading the file; success is ready for Autofill; failed needs attention.",
                "enum": [
                  "pending",
                  "running",
                  "success",
                  "failed"
                ],
                "type": "string"
              }
            },
            "required": [
              "name",
              "status"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "resource": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "description": "Stable public identifier for the referenced resource.",
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            },
            "object": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "object"
          ],
          "type": "object"
        },
        "revision": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "resource",
        "revision",
        "file_count",
        "files"
      ],
      "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.
