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

# Start an export

> Starts the same export as a custom date range in Settings > Export and answers `202 Accepted`. A period without absences still produces a file. Request the URL in the `Location` header until it stops answering `202`; it then returns the file. Send the key as `X-API-KEY` or as `Authorization: Bearer <key>`. In a Power Automate HTTP action set Authentication to Raw with `Bearer <key>`, because it applies to the polling requests too. A key in the query string is not part of the `Location` URL. Requires an admin and an eligible plan. At most 5 API exports can run per workspace; more answer 429.



## OpenAPI

````yaml https://api.absentify.com/api/v1/openapi.json post /exports
openapi: 3.1.0
info:
  title: absentify CRUD API
  description: OpenAPI compliant REST API
  version: 1.0.0
servers:
  - url: https://api.absentify.com/api/v1
security: []
tags:
  - name: Departments
  - name: Leave types
  - name: Members
  - name: Requests
  - name: Public holidays
  - name: Workspace
  - name: Absences
  - name: Allowance Management
  - name: Out of office
  - name: Exports
externalDocs:
  url: https://absentify.com/docs/en/api-reference
paths:
  /exports:
    post:
      tags:
        - Exports
      summary: Start an export
      description: >-
        Starts the same export as a custom date range in Settings > Export and
        answers `202 Accepted`. A period without absences still produces a file.
        Request the URL in the `Location` header until it stops answering `202`;
        it then returns the file. Send the key as `X-API-KEY` or as
        `Authorization: Bearer <key>`. In a Power Automate HTTP action set
        Authentication to Raw with `Bearer <key>`, because it applies to the
        polling requests too. A key in the query string is not part of the
        `Location` URL. Requires an admin and an eligible plan. At most 5 API
        exports can run per workspace; more answer 429.
      operationId: exports-create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                format:
                  type: string
                  enum:
                    - EXCEL
                    - PAYROLL_EXCEL
                    - PAYROLL_CSV
                    - LEAVE_BALANCE_EXCEL
                  description: >-
                    `EXCEL` is the absence workbook. `PAYROLL_EXCEL` and
                    `PAYROLL_CSV` are the payroll files. `LEAVE_BALANCE_EXCEL`
                    is the leave balances workbook.
                start:
                  description: >-
                    Date/time in ISO 8601 format, e.g. `2026-06-01` (interpreted
                    as UTC midnight) or `2026-06-01T09:00:00Z`. Always include a
                    time zone designator (`Z` for UTC) when sending a time of
                    day. Localized formats such as `01.06.2026` or `06/01/2026`
                    are misinterpreted and must not be used. First day of the
                    export. Only the UTC date is used. The range may span at
                    most 1826 days (5 years).
                  type: string
                end:
                  description: >-
                    Date/time in ISO 8601 format, e.g. `2026-06-01` (interpreted
                    as UTC midnight) or `2026-06-01T09:00:00Z`. Always include a
                    time zone designator (`Z` for UTC) when sending a time of
                    day. Localized formats such as `01.06.2026` or `06/01/2026`
                    are misinterpreted and must not be used. Last day of the
                    export, inclusive. Only the UTC date is used.
                  type: string
                department_id:
                  description: >-
                    Limit the export to one department. Omit for all
                    departments.
                  type: string
                  minLength: 1
                csv_separator:
                  description: Only used by `PAYROLL_CSV`.
                  type: string
                  enum:
                    - comma
                    - semicolon
              required:
                - format
                - start
                - end
      responses:
        '202':
          description: Export started. Poll the `Location` URL for the file.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                    const: processing
                required:
                  - id
                  - status
                additionalProperties: false
          headers:
            Location:
              description: Absolute URL to poll for the file.
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before polling again.
              schema:
                type: integer
                example: 15
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '429':
          description: >-
            Too many requests, or 5 API exports of the workspace are already
            running.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - message
                  - code
          headers:
            Retry-After:
              description: Seconds to wait before starting another export.
              schema:
                type: integer
                example: 60
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKey: []
        - BearerAuth: []
components:
  schemas:
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Authorization not provided
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
    error.FORBIDDEN:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Insufficient access
        code:
          type: string
          description: The error code
          example: FORBIDDEN
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
  securitySchemes:
    ApiKey:
      type: apiKey
      name: X-API-KEY
      in: header
    BearerAuth:
      type: http
      scheme: bearer
      description: 'The API key as `Authorization: Bearer <key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.