v1

latestOpenAPI 3.0.02026-07-14800227.2 KB
Employees

Update the work section for a given employee id.

This endpoint updates the employee work section for a given employee id. The operation only updates the fields provided in the body. <br><br>Custom fields information can be provided in this operation. The API name of the custom field is required and the data format has to match with the type defined for the custom field in Kenjo. API names start with 'c_' and the rest is composed by the trimmed name (spaces are removed). <br><br> Example: <br> The custom field 'activity type' belongs to the 'personal' section:

{
  ...,
  "companyId": "61d874aef37c05cfba4f1b38",
  "c_activityType": "1",
  ...
}

'activity Type' is a field type 'List' (Strings list) with the possible values: "1" and "2". It means that if a different value or type is provided then the request will return an error.

put/employees/{employeeId}/works

Path parameters

employeeIdstring required
Example:60a2db290da29e126a18789a

The _id of the employee to update.

Headers

Authorizationstring required
Example:Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5rZW5qby5pbyIsInN1YiI6IjYwZjBhOTE2MjE0OTg3MjU2YmU5YzhmZiIsImF1ZCI6Imh0dHBzOi8vYXBpLmtlbmpvLmlvIiwiaWF0IjoxNjI2Mzg1MTE1LCJuYmYiOjE2MjYzODUxMTUsImV4cCI6MTYyNjU1NzkxNSwiYWNjZXNzVHlwZSI6IkFwaUFjY2VzcyIsInNfb3JnSWQiOiI2MGYwNGVhN2RmN2JhMjFlY2U0YmYzYzIifQ.cxG_7dIS-VbmDXdJuLkekoyuyCIzQG2fMcgc0nkfbWE8cihhcb5FnALbQkjU9b5-qVcEoMHZlSuUA-jMEBMMVQ

A valid bearer token.

Request body

companyIdstring

The company id of the Kenjo employee.

officeIdstring

The office id of the Kenjo employee.

departmentIdstring

The department id of the Kenjo employee.

startDatestring

The starting date of the Kenjo employee in format YYYY-MM-DDThh:mm:ss.

jobTitlestring

The job title of the employee.

workPhonestring

The work phone of the employee.

workMobilestring

The work mobile of the employee.

isAssistantboolean

Allow to indicate if the employee has or not the assistant role.

probationPeriodEndstring

The probation period of the employee. Format YYYY-MM-DDThh:mm:ss.000Z.

contractEndstring

The contract end date of the employee. Format YYYY-MM-DDThh:mm:ss.000Z.

reportsToIdstring

The Kenjo employee id of the user to whom the employee reports. The employee id to assign can be an active or inactive user. Trying to assign the own employee id or the id of someone who is already reporting will arise an error.

Example request

{
  "companyId": "50a2db290da29e126a187894",
  "officeId": "50a2db290da29e126a187895",
  "departmentId": "50a2db290da29e126a187896",
  "startDate": "2021-07-01T00:00:00.000Z",
  "jobTitle": "Actor",
  "workPhone": "+34 666 70 90 32",
  "workMobile": "+34 680 70 90 32",
  "probationPeriodEnd": "2022-06-01T00:00:00.000Z",
  "contractEnd": "2030-06-01T00:00:00.000Z",
  "reportsToId": "50a2db290da29e126a1878523"
}

Response

OK

_idstring

The employee Kenjo _id.

companyIdstring

The company id of the Kenjo employee.

officeIdstring

The office id of the Kenjo employee.

departmentIdstring

The department id of the Kenjo employee.

startDatestring

The starting date of the Kenjo employee in format YYYY-MM-DDThh:mm:ss.

jobTitlestring

The job title of the employee.

workPhonestring

The work phone of the employee.

workMobilestring

The work mobile of the employee.

isAssistantboolean

Allow to indicate if the employee has or not the assistant role.

probationPeriodEndstring

The probation period of the employee. Format YYYY-MM-DDThh:mm:ss.000Z.

contractEndstring

The contract end date of the employee. Format YYYY-MM-DDThh:mm:ss.000Z.

reportsToIdstring

The Kenjo employee id of the user to whom the employee reports. The employee id to assign can be an active or inactive user. Trying to assign the own employee id or the id of someone who is already reporting will arise an error.

Example response

{
  "_id": "60a2db290da29e126a18789a",
  "companyId": "50a2db290da29e126a187894",
  "officeId": "50a2db290da29e126a187895",
  "departmentId": "50a2db290da29e126a187896",
  "startDate": "2021-07-01T00:00:00.000Z",
  "jobTitle": "Actor",
  "workPhone": "+34 666 70 90 32",
  "workMobile": "+34 680 70 90 32",
  "probationPeriodEnd": "2022-06-01T00:00:00.000Z",
  "contractEnd": "2030-06-01T00:00:00.000Z",
  "reportsToId": "50a2db290da29e126a1878523"
}