Export termination packages to Excel or CSV
/termination_packages/exportexports/payroll_dataRequires feature time_offNot available in Claudetermination_packages.export- It also needs: Manage employee offboarding
time_off/manage_offboarding
Builds a file of the end-of-service packages, one row per package, with the columns you choose (reference, employee, status, reason, last working day, currency, compensation, offsets, net payout, payment status…) and a totals row per currency. It takes the same filters as termination_packages.list, so the file matches what the list shows.
When to use: to hand end-of-service figures to finance or archive them. To read figures, termination_packages.list is lighter.
Prerequisites: column keys from termination_packages.export_columns. You need "Export payroll data" as well as "Manage offboarding" (x-permission.x-also).
Side effects: the export is recorded (it shows in exports.list) and in the audit log. Up to 10,000 rows the file comes back at once; above that it is built in the background (202) and QHR emails you when it is ready. One export of this page at a time per person; at most 20,000 rows. Returns a file, so it is not offered to Claude.
Not available in Claude: it returns a file, not JSON.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
formatRequired | query | string | File format: xlsx (Excel) or csv.Allowed values: xlsx, csv | xlsx |
columns[]Required | query | array<string> | Column keys, in file order, from the page's …export_columns operation. | employee_no,employee_name |
q[status_eq] | query | string | Only this status. Allowed values: draft, pending_accounting, declined, paid, cancelled | paid |
q[employee_employee_name_cont] | query | string | Employee name contains. | Ahmed |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The file (`xlsx` or `csv`, as asked), named `QHR_<page>_<company>_<date>.<format>`.
Returns a file, not JSON: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 400 | bad_format | format is missing or is not xlsx or csv. | Send format=xlsx or format=csv. |
| 400 | no_columns | No columns[] were sent. | Send at least one column key from the page's …export_columns operation. |
| 400 | unknown_column | A column key does not exist on this page, or your role may not see it. | Use only keys returned by the page's …export_columns operation. |
| 400 | bad_filters | A filter value is malformed. | Send the same filters the page's list operation accepts. |
| 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 | token_read_only | This token can only read; the operation makes changes. | Use a token created with "Allow changes". |
| 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. |
| 409 | export_in_progress | An export of this page by the same person is still being built. export is that run. | Wait for it: poll exports.show with export.id, then exports.download. |
| 422 | no_data | No record matches the filters, so there is nothing to export. | Loosen the filters. |
| 422 | too_large | The file would have more than 20,000 rows. row_count and max_rows say by how much. | Narrow the filters or the date range and export in parts. |
entitlement_blocked · 429 rate_limited · 500 internal_error