curl --request POST \
--url https://{host}/directory/api/4.0/work-contracts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"ownerId": 89,
"startsOn": "2022-01-19",
"establishmentId": 1,
"spcId": 0,
"typeId": 1,
"hiringTypeId": 1,
"trialPeriodDays": 120,
"renewedTrialPeriodDays": 240,
"externalId": "123",
"endsOn": "2022-02-10",
"terminationReasonId": 27
}
'{
"id": 514,
"ownerId": 416,
"startsOn": "2021-01-01",
"endsOn": null,
"isApplicable": true,
"establishmentId": 13,
"spcId": 1,
"typeId": 1,
"hiringTypeId": 3,
"terminationReasonId": null,
"trialPeriodDays": 120,
"renewedTrialPeriodDays": null,
"trialPeriodEndDate": "2021-05-01",
"trialPeriodEndDate2": null,
"authorId": 45,
"lastModifierId": 45,
"createdAt": "2021-11-08T17:48:18.12",
"lastModifiedAt": "2024-01-10T12:27:02.22"
}Create a new work-contract.
There are two possible scenarios:
POST /api/v3/users?contract=true: this will create the user and his contract. You may then need to PATCH the contract that was thus created in order to set additional data.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.curl --request POST \
--url https://{host}/directory/api/4.0/work-contracts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"ownerId": 89,
"startsOn": "2022-01-19",
"establishmentId": 1,
"spcId": 0,
"typeId": 1,
"hiringTypeId": 1,
"trialPeriodDays": 120,
"renewedTrialPeriodDays": 240,
"externalId": "123",
"endsOn": "2022-02-10",
"terminationReasonId": 27
}
'{
"id": 514,
"ownerId": 416,
"startsOn": "2021-01-01",
"endsOn": null,
"isApplicable": true,
"establishmentId": 13,
"spcId": 1,
"typeId": 1,
"hiringTypeId": 3,
"terminationReasonId": null,
"trialPeriodDays": 120,
"renewedTrialPeriodDays": null,
"trialPeriodEndDate": "2021-05-01",
"trialPeriodEndDate2": null,
"authorId": 45,
"lastModifierId": 45,
"createdAt": "2021-11-08T17:48:18.12",
"lastModifiedAt": "2024-01-10T12:27:02.22"
}API key. Value must be formatted like so: lucca application={api_key}.
Unique identifier of the employee this work-contract belongs to.
x >= 1Third-party identifier of this work-contract. May be not unique.
Identifier of the work-contract template this work-contract conforms to. Determines whether certain optional properties are required.
Start date of this work-contract. Format: YYYY-mm-DD.
Identifier of the establishment the employee works for.
Identifier of the socio-professional category.
Refer to the API endpoint: /organization/structure/api/occupation-categories.
Identifier of a hiring reason type.
Refer to the API endpoint: /directory/api/work-contract-hiring-types.
Number of days of the initial trial period.
x >= 0Number of days of renewed trial period (equal to the length of the initial period, plus the renewal period).
x >= 0Initial trial period end date. Format: YYYY-mm-DD.
Renewed trial period end date. Format: YYYY-mm-DD.
Identifier of the temporary contract ground.
Refer to the API endpoint: /directory/api/work-contract-temporary-contract-grounds.
Identifier of the employee/user that acts as internship supervisor.
End date of this work-contract. Leave null if not (yet) known. Format: YYYY-mm-DD.
Identifier of the termination reason.
Refer to the API endpoint: /directory/api/work-contract-termination-reasons.
OK
Unique identifier of this work-contract.
x >= 1Unique identifier of the employee this work-contract belongs to.
x >= 1Third-party identifier of this work-contract. May be not unique.
Identifier of the work-contract template this work-contract conforms to. Determines whether certain optional properties are required.
Start date of this work-contract. Format: YYYY-mm-DD.
Readonly. Whether this work-contract applies to the employee at this very moment.
A work-contract is considered "applicable" if:
Identifier of the establishment the employee works for.
Identifier of the socio-professional category.
Refer to the API endpoint: /organization/structure/api/occupation-categories.
Identifier of a hiring reason type.
Refer to the API endpoint: /directory/api/work-contract-hiring-types.
Number of days of the initial trial period.
x >= 0Number of days of renewed trial period (equal to the length of the initial period, plus the renewal period).
x >= 0Initial trial period end date. Format: YYYY-mm-DD.
Renewed trial period end date. Format: YYYY-mm-DD.
Identifier of the temporary contract ground.
Refer to the API endpoint: /directory/api/work-contract-temporary-contract-grounds.
Identifier of the employee/user that acts as internship supervisor.
End date of this work-contract. Leave null if not (yet) known. Format: YYYY-mm-DD.
Identifier of the termination reason.
Refer to the API endpoint: /directory/api/work-contract-termination-reasons.
Read-only. Identifier of the user who created this work-contract.
Read-only. Timestamp of the moment this work-contract was created.
Read-only. Identifier of the user who last modified this work-contract.
Read-only. Timestamp of the moment this work-contract was last updated.
Was this page helpful?