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

# Get the file of an export

> Request the `Location` URL returned by `POST /exports` with the same credentials. It answers `202` while the export runs and `200` with the file when it is done. `422` means the export failed (see `error`), `500` is an internal error, `410` means the file has expired and `404` that the export is unknown or older than 30 days. A period without absences still returns a file.



## OpenAPI

````yaml https://api.absentify.com/api/v1/openapi.json get /exports/{id}/file
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/{id}/file:
    get:
      tags:
        - Exports
      summary: Get the file of an export
      description: >-
        Request the `Location` URL returned by `POST /exports` with the same
        credentials. It answers `202` while the export runs and `200` with the
        file when it is done. `422` means the export failed (see `error`), `500`
        is an internal error, `410` means the file has expired and `404` that
        the export is unknown or older than 30 days. A period without absences
        still returns a file.
      operationId: exports-getFile
      parameters:
        - name: id
          in: path
          required: true
          description: The export id returned by `POST /exports`.
          schema:
            type: string
      responses:
        '200':
          description: The export file.
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: binary
            text/csv; charset=utf-8:
              schema:
                type: string
                format: binary
        '202':
          description: The export is still running.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                    const: processing
                required:
                  - id
                  - status
          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
        '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'
        '404':
          description: >-
            Export not found, not exportable through the API, or older than 30
            days.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '410':
          description: The file has expired.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                    const: expired
                required:
                  - id
                  - status
        '422':
          description: The export failed. See `error` for the code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                    const: failed
                  error:
                    type: string
                    description: A failure code such as `stale_timeout` or `export_failed`.
                required:
                  - id
                  - status
                  - error
        '429':
          description: Scheduled maintenance in progress
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  code:
                    type: string
                required:
                  - message
                  - code
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKey: []
        - BearerAuth: []
components:
  schemas:
    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.NOT_FOUND:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Not found
        code:
          type: string
          description: The error code
          example: NOT_FOUND
        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: Not found error (404)
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        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.