Using employees' work-contracts
Work-contract object
Property | Description | Comment | Configuration API |
---|---|---|---|
id | Work-contract identifier | read-only | N/A |
ownerId | Identifier of the employee | Mandatory (upon creation). Then, read-only. | /api/v3/users |
externalId | Writable identifier of this work-contract. | May not be unique | N/A |
typeId | Identifier of the work-contract template. | Mandatory (for creation). Determines available properties on the contract. | /directory/api/work-contract-archetypes |
startsOn | Start date | Mandatory (for creation). Format: yyyy-mm-dd . | N/A |
isApplicable | Applicable work contract is the contract that applies at the moment. In the following order: (1) Ongoing contract, (2) Upcoming contract or (3) Last contract. | read-only | N/A |
establishmentId | Identifier of the establishment. | Required. | /organization/structure/api/establishments |
spcId | Socio-professional category. | Optional | /organization/structure/api/occupation-categories |
hiringTypeId | Identifier of a hiring type. | Optional | /directory/api/work-contract-hiring-types |
trialPeriodDays | Number of days of the initial trial period. | integer | N/A |
renewedTrialPeriodDays | Number of days of the trial period with renewal | integer | N/A |
trialPeriodEndDate | Initial trial period end date. | Format: yyyy-mm-dd . Read only. | N/A |
trialPeriodEndDate2 | Renewed trial period end date. | Format: yyyy-mm-dd . Read only. | N/A |
temporaryContractGroundId | Identifier of the temporary contract ground. | /directory/api/work-contract-temporary-contract-grounds | |
internshipSupervisorId | Identifier of the employee that acts as internship supervisor. | Optional | /api/v3/users |
endsOn | End date. | Format: yyyy-mm-dd . | N/A |
terminationReasonId | Identifier of the termination reason. | /directory/api/work-contract-termination-reasons | |
authorId | Identifier of the user that created this work-contract. | Read-only | /api/v3/users |
lastModifierId | Identifier of the user that last updated this work-contract. | Read-only | /api/v3/users |
createdAt | Timestamp of the moment this work-contract was created. | Read-only | N/A |
lastModifiedAt | Timestamp of the moment this work-contract was lasts updated. | Read-only | N/A |
General information
The property available for a contract is defined according to its model (type). These templates are set here: https://instance.ilucca.net/directory/settings/work-contracts/types
It is therefore impossible to define a value for a property that is not present on the corresponding contract template.
Similarly, for all drop-down type properties, each entry in the list can be enabled or disabled depending on the template.
Validations are also carried out to ensure that there is no overlap between two contracts for the same employee. Temporal consistency is also checked for the end of the trial period 1, 2 as well as for the start and end dates of the contract.
Work contract APIs
Retrieve all work contracts
Query parameters available:
- Limit (integer) : define maximum number of work contracts that are retrieve from the API (40 by default)
- ownerId (integer) : to retrieve all work contracts for a specific employee
- isApplicable (boolean) : allows you to retrieve only the applicable contracts or all the others (a past or future contract can be an applicable contract if there is no current contract)
- isArchived (boolean)
- typeId (integer) : allows you to filter on contracts of a given type
- establishmentId (integer) : allows you to filter contracts according to the establishment to which they are attached
Retrieve one work contract
Create a work contract
Two possible scenarios :
- Existing user: in this case, it will be necessary to put a contract end date on the current contract before creating a new contract.
- New user: when you create a new user, you have two options:
- recommended POST /api/v3/users?contract=true: this will create the user and his contract. It will therefore be necessary to PATCH the contract created automatically to add the additional data to it.
- POST /api/v3/users?contract=false: this will create the user without a contract. It will therefore be essential to create your contract via a POST on the contracts API.
Example of body for the creation of a new contract. Only ownerId, startsOn, typeId and establishmentId data are required.
Define an end date for a contract
Two solutions (the termination reason is optional):
Modify a work contract
Example of body (the work-contract ID can also be passed in the body and not in the URL).
Delete a work contract
Impossible if it is the employee’s last contract.
Configuration APIs
The following APIs allow you to retrieve the dictionnary of available values for these different contract attributes.
Work contract types
Hiring types
Work contract temporary contract grounds
Termination reasons
Was this page helpful?