PATCH /employers/{employerId}/employees/{employeeId}

Update an employee's information. This can be used to mark them as a leaver. Note that once marked as a leaver the employee record will no longer be accessible under the employer.

Path parameters

  • employerId string(uuid) Required

    Penfold employer UUID

  • employeeId string Required

    Unique identifier for the employee

application/json

Body Required

  • exitDate string(date)

    Date the employee's employment ended, in YYYY-MM-DD format.

Responses

  • 204

    Successfully updated the employee's information.

  • 400 application/json

    Request body failed validation

    Hide response attributes Show response attributes object
    • error string Required

      A descriptive error message.

    • validationErrors array[object]
      Hide validationErrors attributes Show validationErrors attributes object
      • field string Required

        The name of the field that failed validation.

      • message string Required

        A descriptive error message.

  • 401 application/json

    Missing or invalid authentication token

    Hide response attribute Show response attribute object
    • error string Required
  • 404 application/json

    Resource not found

    Hide response attribute Show response attribute object
    • error string Required
  • 500 application/json

    Internal server error

    Hide response attribute Show response attribute object
    • error string Required
PATCH /employers/{employerId}/employees/{employeeId}
curl \
 --request PATCH 'https://partner-api.getpenfold.com/v1/employers/{employerId}/employees/{employeeId}' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"exitDate":"2023-12-31"}'
Request example
{
  "exitDate": "2023-12-31"
}
Response examples (400)
{
  "error": "validation failed",
  "validationErrors": [
    {
      "field": "companyNumber",
      "message": "companyNumber is required"
    },
    {
      "field": "primaryContactEmail",
      "message": "must be a valid email address"
    }
  ]
}
Response examples (401)
{
  "error": "unauthorized"
}
Response examples (404)
{
  "error": "not found"
}
Response examples (500)
{
  "error": "internal server error"
}