Import new employees from the filled template
/employees/importsemployee/createRequires feature employeeNot available in Claudeemployee_imports.createUploads the employee import template, filled in, to add up to 500 employees at once (one row each, at most 5 MB). The file's shape is checked straight away: it must be the .xlsx template with its required columns and at least one employee row. The rows are then imported in the background; the answer is 202 with the import_id to follow.
When to use: to add many employees at once, for example when the company starts on QHR. For one person, employees.create is simpler.
Prerequisites: the template from employees.import_template, filled in. Department, location and other choices are written as the template's dropdowns offer them. Follow the import with employee_imports.show.
Side effects: each valid row creates an employee (with salary and allowances when the caller may manage salaries; otherwise those cells are ignored with a warning) and is recorded in the audit log; a row with a problem is skipped and reported. Nobody is invited to QHR. Managers are linked by employee number once all rows are in.
Not offered to Claude: it is a file upload that adds many employees at once, and the employees it creates are not undone by cancelling anything.
This operation cannot be undone and can affect the whole company. Double-check the ids before you call it. For safety it is never offered through Claude.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Request body
multipart/form-data
| Field | Type | Description |
|---|---|---|
fileRequired | file | The spreadsheet, sent as the multipart field file, at most 5 MB and 500 rows. |
Response
202 The file was accepted; the import runs in the background.
| Field | Type | Description |
|---|---|---|
import_idRequired | integer | The import's id, for employee_imports.show. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 400 | bad_request | A parameter is missing or malformed. | Check the parameters against this operation's documentation. |
| 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. |
| 422 | validation_failed | The file is over 5 MB or 500 rows, is not a readable .xlsx, misses required columns, or has no employee rows. | Start again from employees.import_template, keep its columns, and split a large file. |
entitlement_blocked · 429 rate_limited · 500 internal_error