---
title: "Save Databook Entities"
method: PUT
path: "/api/businesses/{business_id}/workbook/databook/entities"
tags: ["Data Cleaning"]
---

# Save Databook Entities

`PUT /api/businesses/{business_id}/workbook/databook/entities`

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

Set the business's entities, and return them with their ids.

Entities belong to the business, not to a databook or a run: they are named
once and reused across runs. So this neither needs nor creates a databook —
naming an entity on a business that has never been run has to work, since
that is exactly when the first run needs a roster to attribute against.

Saving here rather than as a side effect of running is what gives entities
ids up front.

## Path parameters

- `business_id` string, required

## Request body

- 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.

## Response `200`

Successful Response

- 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

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