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

# Replace entitlements

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

## Request

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

**Replace entitlements** adjusts leave accounts so that the entitlement total for selected entry types **matches exactly** the values provided in the import file. The system computes the difference between the target value and the current entitlement total (based on the `EntryTypes` parameter), then creates a positive or negative adjustment entry. It corresponds to the **"Import cumulative entitlements"** feature in the Lucca Absences UI. See the [Entitlements imports guide](/api-reference/legacy/timmi-absences/guides/entitlements-imports) to understand the differences with *Import 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

## Request body `multipart/form-data`

- object
  - `File` string, binary
  - `Description` string: Description of the entries generated by the import (visible to users in the account details).
  - `ReferenceDate` string, date-time: Reference date (text mode). Respect the format: yyyy-MM-ddThh: mm: ss
  - `EntryTypes` string: Types of entries to take into account, separated by commas, from the following list: AutoAccruals, ManualAccruals, Regularisations, EntitlementsImport, Seniority, Fractionnement, TimeSavings, Comp By default: `AutoAccruals, ManualAccruals, Regularizations` which correspond to the main cases of acquisition (automatic acquisition, manual adjustments, regularisations).

## Response `200`

Example response

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

## Other responses

- `400`: Problem

---

[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)
