---
title: "Clear Databook Manual Edits"
method: POST
path: "/api/businesses/{business_id}/workbook/databook/clear-manual-edits"
tags: ["Data Cleaning"]
---

# Clear Databook Manual Edits

`POST /api/businesses/{business_id}/workbook/databook/clear-manual-edits`

## Request

- Base URL: `https://api.flagpost.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.flagpost.ai/api/businesses/{business_id}/workbook/databook/clear-manual-edits`
- Auth: HTTP bearer

Revert manual cell edits and remove user-added rows.

## Path parameters

- `business_id` string, required

## Response `200`

Successful Response

- DatabookModel: Full databook payload returned to the UI.
  - `id` string, uuid, required
  - `business_id` string, uuid, required
  - `advisory_id` string, uuid, required
  - `status` 'empty' | 'processing' | 'ready' | 'failed': Lifecycle status of a business databook.
  - `fiscal_year_end` integer, nullable
  - `fiscal_year_label_offset` integer
  - `currency` string
  - `granularity` 'monthly' | 'quarterly' | 'yearly': Time period granularity of financial data.
  - `period_start` string, nullable
  - `period_end` string, nullable
  - `company_names` string[]
  - `inputs` DataCleaningInputs: User-facing inputs that drive a data cleaning run.
    - `company_names` string[]: Company/entity display names the user expects in the workbook
    - `entities` EntityInput[]: Entities for multi-entity extraction (best-effort prefill)
      - `name` string, required: Canonical entity display name
      - `aliases` string[]: Alternate names that should map to this entity
      - `fiscal_year_end` integer, nullable: Entity fiscal year end month (1=Jan .. 12=Dec). Null means inherit the databook reporting year end.
      - `fiscal_year_label_offset` integer, nullable: Entity fiscal year label offset. Null inherits the databook offset.
    - `fiscal_year_end` integer, nullable: Fiscal year end month (1=Jan .. 12=Dec)
    - `fiscal_year_label_offset` integer: Years the fiscal year's name runs ahead of the calendar year its months fall in. 0 = same. +1 when a year end in the first days of January makes Jan-Dec 2024 into fiscal 2025.
    - `start_year` integer, nullable: Start year for periods
    - `start_month` integer, nullable: Start month (1-12)
    - `end_year` integer, nullable: End year for periods
    - `end_month` integer, nullable: End month (1-12)
    - `document_ids` string[]: Per-run allowlist of financial document IDs. Empty means every financial document that is not in ``excluded_document_ids``.
    - `excluded_document_ids` string[]: Durable databook-level exclusions: files that are not part of this databook. Distinct from the per-run allowlist.
    - `ignore_periods_outside_window` boolean: Drop period values (including prior-year comparatives on external financials) that fall outside the selected window before fold/clamp.
    - `persist_mode` 'merge' | 'rebuild': How AI line items are persisted. ``merge`` is the production default (cumulative). ``rebuild`` wipes ``ai_generated`` rows and re-inserts — kept for tests and explicit escape-hatch runs.
    - `refresh_document_ids` string[]: Document IDs whose previously written AI cells may be overwritten on this run (per-document refresh).
  - `source_job_id` string, uuid, nullable
  - `error_message` string, nullable
  - `columns` DatabookColumnModel[]
    - `id` string, uuid, nullable
    - `period_key` string, required
    - `label` string, required
    - `start_date` string, nullable
    - `end_date` string, nullable
    - `sort_order` integer
    - `year` string, nullable
    - `depth` integer
    - `derived` boolean
    - `closing_period` string, nullable
    - `rolling` string, nullable
  - `sheets` DatabookSheetModel[]
    - `id` string, uuid, nullable
    - `kind` 'pnl' | 'balance_sheet' | 'clean_pl' | 'clean_bs' | 'mapping', required: Sheet kinds stored in the internal databook.
    - `name` string, required
    - `sort_order` integer
    - `rows` DatabookRowModel[]
      - `id` string, uuid, nullable
      - `sheet_id` string, uuid, nullable
      - `entity_id` string, uuid, nullable
      - `label` string, required
      - `category` string, nullable
      - `section` string, nullable
      - `account_id` string, uuid, nullable
      - `account_name` string, nullable
      - `mapped_account_id` string, uuid, nullable
      - `mapped_account_name` string, nullable
      - `mapping` string, nullable
      - `contributors` string[]
      - `row_type` 'line_item' | 'subtotal' | 'total' | 'header': Row classification inside a databook sheet.
      - `sort_order` integer
      - `depth` integer
      - `source_label` string, nullable
      - `built` object
      - `delta` object
      - `values` object
      - `superseded_periods` string[]
      - `values_meta` object
      - `source` object
      - `source_document_ids` string[]
      - `is_manual_edit` boolean
  - `entities` DatabookEntityModel[]
    - `id` string, uuid, required
    - `name` string, required
    - `sort_order` integer
    - `aliases` string[]
    - `fiscal_year_end` integer, nullable
    - `fiscal_year_label_offset` integer, nullable
    - `effective_fiscal_year_end` integer
    - `effective_label_offset` integer
  - `has_mixed_fiscal_calendars` boolean
  - `entity_scope` string, nullable
  - `calendar_warnings` string[]
  - `has_manual_edits` boolean
  - `last_merge_stats` object
  - `adjustments_error` string, nullable
  - `applied_adjustment_count` integer
  - `draft_adjustment_count` integer
  - `aje_extraction` object
  - `reported_net_income` object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/flagpost/apis/flagpost-api.md) - [All operations](https://skmtc.dev/flagpost/apis/flagpost-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flagpost/apis/flagpost-api/revisions/0308cef485ca?raw)
