> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/navixy-api/user-api/resources/field-service/employee/import.md).

# Employee import

Create many employees at once from a spreadsheet, through a background import process.

Employee import creates many [employees](/docs/navixy-api/user-api/resources/field-service/employee.md) at once from a spreadsheet, rather than one call per person.

Convert the spreadsheet first with [`data/spreadsheet/parse`](/docs/navixy-api/user-api/resources/commons/data.md#post-data-spreadsheet-parse), which stores it as a tab-separated file and returns its name. Pass that name to `employee/import/start` as `filename`, follow the process with `read` or `list`, and collect the rows that failed validation with `download_failed`.

## API actions

API base path: `/employee/import`.

Operations that list no errors of their own return only the [general error codes](/docs/navixy-api/general/errors.md#error-codes).

Create the TSV file first with [/data/spreadsheet/parse](/docs/navixy-api/user-api/resources/commons/data.md#post-data-spreadsheet-parse), which returns its name as `file_id`. Pass that name to start as `filename`.

Available fields for `headers`:

* `first_name`
* `middle_name`
* `last_name`
* `email`
* `phone`
* `driver_license_number`
* `driver_license_cats`
* `driver_license_issue_date`
* `driver_license_valid_till`
* `hardware_key`
* `address`
* `lat`
* `lng`
* `radius`
* `personnel_number`
* `ssn`
* `tracker_label`
* `tags`
* `undefined` (if a meaning of a field is not known)

***

*Required sub-user rights:* `employee_update`.

## Start employee import

> Start the background process that imports employees from a preloaded TSV file, and return the process ID.\
> \
> Create the file first with \`data/spreadsheet/parse\`, which converts a spreadsheet to TSV and returns its name as \`file\_id\`. Pass that name here as \`filename\`.\
> \
> Requires the \`employee\_update\` right.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Employees","description":"Employees and drivers, their avatars, spreadsheet import, and the departments they belong to. All resources under the /employee/ and /department/ paths."}],"servers":[{"url":"https://api.eu.navixy.com/v2","description":"Navixy production server on European platform"},{"url":"https://api.us.navixy.com/v2","description":"Navixy production server on American platform"},{"url":"https://api.me.navixy.com/v2","description":"Navixy production server on Middle East platform"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","description":"Either a user session hash or an API key, with the \"NVX \" prefix, for example \"NVX 22eac1c27af4be7b9d04da2ce1af111b\". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.","name":"Authorization","in":"header"}},"responses":{"ResponseError":{"description":"Error response object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false."},"status":{"type":"object","description":"Error status. Present only when an error occurred.","properties":{"code":{"type":"integer","description":"An error code in this API, not an HTTP code."},"description":{"type":"string","description":"An error description."}}},"errors":{"type":"array","description":"Per-parameter detail, returned with validation failures such as error code 7. A parameter name here may be an internal field name rather than the documented parameter name.","items":{"type":"object","properties":{"parameter":{"type":"string","description":"Name of the parameter that failed validation."},"error":{"type":"string","description":"What was wrong with it."}}}}}}}}}}},"paths":{"/employee/import/start":{"post":{"tags":["Employees"],"summary":"Start employee import","description":"Start the background process that imports employees from a preloaded TSV file, and return the process ID.\n\nCreate the file first with `data/spreadsheet/parse`, which converts a spreadsheet to TSV and returns its name as `file_id`. Pass that name here as `filename`.\n\nRequires the `employee_update` right.","operationId":"employeeImportStart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","description":"Name of the server-side TSV file, as returned by `data/spreadsheet/parse` in its `file_id`. Must not be empty.","minLength":1},"headers":{"type":"array","description":"What each column of the file holds, in order. Must not be empty. Use `undefined` for a column whose meaning is not known.","items":{"type":"string"},"minItems":1},"user_headers":{"type":"array","description":"Optional. Display labels for the columns. Must be the same length as `headers`.","items":{"type":"string"}}},"required":["filename","headers"]}}}},"responses":{"200":{"description":"The started import","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"id":{"type":"integer","description":"ID of the created import process."}}}}}},"400":{"description":"Bad request. The response body carries the API-level error code in `status.code`. Validation failures also include an `errors` array naming each offending parameter.","$ref":"#/components/responses/ResponseError"},"402":{"description":"Error 233: the preloaded file was not found. Error 234: the file is not a TSV.","$ref":"#/components/responses/ResponseError"},"409":{"description":"Error 247: an identical import already exists for the same file.","$ref":"#/components/responses/ResponseError"},"429":{"description":"Error 15: too many requests, when too many imports are already in progress.","$ref":"#/components/responses/ResponseError"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```

#### Errors

These errors come in addition to the [general error codes](/docs/navixy-api/general/errors.md#error-codes):

* 15 - Too many requests (rate limit exceeded) - if too many imports in progress
* 233 - No data file
* 234 - Invalid data format
* 247 - Entity already exists - there is another identical import with the same file

***

## Read employee import

> Return one employee import process by ID, including its progress.\
> \
> The import process object is the same shape every import family returns, differing only in \`type\`, which is \`employee\` here.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Employees","description":"Employees and drivers, their avatars, spreadsheet import, and the departments they belong to. All resources under the /employee/ and /department/ paths."}],"servers":[{"url":"https://api.eu.navixy.com/v2","description":"Navixy production server on European platform"},{"url":"https://api.us.navixy.com/v2","description":"Navixy production server on American platform"},{"url":"https://api.me.navixy.com/v2","description":"Navixy production server on Middle East platform"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","description":"Either a user session hash or an API key, with the \"NVX \" prefix, for example \"NVX 22eac1c27af4be7b9d04da2ce1af111b\". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.","name":"Authorization","in":"header"}},"schemas":{"ImportProcess":{"type":"object","description":"A background import of records from a preloaded TSV file.\n\n**One shape, shared by every import family**: places, vehicles, employees, zones and the rest all return this object, differing only in `type`.","properties":{"id":{"type":"integer","description":"Import process ID."},"user_id":{"type":"integer","description":"ID of the master user the import belongs to."},"subuser_id":{"type":"integer","description":"ID of the sub-user who started the import. Not listed in the published object description."},"created":{"type":"string","description":"When the import process was created."},"type":{"type":"string","description":"What is being imported.","enum":["place","vehicle","employee","driver","fsm_employee","zone","customer"]},"params":{"type":"object","description":"The import parameters, as given when it was started.","properties":{"headers":{"type":"array","description":"What each column of the file holds, in order.","items":{"type":"string"}},"user_headers":{"type":"array","description":"Optional. Display labels for the columns.","items":{"type":"string"}}}},"filename":{"type":"string","description":"Name of the preloaded TSV file being imported."},"status":{"type":"string","description":"Where the import is. `created` is waiting to start, `done` finished on its own, `failed` could not complete, and `finished` was closed by the user.","enum":["created","in_progress","done","failed","finished"]},"status_change_date":{"type":"string","description":"When the status last changed."},"progress":{"type":"object","description":"How far the import has got.","properties":{"imported":{"type":"integer","description":"Records imported successfully."},"failed":{"type":"integer","description":"Rows that did not pass validation."},"percent":{"type":["integer","null"],"description":"Approximate percentage of rows processed."},"processed_lines":{"type":"integer","description":"Lines processed so far."},"warnings":{"type":"array","description":"The first 25 warnings.","items":{"$ref":"#/components/schemas/ImportLineMessage"}},"errors":{"type":"array","description":"The first 25 errors.","items":{"$ref":"#/components/schemas/ImportLineMessage"}}}}}},"ImportLineMessage":{"type":"object","description":"One problem found in the imported file, tied to the line it was found on.","properties":{"line":{"type":"integer","description":"Line number in the file."},"message":{"type":"string","description":"What was wrong with it."}}}},"responses":{"ResponseError":{"description":"Error response object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false."},"status":{"type":"object","description":"Error status. Present only when an error occurred.","properties":{"code":{"type":"integer","description":"An error code in this API, not an HTTP code."},"description":{"type":"string","description":"An error description."}}},"errors":{"type":"array","description":"Per-parameter detail, returned with validation failures such as error code 7. A parameter name here may be an internal field name rather than the documented parameter name.","items":{"type":"object","properties":{"parameter":{"type":"string","description":"Name of the parameter that failed validation."},"error":{"type":"string","description":"What was wrong with it."}}}}}}}}}}},"paths":{"/employee/import/read":{"post":{"tags":["Employees"],"summary":"Read employee import","description":"Return one employee import process by ID, including its progress.\n\nThe import process object is the same shape every import family returns, differing only in `type`, which is `employee` here.","operationId":"employeeImportRead","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"process_id":{"type":"integer","description":"ID of the import process.","minimum":1}},"required":["process_id"]}}}},"responses":{"200":{"description":"The import process","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"value":{"$ref":"#/components/schemas/ImportProcess"}}}}}},"400":{"description":"Bad request. The response body carries the API-level error code in `status.code`. Validation failures also include an `errors` array naming each offending parameter.","$ref":"#/components/responses/ResponseError"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```

#### Errors

These errors come in addition to the [general error codes](/docs/navixy-api/general/errors.md#error-codes):

* 201 - Not found in database (if import is not found)

***

## List employee imports

> List the current user's unfinished employee import processes.\
> \
> Callable with an empty body.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Employees","description":"Employees and drivers, their avatars, spreadsheet import, and the departments they belong to. All resources under the /employee/ and /department/ paths."}],"servers":[{"url":"https://api.eu.navixy.com/v2","description":"Navixy production server on European platform"},{"url":"https://api.us.navixy.com/v2","description":"Navixy production server on American platform"},{"url":"https://api.me.navixy.com/v2","description":"Navixy production server on Middle East platform"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","description":"Either a user session hash or an API key, with the \"NVX \" prefix, for example \"NVX 22eac1c27af4be7b9d04da2ce1af111b\". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.","name":"Authorization","in":"header"}},"schemas":{"ImportProcess":{"type":"object","description":"A background import of records from a preloaded TSV file.\n\n**One shape, shared by every import family**: places, vehicles, employees, zones and the rest all return this object, differing only in `type`.","properties":{"id":{"type":"integer","description":"Import process ID."},"user_id":{"type":"integer","description":"ID of the master user the import belongs to."},"subuser_id":{"type":"integer","description":"ID of the sub-user who started the import. Not listed in the published object description."},"created":{"type":"string","description":"When the import process was created."},"type":{"type":"string","description":"What is being imported.","enum":["place","vehicle","employee","driver","fsm_employee","zone","customer"]},"params":{"type":"object","description":"The import parameters, as given when it was started.","properties":{"headers":{"type":"array","description":"What each column of the file holds, in order.","items":{"type":"string"}},"user_headers":{"type":"array","description":"Optional. Display labels for the columns.","items":{"type":"string"}}}},"filename":{"type":"string","description":"Name of the preloaded TSV file being imported."},"status":{"type":"string","description":"Where the import is. `created` is waiting to start, `done` finished on its own, `failed` could not complete, and `finished` was closed by the user.","enum":["created","in_progress","done","failed","finished"]},"status_change_date":{"type":"string","description":"When the status last changed."},"progress":{"type":"object","description":"How far the import has got.","properties":{"imported":{"type":"integer","description":"Records imported successfully."},"failed":{"type":"integer","description":"Rows that did not pass validation."},"percent":{"type":["integer","null"],"description":"Approximate percentage of rows processed."},"processed_lines":{"type":"integer","description":"Lines processed so far."},"warnings":{"type":"array","description":"The first 25 warnings.","items":{"$ref":"#/components/schemas/ImportLineMessage"}},"errors":{"type":"array","description":"The first 25 errors.","items":{"$ref":"#/components/schemas/ImportLineMessage"}}}}}},"ImportLineMessage":{"type":"object","description":"One problem found in the imported file, tied to the line it was found on.","properties":{"line":{"type":"integer","description":"Line number in the file."},"message":{"type":"string","description":"What was wrong with it."}}}},"responses":{"ResponseError":{"description":"Error response object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false."},"status":{"type":"object","description":"Error status. Present only when an error occurred.","properties":{"code":{"type":"integer","description":"An error code in this API, not an HTTP code."},"description":{"type":"string","description":"An error description."}}},"errors":{"type":"array","description":"Per-parameter detail, returned with validation failures such as error code 7. A parameter name here may be an internal field name rather than the documented parameter name.","items":{"type":"object","properties":{"parameter":{"type":"string","description":"Name of the parameter that failed validation."},"error":{"type":"string","description":"What was wrong with it."}}}}}}}}}}},"paths":{"/employee/import/list":{"post":{"tags":["Employees"],"summary":"List employee imports","description":"List the current user's unfinished employee import processes.\n\nCallable with an empty body.","operationId":"employeeImportList","responses":{"200":{"description":"Unfinished import processes","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"list":{"type":"array","items":{"$ref":"#/components/schemas/ImportProcess"}}}}}}},"400":{"description":"Bad request. The response body carries the API-level error code in `status.code`. Validation failures also include an `errors` array naming each offending parameter.","$ref":"#/components/responses/ResponseError"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```

***

## Download failed employee rows

> Return a file of the rows that failed validation, so they can be corrected and imported again.\
> \
> The response is the file itself, not a JSON envelope.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Employees","description":"Employees and drivers, their avatars, spreadsheet import, and the departments they belong to. All resources under the /employee/ and /department/ paths."}],"servers":[{"url":"https://api.eu.navixy.com/v2","description":"Navixy production server on European platform"},{"url":"https://api.us.navixy.com/v2","description":"Navixy production server on American platform"},{"url":"https://api.me.navixy.com/v2","description":"Navixy production server on Middle East platform"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","description":"Either a user session hash or an API key, with the \"NVX \" prefix, for example \"NVX 22eac1c27af4be7b9d04da2ce1af111b\". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.","name":"Authorization","in":"header"}},"responses":{"ResponseError":{"description":"Error response object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false."},"status":{"type":"object","description":"Error status. Present only when an error occurred.","properties":{"code":{"type":"integer","description":"An error code in this API, not an HTTP code."},"description":{"type":"string","description":"An error description."}}},"errors":{"type":"array","description":"Per-parameter detail, returned with validation failures such as error code 7. A parameter name here may be an internal field name rather than the documented parameter name.","items":{"type":"object","properties":{"parameter":{"type":"string","description":"Name of the parameter that failed validation."},"error":{"type":"string","description":"What was wrong with it."}}}}}}}}}}},"paths":{"/employee/import/download_failed":{"post":{"tags":["Employees"],"summary":"Download failed employee rows","description":"Return a file of the rows that failed validation, so they can be corrected and imported again.\n\nThe response is the file itself, not a JSON envelope.","operationId":"employeeImportDownloadFailed","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"process_id":{"type":"integer","description":"ID of the import process.","minimum":1}},"required":["process_id"]}}}},"responses":{"200":{"description":"The failed rows as a file","content":{"text/tab-separated-values":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request. The response body carries the API-level error code in `status.code`. Validation failures also include an `errors` array naming each offending parameter.","$ref":"#/components/responses/ResponseError"},"404":{"description":"Error 204: the file of failed rows was not found.","$ref":"#/components/responses/ResponseError"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```

#### Errors

These errors come in addition to the [general error codes](/docs/navixy-api/general/errors.md#error-codes):

* 201 - Not found in database (if import is not found)
* 204 - Entity not found (if file is not found)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://navixy.com/docs/navixy-api/user-api/resources/field-service/employee/import.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
