Preview who a new payroll run would pay
/payroll/payrolls/employees_infopayroll_run/viewRequires feature payroll_runAvailable in Claudepayroll_runs.roster_previewFor a period and a pay cycle, returns the employees a new run would pay (records: name, basic salary, currency, location, department), and separately the ones it may not (excluded) because an overlapping run of the same pay cycle, or a termination package paying their final salary, already covers them.
When to use: before payroll_runs.create, to check the roster and pick employee_ids or excluded_employee_ids. Send payroll_id when re-picking the roster of an existing run, so its own employees still show.
Prerequisites: location_id and department_id (optional filters) from employees.meta_data.
Side effects: none. Up to 50 candidates per page; excluded is never paginated.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
periodRequired | query | string | A month YYYY-MM, or a range YYYY-MM-DD,YYYY-MM-DD. | 2026-11 |
pay_cycleRequired | query | string | Pay cycle of the run. Allowed values: monthly, weekly, daily | monthly |
location_id | query | integer | Only employees of this work location. | 2 |
department_id | query | integer | Only employees of this department. | 4 |
payroll_id | query | integer | The run whose roster is being re-picked, from payroll_runs.list. | 77 |
page | query | integer | Page number, starting at 1. min 1 | 1 |
per_page | query | integer | Records per page. Each list states its maximum. min 1 | 20 |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The candidates, and who is already covered.
| Field | Type | Description |
|---|---|---|
recordsRequired | array<object> | Employees the run may pay. |
records[].id | integer | Employee id. |
records[].employee_no | string | Employee number. |
records[].name | string | Full name. |
records[].location_id | integer | Work location id. |
records[].department_id | integer | Department id. |
records[].basic_salary_amount | string | Active basic salary, decimal string. |
records[].currency | string | Pay currency. |
records[].included | boolean | Always true: candidates start included. |
paginationRequired | object | |
pagination.current_pageRequired | integer | This page's number. |
pagination.per_pageRequired | integer | Records per page. |
pagination.total_entriesRequired | integer | Records across all pages. |
pagination.pagesRequired | integer | Number of pages. |
excludedRequired | array<object> | Employees already covered, and by what. |
excluded[].employee_id | integer | Employee id. |
excluded[].employee_no | string | Employee number. |
excluded[].name | string | Full name. |
excluded[].reason | string | payroll_run or termination_package. |
excluded[].payroll_id | integer | The overlapping run. |
excluded[].payroll_reference | string | Its reference. |
excluded[].termination_package_reference | string | The termination package's reference. |
excluded[].message | string | Explanation for a termination package. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 401 | token_missing | No Authorization: Bearer … header, or it is malformed. | Send Authorization: Bearer qhr_… with the full token. |
| 401 | token_invalid | The token is unknown or wrong, or its owner's account is locked. | Check the token was copied in full, or create a new one in QHR › Settings › API & Integrations. |
| 401 | token_expired | The token is past its expiry date. | Create a new token. |
| 401 | token_revoked | The token was revoked by its owner or an admin, or the owner was removed from the company (which revokes all their tokens). | Create a new token, or ask your admin. If the owner was removed, they must be re-invited to the company first. |
| 401 | tenant_inactive | The company account is suspended. | Contact QHR support. |
| 403 | forbidden | The token owner's role lacks the permission this operation needs. | Ask an admin to grant the permission shown on this operation (x-permission). |
| 403 | employee_inactive | The token owner's employee record is not active. | HR must reactivate the employee record. |
| 403 | tenant_access_revoked | The token's owner is no longer an active member of this company. Rare: removing a member normally revokes their tokens, which answers 401 token_revoked instead. | The owner must be re-invited to the company, then create a new token. If the owner is still a member, contact QHR support. |
| 422 | validation_failed | period is missing or not a month or date range, or pay_cycle is not monthly, weekly or daily. | Send period=2026-11 (or 2026-11-01,2026-11-30) and a valid pay_cycle. |
entitlement_blocked · 429 rate_limited · 500 internal_error