Skip to main content

Update an employee

PUThttps://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-Agent and Content-Type: application/json headers. Limit: 1 request per second (learn more).

Request​

Path parameters

idstringrequired

Employee identifier.

Example: MTY0MTU6MjI5MTU=.

Headers

User-Agentstringrequired

Identification of your application.

Example: MinhaIntegracao/1.0.

Request body

JSON, sent with the Content-Type: application/json header.

namestringrequired

Employee name.

From 4 to 150 characters.

passwordstring

Password the employee uses to sign in to the app. If omitted, the stored password is erased (null).

Accepts: null.

notesstring

Employee notes.

Up to 2000 characters.

avatarUrlstring

URL of the employee's photo.

Accepts: null.

contractobject

Employee 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.

workScheduleobject

Work 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
startstring

Start of the work schedule.

Example: 08:00:00.

endstring

End of the work schedule.

Example: 17:00:00.

breakobject

Break.

Fields of break
startstring

Start of the break.

Example: 12:00:00.

endstring

End 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.