Update an employee
https://carchost.fieldcontrol.com.br/employees/{id}Updates an employee. The email cannot be changed: if sent, it is ignored.
Always send contract, workSchedule and password. If they are omitted, the API stores the default values: the contract starts on the current date, with no termination date (a terminated employee becomes active again), the work schedule goes back to 08:00:00 to 17:00:00 and the password is erased.
Requires the
X-Api-Key,User-AgentandContent-Type: application/jsonheaders. Limit: 1 request per second (learn more).
Request
Path parameters
idstringrequiredEmployee identifier.
Example: MTY0MTU6MjI5MTU=.
Headers
User-AgentstringrequiredIdentification of your application.
Example: MinhaIntegracao/1.0.
Request body
JSON, sent with the Content-Type: application/json header.
namestringrequiredEmployee name.
From 4 to 150 characters.
passwordstringPassword the employee uses to sign in to the app. If omitted, the stored password is erased (null).
Accepts: null.
notesstringEmployee notes.
Up to 2000 characters.
avatarUrlstringURL of the employee's photo.
Accepts: null.
contractobjectEmployee contract. If omitted, the API stores hiredAt with the current date and firedAt as null, including on update.
Fields of contract
hiredAtstring (date)Hire date (AAAA-MM-DD).
firedAtstring (date)Termination date (AAAA-MM-DD). From this date on, the employee is inactive.
Accepts: null.
workScheduleobjectWork schedule, in HH:MM:SS. If omitted, the API stores 08:00:00 to 17:00:00 with a break from 12:00:00 to 13:00:00, including on update.
Fields of workSchedule
startstringStart of the work schedule.
Example: 08:00:00.
endstringEnd of the work schedule.
Example: 17:00:00.
breakobjectBreak.
Fields of break
startstringStart of the break.
Example: 12:00:00.
endstringEnd of the break.
Example: 13:00:00.
Responses
- 200
Employee updated.
- 401
API key missing (
Missing API Key) or invalid (Invalid API Key). See Authentication. - 403
Account blocked (
Account blocked), expired (Account expired) or on a plan that does not allow integration (Account plan not allowed). See Authentication. - 404
Resource not found. The response body is empty.
- 422
Invalid body (resourceValidationErr). An invalid identifier, or one from another account, in the URL also returns this error, with
property: '@.id'. - 429
Limit of 1 request per second exceeded. See Rate limit.
- 500
Unexpected server error.