---
title: "Import leaves"
method: POST
path: "/timmi-absences/api/imports/v1.0/leavePeriods"
tags: ["Imports"]
---

# Import leaves

`POST /timmi-absences/api/imports/v1.0/leavePeriods`

## Request

- Base URL: `https://example.ilucca.net`
- URL: `https://example.ilucca.net/timmi-absences/api/imports/v1.0/leavePeriods`
- Auth: none required
- TypeScript: <https://skmtc.dev/luccasoftware/apis/lucca-expenses/docs/timmi-absences/api/imports/v1.0/leavePeriods/post.ts> (a function with typed inputs; its response is checked against the schema)

Create absences in batch from a CSV file.

**Important notice: Absence imports cannot be cancelled.** 

In case of a mistake absences must be deleted manually through the interface or using the API (see Use cases). **Use import with care!**

**File format**

Content-Type: CSV. Column divider is semicolon ";". Line breaks between rows.

Encoding: UTF-8

All the following fields must be present with the field name in the header:

- legalEntity: Name of the establishment the employee belongs to.
- employeeNumber: Employee number.
- lastName: Family (last) name of the employee.
- firstName: Given (first) name of the employee.
- accountId: Identifier of the absence account in Lucca Absences (can be found in the leave accounts admin page).
- startDate: Start date of the absence, formatted as `DD/MM/YYYY`.
- flagStartDate: `"AM"` if the absence starts in the morning or `"PM"` if the absence starts in the afternoon.
- endDate: End date of the absence, formatted as `DD/MM/YYYY`.
- flagEndDate: `"AM"` if the absence ends at noon or `"PM"` if the absence ends in the afternoon.
- isApproved: `true` or `false`. Dictates whether the absence request should be created and already approved. 
  Required if the type of the absence requires approval, optional otherwise.

**History**
Import history is available in the import module. It includes imports made via the API.

## Query parameters

- `create` boolean
- `recredit` boolean
- `originalFileName` string
- `synchronize` boolean
- `async` boolean
- `overrideLeaves` boolean

## Headers

- `Content-Type` string, required

## Request body `multipart/form-data`

- object
  - `files` string[]

---

[API](https://skmtc.dev/luccasoftware/apis/lucca-expenses.md) - [All operations](https://skmtc.dev/luccasoftware/apis/lucca-expenses/llms.txt) - [OpenAPI document](https://skmtc.dev/luccasoftware/apis/lucca-expenses/revisions/110f9897756c?raw)
