---
title: "Refresh Document Run"
method: POST
path: "/api/businesses/{business_id}/workbook/databook/refresh-document"
tags: ["Data Cleaning"]
---

# Refresh Document Run

`POST /api/businesses/{business_id}/workbook/databook/refresh-document`

## 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/refresh-document`
- Auth: HTTP bearer

Re-run databook with selected documents marked writable (per-document refresh).

## Path parameters

- `business_id` string, required

## Request body

- StartCleaningRequest: JSON body for starting a data cleaning run.
  - `company_names` string[]
  - `entities` EntityInput[]
    - `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_label_offset` integer
  - `start_year` integer, nullable
  - `start_month` integer, nullable
  - `end_year` integer, nullable
  - `end_month` integer, nullable
  - `document_ids` string[]
  - `excluded_document_ids` string[]
  - `ignore_periods_outside_window` boolean
  - `persist_mode` 'merge' | 'rebuild'
  - `refresh_document_ids` string[]

## Response `200`

Successful Response

- StartCleaningResponse
  - `success` boolean, required
  - `message` string, required
  - `status` string
  - `job_id` string, required
  - `data_cleaning_job_id` string, required

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