Update an employee's information. All fields are optional — only provided fields
are updated; at least one field must be supplied. Once marked as a leaver
(exit_date), the employee record will no longer be accessible under the employer.
Body
Required
Employee update data.
-
Email address of the employee.
-
The employee's first name.
-
The employee's last name.
-
The employee's title, e.g. Mr., Mrs., Dr., etc.
-
The employee's date of birth, in YYYY-MM-DD format.
-
The first line of the employee's address.
-
The postal code of the employee's address.
-
The employee's National Insurance number.
-
The date the employee started their employment, in YYYY-MM-DD format.
-
The date the employee's employment ended, in YYYY-MM-DD format. Provide only when marking the employee as a leaver. Emits an
Employmentwebhook with actionEndedandinitiated_byPartner.
Responses
-
Successfully updated the employee's information
-
Bad request, the request is malformed or contains invalid data.
-
Unauthorized, the request requires authentication, and the provided credentials are either missing or incorrect.
-
Employee or employer not found, the specified employee_id or employer_id does not match any existing records.
curl \
--request PATCH 'https://payroll-api.getpenfold.dev/v4/employers/{employer_id}/employees/{employee_id}' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"exit_date":"2023-03-22"}'
{
"exit_date": "2023-03-22"
}
{
"error": "Bad request: invalid data provided.",
"validation_errors": [
{
"field": "email",
"message": "Email address is invalid."
}
]
}
{
"error": "Bad request: invalid data provided."
}
{
"error": "Bad request: invalid data provided."
}