> ## Documentation Index
> Fetch the complete documentation index at: https://developers.lucca.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new Report

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



## OpenAPI

````yaml /openapi-specs/timmi-timesheet-v3.yaml post /timmi-timesheet/api/reports
openapi: 3.1.0
info:
  title: Lucca Timesheet API
  version: '1.0'
  description: |
    Welcome on the documentation for the Lucca Timesheet API.
  contact:
    name: API Support
    url: https://support.lucca.fr
    email: contact@luccasoftware.com
  license:
    name: Unlicensed
    url: https://www.luccasoftware.com
servers:
  - url: https://{host}
    description: Your Lucca account URL.
    variables:
      host:
        default: example.ilucca.net
        description: >-
          The URL of your dedicated Lucca account: `{account}.{env}.{region}`.


          Account reflects your company name. Env indicates the environment.
          Region depends on your server location.


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          Environments:

          - `ilucca`: production environment for customers.

          - `ilucca-test`: test environment for customers.

          - `ilucca-demo`: demo environment for prospects.


          Regions:

          - `.ch` for Swiss located accounts.

          - `.net` for the others.


          Regarding sandboxes, the pattern differs:
          `https://{account}-{sandboxName}.sandbox.{server}.luccasoftware.com`,
          where:

          - `{sandboxName}` is automatically generated upon creation.

          - `{server}` may be "eu1", "eu2" or "ch1".
security: []
tags:
  - name: TimeEntries
    description: time-entries are the actual working hours observed by a user.
  - name: Timesheets
    description: Collection of time-entries for a User over a week / month.
  - name: Activities
    description: Time-entries referencing axis-sections to describe what the user has done.
  - name: Attendance
    description: Time-entries indicating working hours.
  - name: Workflow
    description: All actions regarding the approval process of timesheets.
  - name: Reports
    description: Reporting features of Lucca Timesheet.
paths:
  /timmi-timesheet/api/reports:
    parameters:
      - $ref: '#/components/parameters/Authorization'
    post:
      tags:
        - Reports
      summary: Create a new Report
      description: >-
        <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.
      operationId: post-timmi-timesheet-api-reports
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Report'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Report'
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
components:
  parameters:
    Authorization:
      name: Authorization
      required: true
      description: 'API key. Value must be formatted like so: `lucca application={api_key}`.'
      in: header
      schema:
        type: string
  schemas:
    Report:
      title: The Report resource
      type: object
      description: >-
        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
      x-tags:
        - Reports
      properties:
        id:
          type: integer
          description: Unique identifier of the report generated
          readOnly: true
        templateId:
          type: string
          description: Reference to a ReportTemplate to generate a report from.
        status:
          type: string
          enum:
            - pending
            - done
            - error
          description: Status of a generated report.
          readOnly: true
        name:
          type: string
          description: Name given to the generated report.
          readOnly: true
        startsOn:
          type: string
          format: date
          description: >-
            Starting date of the generated report. Default dates of the
            report-template are applied if left null.
        endsOn:
          type: string
          format: date
          description: >-
            Ending date of the generated report. Default of the report-template
            are applied if left null.
        filters:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              kind:
                type: string
              values:
                type: array
                items:
                  type: number
        columns:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
              name:
                type: string
              category:
                type: string
              isRequired:
                type: boolean
              isDefault:
                type: boolean
              isPeriodic:
                type: boolean
                description: >-
                  Periodic columns will be duplicated as many times as there are
                  occurrences of periodicity in the report.
            readOnly: true
          readOnly: true
      required:
        - templateId

````