# Generate Report

```
POST 
/v1/reports
```

Start the report of a month. An account admin's call.

Answers 202 at once with the report in `draft`; read it with `GET /v1/reports/{id}` until its `status` is `awaiting_approval`. Three steps run meanwhile (`step` says which):

* `photos`: model workers describe the images of the month's folder, one worker per photo, each shown only that photo's small preview. Every description is kept, so a reviewer can swap a photo for another.
* `figures`: each figure of the template is read from the datasets you name in `datasetIds` or, left out, the datasets of the folder, as you: your row access applies. The rows are stored in the report.
* `assembly`: the template's sections are filled with the best photos and the figure tables, and a commentary is written for each section in the report's language.

The draft then waits. Nothing is published until it is approved.

`template` names the report's template; left out, the one for your account. `folderId` is the folder holding the month's files; left out, the account's uploads folder of that month. `approverId` names a member (a Creator or an admin) who may review and approve it besides the admins.

Budget. `maxSpendUsd` (default 1.00, at most 25.00) caps everything the report spends on model calls, across drafts and rewritten sections. The report is estimated before anything starts: over the cap, or over what the account has left, it is refused 402 `report_over_budget` with `estimateUsd` and `availableUsd`, and nothing is created.

A month has one report per template: a second request is refused 409 `report_exists` with its `reportId`. Draft it again with `POST /v1/reports/{id}/regenerate`. A month whose folder holds no photo and no dataset you may read is refused 422 `nothing_to_report`: upload the month's files first. A folder holding more than 4000 photos of the month is refused 422 `too_many_photos`: name a `folderId` that holds the photos this report is about.

## Request[​](#request "Enlace directo al request")

## Responses[​](#responses "Enlace directo al Responses")

* 202
* 403
* 404
* 422

Successful Response

`error` is `feature_not_offered`: report generation is not included for this account.

Not found

Validation Error
