---
title: "Create a new Report"
method: POST
path: "/timmi-timesheet/api/reports"
tags: ["Reports"]
---

# Create a new Report

`POST /timmi-timesheet/api/reports`

<Info>
  This endpoint does not adhere to the "v3 API endpoints" principles. 
  The "fields" query parameter is not supported, but all fields are 
  systematically returned.
</Info>

Starts the creation of a a report, based on based on an existing report-template. So you first need to retrieve the report-template unique identifier `templateId`.

Please see [this guide](../docs/Use-cases/Timmi%20Timesheet/Downloading-a-report.md) on how to download reports.

## Request body

- Report — A report is generated from an existing report-template, referenced by its unique identifier `templateId`. ## Status The generation of a report content is a background process. As long as this process is not complete, the report status stays `pending`. Once the report is complete, its status is set to `done`. May an error be encountered while generating its content, then its status is set to `error`. The report content can only be viewed and downloaded once it is `done`. ## Start & end dates Start `startsOn` and end `endsOn` dates can be left `null`. In this case, default dates from the report-template are applied. ## Filters Filters are usually set in the report-template. But these can be overriden for a given report. ## Fields
  - `id` integer — Unique identifier of the report generated
  - `templateId` string, required — Reference to a ReportTemplate to generate a report from.
  - `status` 'pending' | 'done' | 'error' — Status of a generated report.
  - `name` string — Name given to the generated report.
  - `startsOn` string, date — Starting date of the generated report. Default dates of the report-template are applied if left null.
  - `endsOn` string, date — Ending date of the generated report. Default of the report-template are applied if left null.
  - `filters` object[], nullable
    - `kind` string
    - `values` number[]
  - `columns` object[]
    - `kind` string
    - `name` string
    - `category` string
    - `isRequired` boolean
    - `isDefault` boolean
    - `isPeriodic` boolean — Periodic columns will be duplicated as many times as there are occurrences of periodicity in the report.

## Response `201`

Created

- Report — A report is generated from an existing report-template, referenced by its unique identifier `templateId`. ## Status The generation of a report content is a background process. As long as this process is not complete, the report status stays `pending`. Once the report is complete, its status is set to `done`. May an error be encountered while generating its content, then its status is set to `error`. The report content can only be viewed and downloaded once it is `done`. ## Start & end dates Start `startsOn` and end `endsOn` dates can be left `null`. In this case, default dates from the report-template are applied. ## Filters Filters are usually set in the report-template. But these can be overriden for a given report. ## Fields
  - `id` integer — Unique identifier of the report generated
  - `templateId` string, required — Reference to a ReportTemplate to generate a report from.
  - `status` 'pending' | 'done' | 'error' — Status of a generated report.
  - `name` string — Name given to the generated report.
  - `startsOn` string, date — Starting date of the generated report. Default dates of the report-template are applied if left null.
  - `endsOn` string, date — Ending date of the generated report. Default of the report-template are applied if left null.
  - `filters` object[], nullable
    - `kind` string
    - `values` number[]
  - `columns` object[]
    - `kind` string
    - `name` string
    - `category` string
    - `isRequired` boolean
    - `isDefault` boolean
    - `isPeriodic` boolean — Periodic columns will be duplicated as many times as there are occurrences of periodicity in the report.

## Other responses

- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.net/luccasoftware/apis/lucca-expenses.md) · [All operations](https://skmtc.net/luccasoftware/apis/lucca-expenses/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/luccasoftware/lucca-expenses/revisions/110f9897756c/schema)
