Retrieve a list of employees for a specified employer.
Query parameters
-
The maximum number of employees to return per page.
Minimum value is
100, maximum value is500. Default value is200. -
The page number to return in the list of employees.
Minimum value is
1. Default value is1.
Responses
-
A paginated list of employees for the specified employer.
-
Bad request, the request is malformed or contains invalid data.
-
Unauthorized, the request requires authentication, and the provided credentials are either missing or incorrect.
-
Employer not found, the specified employer_id does not match any existing employer.
GET
/employers/{employer_id}/employees
curl \
--request GET 'https://payroll-api.getpenfold.dev/v4/employers/{employer_id}/employees' \
--header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
"page_number": 1,
"page_size": 200,
"total_items": 1,
"items": [
{
"id": "e1234-abcd-5678-efgh",
"upload_id": "string",
"employer_id": "r9876-wxyz-4321-stuv",
"email": "john.doe@example.com",
"created_at": "2023-03-01T12:00:00Z",
"updated_at": "2023-03-15T12:00:00Z",
"forename": "John",
"surname": "Doe",
"title": "Mr.",
"date_of_birth": "1990-01-01",
"address_line1": "123 Main Street",
"postcode": "AB12 3CD",
"national_insurance_number": "AA123456C",
"employment_start_date": "2023-01-01",
"exit_date": "2023-12-31",
"opt_out_date": "2026-05-04",
"opt_in_date": "2026-05-04",
"opt_out_window_start_date": "2023-01-01",
"opt_out_window_end_date": "2023-01-31"
}
]
}
Response examples (400)
{
"error": "Bad request: invalid data provided."
}
Response examples (401)
{
"error": "Bad request: invalid data provided."
}
Response examples (404)
{
"error": "Bad request: invalid data provided."
}