---
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`

**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

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