> 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/fleet/vehicle/import.md).

# Vehicle import

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

Vehicle import creates many [vehicles](/docs/navixy-api/user-api/resources/fleet/vehicle.md) at once from a spreadsheet, rather than one call per vehicle.

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 `vehicle/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: `/vehicle/import`.

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

Starting the background process of importing vehicles.

***

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

Available fields:

* `label`
* `model`
* `max_speed`
* `type`
* `subtype`
* `garage`
* `trailer`
* `manufacture_year`
* `color`
* `additional_info`
* `trailer_reg_number`
* `reg_number`
* `chassis_number`
* `frame_number`
* `vin`
* `passengers`
* `payload_weight`
* `payload_height`
* `payload_width`
* `payload_length`
* `gross_weight`
* `fuel_grade`
* `fuel_tank_volume`
* `fuel_cost`
* `norm_avg_fuel_consumption`
* `fuel_type`
* `tyre_size`
* `tyres_number`
* `wheel_arrangement`
* `free_insurance_policy_number`
* `liability_insurance_policy_number`
* `free_insurance_valid_till`
* `liability_insurance_valid_till`
* `tracker_label`
* `tags`
* `undefined` (if a meaning of a field is not known)

**Response**

```json
{
  "success": true,
  "id": <int>
}
```

**Example**

cURL

```sh
curl --request POST \
  --url 'https://api.eu.navixy.com/v2/vehicle/import/start' \
  --header 'Content-Type: application/json' \
  --data-binary @- << EOF
{
    "hash": "a6aa75587e5c59c32d347da438505fc3",
    "filename": "tmp-sheet640571613016981796.tsv",
    "headers": ["label", "model", "max_speed", "type", "subtype", "reg_number", "fuel_grade", "fuel_tank_volume", "free_insurance_policy_number", "free_insurance_valid_till", "tracker_label", "tags"],
    "user_headers": [ "Model", "Max speed", "Type", "Subtype", "Reg. number", "Fuel grade", "Fuel tank volume", "Free insurance policy number", "Free insurance valid till", "Object", "Tags"]
}
EOF
```

**Errors**

* 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

## Start vehicle import

> Start importing vehicles from a spreadsheet previously uploaded through \`data/spreadsheet/parse\`.\
> \
> Requires the \`vehicle\_update\` right.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Vehicles","description":"Vehicles in the fleet, their avatars and status list, spreadsheet import, and the service works scheduled against them. All resources under the /vehicle/ path."}],"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":{"/vehicle/import/start":{"post":{"tags":["Vehicles"],"summary":"Start vehicle import","description":"Start importing vehicles from a spreadsheet previously uploaded through `data/spreadsheet/parse`.\n\nRequires the `vehicle_update` right.","operationId":"vehicleImportStart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","description":"Name of the file preloaded with `data/spreadsheet/parse`."},"headers":{"type":"array","description":"Column headers, naming which vehicle field each column holds.","items":{"type":"string"}},"user_headers":{"type":"array","description":"Optional. User-facing labels for the headers.","items":{"type":"string"}}},"required":["filename","headers"]}}}},"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":{"type":"integer","description":"Process ID, to poll with `vehicle/import/read`."}}}}}},"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 234: the file exceeds a size limit.","$ref":"#/components/responses/ResponseError"},"429":{"description":"Error 15: too many requests, rate limit exceeded.","$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 (rate limit), 233, 234, 247.

***

Reads the state of one import process.

## Read vehicle import

> Return the state of one import process.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Vehicles","description":"Vehicles in the fleet, their avatars and status list, spreadsheet import, and the service works scheduled against them. All resources under the /vehicle/ path."}],"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":{"/vehicle/import/read":{"post":{"tags":["Vehicles"],"summary":"Read vehicle import","description":"Return the state of one import process.","operationId":"vehicleImportRead","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"process_id":{"type":"integer","description":"ID of the import process."}},"required":["process_id"]}}}},"responses":{"200":{"description":"The import process state","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 the database.

***

Lists the import processes of the current user.

## List vehicle imports

> List the import processes of the current user. Callable with an empty body.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Vehicles","description":"Vehicles in the fleet, their avatars and status list, spreadsheet import, and the service works scheduled against them. All resources under the /vehicle/ path."}],"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":{"/vehicle/import/list":{"post":{"tags":["Vehicles"],"summary":"List vehicle imports","description":"List the import processes of the current user. Callable with an empty body.","operationId":"vehicleImportList","responses":{"200":{"description":"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"}}}}}}
```

***

Downloads the rows the import could not process, so they can be corrected and retried.

## Download failed import rows

> Download the rows an import could not process, so they can be corrected and retried.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Vehicles","description":"Vehicles in the fleet, their avatars and status list, spreadsheet import, and the service works scheduled against them. All resources under the /vehicle/ path."}],"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":{"/vehicle/import/download_failed":{"post":{"tags":["Vehicles"],"summary":"Download failed import rows","description":"Download the rows an import could not process, so they can be corrected and retried.","operationId":"vehicleImportDownloadFailed","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"process_id":{"type":"integer","description":"ID of the import process."}},"required":["process_id"]}}}},"responses":{"200":{"description":"The failed rows as a file.","content":{"text/csv":{"schema":{"type":"string"}}}},"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: entity 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, 204.


---

# 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/fleet/vehicle/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.
