---
title: "Import entitlements"
method: POST
path: "/timmi-absences/api/public/services/v1.0/leaveEntitlementsImport"
tags: ["Imports"]
---

# Import entitlements

`POST /timmi-absences/api/public/services/v1.0/leaveEntitlementsImport`

**Import entitlements** credits leave accounts by **adding** the values provided in the import file to the employees' existing balances. Each value in the file is treated as a new credit entry, increasing the current entitlement total. This operation generates new accounting entries of type "entitlements import". It corresponds to the **"Entitlements import"** feature in the Lucca Absences UI. See the [Entitlements imports guide](/api-reference/legacy/timmi-absences/guides/entitlements-imports) to understand the differences with *Replace entitlements*.

**Supported file formats:**
- CSV
  - "UTF-8" encoding
  - separator “;”
- XSLX

**Columns to fill in:**

| Column name                                     | Description                                              |
| :---------------------------------------------- | :------------------------------------------------------- |
| `LegalEntityCode`                               | Employee legal entity code.                              |
| `EmployeeNumber`                                | Employee payroll number.                                 |
| `LastName`                                      | Last name.                                               |
| `FirstName`                                     | First name.                                              |
| Account number or name (one column per account) | Value to import for the account defined in the header.   |

*Remark:
A template file can be downloaded from the import page (Credit / Debit> A group of collaborators> File import).*

In the event of a malformed (or unrecognized) file, no data will be imported; the problems detected will be specified in the `globalErrors` field.

If successful, the number of imported lines is indicated by the “successLinesCount” field; the lines in error are detailed in the `lineErrors` field.


*Remarks:
Any import made by the API is of course available in the import history.
A simulation returns the same level of information, but does not trigger an import*

**List of errors handled**

Here is the list of fatal errors, which can be returned in the `globalErrors`:
- Unauthorized
- FileEmpty,
- FileExtensionNotSupported,
- ColumnsFormatNotSupported,
- AccountColumnMissing,
- ColumnNamesDistinct,
- LineErrorForbiddenInStrictMode,

The list of line processing errors, which can be restored in the `lineErrors`:
- AccountNotFound,
- AccountsNotFound,
- AccountColumnsProcessing,
- LegalEntityCodesNotFound,
- MissingValuesForAccount,
- AccountNotAvailableForUser,
- LegalEntityCodeRequired,
- EmployeeNumberRequired,
- LoginRequired,
- LoginNotFound,
- AccountNumberRequired,
- LegalEntityNotFound,
- EmployeeNumberNotExist,
- EmployeeNumberNotInLegalEntity,
- FistNameAndLastNameNotMatching,
- FistNameNotMatching,
- LastLameNotMatching,
- FistNameAndLastNameNotMatchingEmployeeNumber,
- FistNameNotMatchingEmployeeNumber,
- LastLameNotMatchingEmployeeNumber,
- FistNameAndLastNameNotMatchingLogin,
- FistNameNotMatchingLogin,
- LastLameNotMatchingLogin,
- DuplicatedLine,
- AmbiguousLegalEntity,
- ColumnNotExists,
- LegalEntityNameNotAvailable,
- AccountNameNotUnique

The list of import generation errors:
- UnableToCreditAccount

## Query parameters

- `strict` boolean
- `simulate` boolean

## Response `200`

Example response

- object
  - `successLinesCount` integer
  - `globalErrors` object
  - `lineErrors` object

## Other responses

- `400` — Problem

---

[API](https://skmtc.net/luccasoftware/apis/lucca-expenses.md) · [All operations](https://skmtc.net/luccasoftware/apis/lucca-expenses/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/luccasoftware/lucca-expenses/revisions/110f9897756c/schema)
