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

# Generate Report

> Builds a standard or custom CSV report over people, time-off, expense, invoice or compensation rows with filters.

Not available to API keys yet. It will need `reports:write`.

## OpenAPI

````yaml api-reference/openapi.json POST /hris/generate-report
openapi: 3.1.0
info:
  title: Toku API
  version: 1.0.0
servers:
  - url: https://api.toku.com
security:
  - bearerAuth: []
paths:
  /hris/generate-report:
    post:
      operationId: generateReport
      summary: Generate Report
      description: >-
        Builds a standard or custom CSV report over people, time-off, expense,
        invoice or compensation rows with filters.


        Not available to API keys yet. It will need `reports:write`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateReportRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateReportResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Conflict
        '429':
          description: Response 429
components:
  schemas:
    GenerateReportRequest:
      type: object
      properties:
        reportId:
          type: string
        columns:
          type: array
          items:
            type: string
        customReportBase:
          type: string
          enum:
            - people
            - time_off
            - expense
            - invoice
            - compensation
        filters:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                minLength: 1
                maxLength: 120
              operator:
                type: string
                enum:
                  - equals
                  - not_equals
                  - contains
                  - not_contains
                  - in
                  - not_in
                  - gt
                  - gte
                  - lt
                  - lte
                  - is_empty
                  - is_not_empty
              values:
                type: array
                items:
                  type: string
                  maxLength: 500
                maxItems: 500
            required:
              - field
              - operator
          maxItems: 25
          description: >-
            NOTE(ck): default `[]` is not expressible here, so this field is
            optional; TGA applies the default
        exportName:
          type: string
          maxLength: 120
        asOfDate:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
      required:
        - reportId
    GenerateReportResponse:
      type: object
      properties:
        csv:
          type: string
        filename:
          type: string
        rowCount:
          type: integer
          minimum: 0
        truncated:
          type: boolean
        totalRowCount:
          type: integer
          minimum: 0
      required:
        - csv
        - filename
        - rowCount
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
````
