> 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/service-task.md).

# Service task

Scheduled maintenance on a vehicle, due by date, mileage, or engine hours.

A service task is a piece of maintenance due on a vehicle: an oil change, a brake replacement, an inspection. It is what turns tracking data into a maintenance schedule, because the Navixy platform can watch a vehicle's mileage and engine hours and raise the task when either passes its threshold.

A task carries a status through its life, changed with `set_status`, and can carry [files](/docs/navixy-api/user-api/resources/fleet/vehicle/service-task/file.md) such as an invoice or a photograph of the work. For a walkthrough, see [how to manage vehicles and service works](/docs/navixy-api/user-api/guides/fleet-management/service-works.md).

## Service task object

## The ServiceTask object

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"components":{"schemas":{"ServiceTask":{"type":"object","description":"A service work scheduled against a vehicle.","properties":{"id":{"type":"integer","description":"ID of the service work. Omit when creating."},"vehicle_id":{"type":"integer","description":"ID of the associated vehicle."},"vehicle_label":{"type":"string","description":"Label of the associated vehicle."},"description":{"type":"string","description":"Name of the service work. Up to 255 characters.","maxLength":255},"comment":{"type":"string","description":"Comment. Up to 255 characters.","maxLength":255},"status":{"type":"string","description":"Current status. `created` is the initial state, `notified` means a condition passed its notification limit, `expired` means a condition was exceeded, `done` means the user marked it complete.","enum":["created","notified","expired","done"]},"repeat":{"type":"boolean","description":"If `true`, a new task is created when this one is done."},"unplanned":{"type":"boolean","description":"If `true`, the work is unplanned. For information only."},"cost":{"type":"number","description":"Cost in the currency of the user. For information only."},"completion_date":{"type":["string","null"],"description":"Date the service work was completed."},"start":{"type":"object","description":"Counter values when the task was created.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"completion":{"allOf":[{"type":"object","description":"Date and counter values when the task was marked done.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}}],"description":"**Not editable.**"},"current_position":{"type":"object","description":"Current counter values.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"conditions":{"$ref":"#/components/schemas/ServiceTaskConditions"},"notifications":{"$ref":"#/components/schemas/ServiceTaskNotifications"},"file_ids":{"type":"array","description":"IDs of attached files. One file may be attached to several service works, so deleting one task does not delete a shared file.","items":{"type":"integer"}},"prediction":{"type":["object","null"],"description":"**Legacy, no longer used.** Controlled by the `return_prediction` parameter on the list and download operations.","properties":{"end_date":{"type":"string","description":"Predicted completion date."},"wear_percentage":{"type":"integer","description":"Predicted wear percentage."}}}}},"ServiceTaskConditions":{"type":"object","description":"When the service work falls due. **At least one of `mileage`, `date`, or `engine_hours` must be given.**","properties":{"mileage":{"type":"object","description":"Fall due at a mileage.","properties":{"limit":{"type":"integer","description":"Mileage limit in kilometres."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"date":{"type":"object","description":"Fall due on a date.","properties":{"end":{"type":"string","description":"Date and time the work falls due."},"notification_interval":{"type":"integer","description":"How many days before the date to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"engine_hours":{"type":"object","description":"Fall due at an engine-hours reading.","properties":{"limit":{"type":"integer","description":"Engine-hours limit."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}}}},"ServiceTaskNotifications":{"type":"object","description":"Where notifications about this service work are sent.","properties":{"sms_phones":{"type":"array","description":"Phone numbers to notify by SMS.","items":{"type":"string"}},"emails":{"type":"array","description":"Email addresses to notify.","items":{"type":"string"}},"push_enabled":{"type":"boolean","description":"Whether push notifications are sent."}}}}}}
```

## The ServiceTaskConditions object

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"components":{"schemas":{"ServiceTaskConditions":{"type":"object","description":"When the service work falls due. **At least one of `mileage`, `date`, or `engine_hours` must be given.**","properties":{"mileage":{"type":"object","description":"Fall due at a mileage.","properties":{"limit":{"type":"integer","description":"Mileage limit in kilometres."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"date":{"type":"object","description":"Fall due on a date.","properties":{"end":{"type":"string","description":"Date and time the work falls due."},"notification_interval":{"type":"integer","description":"How many days before the date to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"engine_hours":{"type":"object","description":"Fall due at an engine-hours reading.","properties":{"limit":{"type":"integer","description":"Engine-hours limit."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}}}}}}}
```

## The ServiceTaskNotifications object

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"components":{"schemas":{"ServiceTaskNotifications":{"type":"object","description":"Where notifications about this service work are sent.","properties":{"sms_phones":{"type":"array","description":"Phone numbers to notify by SMS.","items":{"type":"string"}},"emails":{"type":"array","description":"Email addresses to notify.","items":{"type":"string"}},"push_enabled":{"type":"boolean","description":"Whether push notifications are sent."}}}}}}
```

## Task status

Task **status** may be one of:

* `created` - initial state of task.
* `notified` - one of conditions exceed notification limit.
* `expired` - one of conditions exceeded.
* `done` - user [set](#post-vehicle-service_task-set_status) task as "done".

## API actions

API base path: `/vehicle/service_task`.

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

The `conditions` parameter of `service_task/list` and `service_task/download` filters the task list and takes [entity search conditions](/docs/navixy-api/user-api/resources/commons/entity/search_conditions.md). It is not the task's own `conditions` object, which holds the thresholds that make a task due.

***

Creates the same service work for a batch of vehicles. At least one of `conditions.mileage`, `conditions.date` or `conditions.engine_hours` must be passed.

## Create service tasks for vehicles

> Create the same service work for several vehicles at once.\
> \
> \*\*At least one of \`conditions.mileage\`, \`conditions.date\`, or \`conditions.engine\_hours\` must be given.\*\*

```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":{"ServiceTask":{"type":"object","description":"A service work scheduled against a vehicle.","properties":{"id":{"type":"integer","description":"ID of the service work. Omit when creating."},"vehicle_id":{"type":"integer","description":"ID of the associated vehicle."},"vehicle_label":{"type":"string","description":"Label of the associated vehicle."},"description":{"type":"string","description":"Name of the service work. Up to 255 characters.","maxLength":255},"comment":{"type":"string","description":"Comment. Up to 255 characters.","maxLength":255},"status":{"type":"string","description":"Current status. `created` is the initial state, `notified` means a condition passed its notification limit, `expired` means a condition was exceeded, `done` means the user marked it complete.","enum":["created","notified","expired","done"]},"repeat":{"type":"boolean","description":"If `true`, a new task is created when this one is done."},"unplanned":{"type":"boolean","description":"If `true`, the work is unplanned. For information only."},"cost":{"type":"number","description":"Cost in the currency of the user. For information only."},"completion_date":{"type":["string","null"],"description":"Date the service work was completed."},"start":{"type":"object","description":"Counter values when the task was created.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"completion":{"allOf":[{"type":"object","description":"Date and counter values when the task was marked done.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}}],"description":"**Not editable.**"},"current_position":{"type":"object","description":"Current counter values.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"conditions":{"$ref":"#/components/schemas/ServiceTaskConditions"},"notifications":{"$ref":"#/components/schemas/ServiceTaskNotifications"},"file_ids":{"type":"array","description":"IDs of attached files. One file may be attached to several service works, so deleting one task does not delete a shared file.","items":{"type":"integer"}},"prediction":{"type":["object","null"],"description":"**Legacy, no longer used.** Controlled by the `return_prediction` parameter on the list and download operations.","properties":{"end_date":{"type":"string","description":"Predicted completion date."},"wear_percentage":{"type":"integer","description":"Predicted wear percentage."}}}}},"ServiceTaskConditions":{"type":"object","description":"When the service work falls due. **At least one of `mileage`, `date`, or `engine_hours` must be given.**","properties":{"mileage":{"type":"object","description":"Fall due at a mileage.","properties":{"limit":{"type":"integer","description":"Mileage limit in kilometres."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"date":{"type":"object","description":"Fall due on a date.","properties":{"end":{"type":"string","description":"Date and time the work falls due."},"notification_interval":{"type":"integer","description":"How many days before the date to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"engine_hours":{"type":"object","description":"Fall due at an engine-hours reading.","properties":{"limit":{"type":"integer","description":"Engine-hours limit."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}}}},"ServiceTaskNotifications":{"type":"object","description":"Where notifications about this service work are sent.","properties":{"sms_phones":{"type":"array","description":"Phone numbers to notify by SMS.","items":{"type":"string"}},"emails":{"type":"array","description":"Email addresses to notify.","items":{"type":"string"}},"push_enabled":{"type":"boolean","description":"Whether push notifications are sent."}}}},"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/service_task/batch/create":{"post":{"tags":["Vehicles"],"summary":"Create service tasks for vehicles","description":"Create the same service work for several vehicles at once.\n\n**At least one of `conditions.mileage`, `conditions.date`, or `conditions.engine_hours` must be given.**","operationId":"vehicleServiceTaskBatchCreate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task":{"allOf":[{"$ref":"#/components/schemas/ServiceTask"}],"description":"The service work to create, without `id` or `vehicle_id`."},"vehicle_ids":{"type":"array","description":"Vehicles to create the service work for.","items":{"type":"integer"}}},"required":["task","vehicle_ids"]}}}},"responses":{"200":{"description":"The created service works","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"ids":{"type":"array","description":"IDs of the new service works.","items":{"type":"integer"}}}}}}},"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"}}}}}}
```

***

Creates a service work for one vehicle. At least one of `conditions.mileage`, `conditions.date` or `conditions.engine_hours` must be passed.

## Create service task

> Create a service work for one vehicle.\
> \
> \*\*At least one of \`conditions.mileage\`, \`conditions.date\`, or \`conditions.engine\_hours\` must be given.\*\*

```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":{"ServiceTask":{"type":"object","description":"A service work scheduled against a vehicle.","properties":{"id":{"type":"integer","description":"ID of the service work. Omit when creating."},"vehicle_id":{"type":"integer","description":"ID of the associated vehicle."},"vehicle_label":{"type":"string","description":"Label of the associated vehicle."},"description":{"type":"string","description":"Name of the service work. Up to 255 characters.","maxLength":255},"comment":{"type":"string","description":"Comment. Up to 255 characters.","maxLength":255},"status":{"type":"string","description":"Current status. `created` is the initial state, `notified` means a condition passed its notification limit, `expired` means a condition was exceeded, `done` means the user marked it complete.","enum":["created","notified","expired","done"]},"repeat":{"type":"boolean","description":"If `true`, a new task is created when this one is done."},"unplanned":{"type":"boolean","description":"If `true`, the work is unplanned. For information only."},"cost":{"type":"number","description":"Cost in the currency of the user. For information only."},"completion_date":{"type":["string","null"],"description":"Date the service work was completed."},"start":{"type":"object","description":"Counter values when the task was created.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"completion":{"allOf":[{"type":"object","description":"Date and counter values when the task was marked done.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}}],"description":"**Not editable.**"},"current_position":{"type":"object","description":"Current counter values.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"conditions":{"$ref":"#/components/schemas/ServiceTaskConditions"},"notifications":{"$ref":"#/components/schemas/ServiceTaskNotifications"},"file_ids":{"type":"array","description":"IDs of attached files. One file may be attached to several service works, so deleting one task does not delete a shared file.","items":{"type":"integer"}},"prediction":{"type":["object","null"],"description":"**Legacy, no longer used.** Controlled by the `return_prediction` parameter on the list and download operations.","properties":{"end_date":{"type":"string","description":"Predicted completion date."},"wear_percentage":{"type":"integer","description":"Predicted wear percentage."}}}}},"ServiceTaskConditions":{"type":"object","description":"When the service work falls due. **At least one of `mileage`, `date`, or `engine_hours` must be given.**","properties":{"mileage":{"type":"object","description":"Fall due at a mileage.","properties":{"limit":{"type":"integer","description":"Mileage limit in kilometres."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"date":{"type":"object","description":"Fall due on a date.","properties":{"end":{"type":"string","description":"Date and time the work falls due."},"notification_interval":{"type":"integer","description":"How many days before the date to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"engine_hours":{"type":"object","description":"Fall due at an engine-hours reading.","properties":{"limit":{"type":"integer","description":"Engine-hours limit."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}}}},"ServiceTaskNotifications":{"type":"object","description":"Where notifications about this service work are sent.","properties":{"sms_phones":{"type":"array","description":"Phone numbers to notify by SMS.","items":{"type":"string"}},"emails":{"type":"array","description":"Email addresses to notify.","items":{"type":"string"}},"push_enabled":{"type":"boolean","description":"Whether push notifications are sent."}}}},"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/service_task/create":{"post":{"tags":["Vehicles"],"summary":"Create service task","description":"Create a service work for one vehicle.\n\n**At least one of `conditions.mileage`, `conditions.date`, or `conditions.engine_hours` must be given.**","operationId":"vehicleServiceTaskCreate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task":{"allOf":[{"$ref":"#/components/schemas/ServiceTask"}],"description":"The service work to create, without `id`."}},"required":["task"]}}}},"responses":{"200":{"description":"The created service work","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 new service work."}}}}}},"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, 214.

***

Deletes a service work.

## Delete service task

> Delete a service work. Also accepts GET.

```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":{"OK":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true}}}}}},"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/service_task/delete":{"post":{"tags":["Vehicles"],"summary":"Delete service task","description":"Delete a service work. Also accepts GET.","operationId":"vehicleServiceTaskDelete","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"integer","description":"Optional. ID of a single service work. Give this or `task_ids`."},"task_ids":{"type":"array","description":"Optional. IDs of service works. Give this or `task_id`.","items":{"type":"integer"}}}}}}},"responses":{"200":{"description":"Service work deleted","$ref":"#/components/responses/OK"},"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 a report of service works, using the same filters as list.

## Download service task report

> Download a report of service works, using the same filters as the list operation, plus report-shaping parameters. Also accepts GET.

```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/service_task/download":{"post":{"tags":["Vehicles"],"summary":"Download service task report","description":"Download a report of service works, using the same filters as the list operation, plus report-shaping parameters. Also accepts GET.","operationId":"vehicleServiceTaskDownload","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"only_unplanned":{"type":"boolean","description":"Optional. Default `false`. If `true`, only unplanned service works are included."},"vehicle_ids":{"type":"array","description":"Optional. Restrict to these vehicles.","items":{"type":"integer"}},"statuses":{"type":"array","description":"Optional. Restrict to these statuses.","items":{"type":"string","enum":["created","notified","done","expired"]}},"conditions":{"type":"array","description":"Optional. Search conditions to apply. See the search conditions reference.","items":{"type":"object","additionalProperties":true}},"filter":{"type":"string","description":"Optional. Text filter. Used together with `conditions`, both must match."},"sort":{"type":"array","description":"Optional. Sort options, each a property and direction such as `status=asc`. Sortable and filterable properties: `id`, `vehicle`, `vehicle_id`, `description`, `status`, `cost`, `comment`, `creation_date`, `completion_date`, `predicted_date`.","items":{"type":"string"}},"limit":{"type":"integer","description":"Optional. Maximum number of service works to return."},"offset":{"type":"integer","description":"Optional. Offset for pagination."},"add_filename_header":{"type":"boolean","description":"Optional. Default `false`. If `true`, a `Content-Disposition` header is appended to the response."},"return_prediction":{"type":"boolean","description":"Optional. Default `true`. Include the legacy `prediction` field."},"format":{"type":"string","description":"Optional. Default `pdf`. Report format.","enum":["pdf","xls","xlsx"]},"group_by":{"type":"string","description":"Optional. Group the report by vehicle or by status.","enum":["vehicle","status"]},"columns":{"type":"array","description":"Optional. Report columns to include, without duplicates. When omitted the report contains every column except `creation_date`.","items":{"type":"string","enum":["vehicle_label","creation_date","description","status","mileage_remains","hours_remains","days_remains","cost","completed","files","comment"]}}}}}}},"responses":{"200":{"description":"The report 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"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```

***

Lists service works across all of the user's vehicles.

## List service tasks

> List service works across all of the user's vehicles. Callable with an empty body. Also accepts GET.

```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":{"ServiceTask":{"type":"object","description":"A service work scheduled against a vehicle.","properties":{"id":{"type":"integer","description":"ID of the service work. Omit when creating."},"vehicle_id":{"type":"integer","description":"ID of the associated vehicle."},"vehicle_label":{"type":"string","description":"Label of the associated vehicle."},"description":{"type":"string","description":"Name of the service work. Up to 255 characters.","maxLength":255},"comment":{"type":"string","description":"Comment. Up to 255 characters.","maxLength":255},"status":{"type":"string","description":"Current status. `created` is the initial state, `notified` means a condition passed its notification limit, `expired` means a condition was exceeded, `done` means the user marked it complete.","enum":["created","notified","expired","done"]},"repeat":{"type":"boolean","description":"If `true`, a new task is created when this one is done."},"unplanned":{"type":"boolean","description":"If `true`, the work is unplanned. For information only."},"cost":{"type":"number","description":"Cost in the currency of the user. For information only."},"completion_date":{"type":["string","null"],"description":"Date the service work was completed."},"start":{"type":"object","description":"Counter values when the task was created.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"completion":{"allOf":[{"type":"object","description":"Date and counter values when the task was marked done.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}}],"description":"**Not editable.**"},"current_position":{"type":"object","description":"Current counter values.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"conditions":{"$ref":"#/components/schemas/ServiceTaskConditions"},"notifications":{"$ref":"#/components/schemas/ServiceTaskNotifications"},"file_ids":{"type":"array","description":"IDs of attached files. One file may be attached to several service works, so deleting one task does not delete a shared file.","items":{"type":"integer"}},"prediction":{"type":["object","null"],"description":"**Legacy, no longer used.** Controlled by the `return_prediction` parameter on the list and download operations.","properties":{"end_date":{"type":"string","description":"Predicted completion date."},"wear_percentage":{"type":"integer","description":"Predicted wear percentage."}}}}},"ServiceTaskConditions":{"type":"object","description":"When the service work falls due. **At least one of `mileage`, `date`, or `engine_hours` must be given.**","properties":{"mileage":{"type":"object","description":"Fall due at a mileage.","properties":{"limit":{"type":"integer","description":"Mileage limit in kilometres."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"date":{"type":"object","description":"Fall due on a date.","properties":{"end":{"type":"string","description":"Date and time the work falls due."},"notification_interval":{"type":"integer","description":"How many days before the date to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"engine_hours":{"type":"object","description":"Fall due at an engine-hours reading.","properties":{"limit":{"type":"integer","description":"Engine-hours limit."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}}}},"ServiceTaskNotifications":{"type":"object","description":"Where notifications about this service work are sent.","properties":{"sms_phones":{"type":"array","description":"Phone numbers to notify by SMS.","items":{"type":"string"}},"emails":{"type":"array","description":"Email addresses to notify.","items":{"type":"string"}},"push_enabled":{"type":"boolean","description":"Whether push notifications are sent."}}}},"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/service_task/list":{"post":{"tags":["Vehicles"],"summary":"List service tasks","description":"List service works across all of the user's vehicles. Callable with an empty body. Also accepts GET.","operationId":"vehicleServiceTaskList","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"only_unplanned":{"type":"boolean","description":"Optional. Default `false`. If `true`, only unplanned service works are included."},"vehicle_ids":{"type":"array","description":"Optional. Restrict to these vehicles.","items":{"type":"integer"}},"statuses":{"type":"array","description":"Optional. Restrict to these statuses.","items":{"type":"string","enum":["created","notified","done","expired"]}},"conditions":{"type":"array","description":"Optional. Search conditions to apply. See the search conditions reference.","items":{"type":"object","additionalProperties":true}},"filter":{"type":"string","description":"Optional. Text filter. Used together with `conditions`, both must match."},"sort":{"type":"array","description":"Optional. Sort options, each a property and direction such as `status=asc`. Sortable and filterable properties: `id`, `vehicle`, `vehicle_id`, `description`, `status`, `cost`, `comment`, `creation_date`, `completion_date`, `predicted_date`.","items":{"type":"string"}},"limit":{"type":"integer","description":"Optional. Maximum number of service works to return."},"offset":{"type":"integer","description":"Optional. Offset for pagination."},"add_filename_header":{"type":"boolean","description":"Optional. Default `false`. If `true`, a `Content-Disposition` header is appended to the response."},"return_prediction":{"type":"boolean","description":"Optional. Default `true`. Include the legacy `prediction` field."}}}}}},"responses":{"200":{"description":"Matching service works","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/ServiceTask"}}}}}}},"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.

***

Reads one service work by ID.

## Read service task

> Return one service work by ID. Also accepts GET.

```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":{"ServiceTask":{"type":"object","description":"A service work scheduled against a vehicle.","properties":{"id":{"type":"integer","description":"ID of the service work. Omit when creating."},"vehicle_id":{"type":"integer","description":"ID of the associated vehicle."},"vehicle_label":{"type":"string","description":"Label of the associated vehicle."},"description":{"type":"string","description":"Name of the service work. Up to 255 characters.","maxLength":255},"comment":{"type":"string","description":"Comment. Up to 255 characters.","maxLength":255},"status":{"type":"string","description":"Current status. `created` is the initial state, `notified` means a condition passed its notification limit, `expired` means a condition was exceeded, `done` means the user marked it complete.","enum":["created","notified","expired","done"]},"repeat":{"type":"boolean","description":"If `true`, a new task is created when this one is done."},"unplanned":{"type":"boolean","description":"If `true`, the work is unplanned. For information only."},"cost":{"type":"number","description":"Cost in the currency of the user. For information only."},"completion_date":{"type":["string","null"],"description":"Date the service work was completed."},"start":{"type":"object","description":"Counter values when the task was created.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"completion":{"allOf":[{"type":"object","description":"Date and counter values when the task was marked done.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}}],"description":"**Not editable.**"},"current_position":{"type":"object","description":"Current counter values.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"conditions":{"$ref":"#/components/schemas/ServiceTaskConditions"},"notifications":{"$ref":"#/components/schemas/ServiceTaskNotifications"},"file_ids":{"type":"array","description":"IDs of attached files. One file may be attached to several service works, so deleting one task does not delete a shared file.","items":{"type":"integer"}},"prediction":{"type":["object","null"],"description":"**Legacy, no longer used.** Controlled by the `return_prediction` parameter on the list and download operations.","properties":{"end_date":{"type":"string","description":"Predicted completion date."},"wear_percentage":{"type":"integer","description":"Predicted wear percentage."}}}}},"ServiceTaskConditions":{"type":"object","description":"When the service work falls due. **At least one of `mileage`, `date`, or `engine_hours` must be given.**","properties":{"mileage":{"type":"object","description":"Fall due at a mileage.","properties":{"limit":{"type":"integer","description":"Mileage limit in kilometres."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"date":{"type":"object","description":"Fall due on a date.","properties":{"end":{"type":"string","description":"Date and time the work falls due."},"notification_interval":{"type":"integer","description":"How many days before the date to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"engine_hours":{"type":"object","description":"Fall due at an engine-hours reading.","properties":{"limit":{"type":"integer","description":"Engine-hours limit."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}}}},"ServiceTaskNotifications":{"type":"object","description":"Where notifications about this service work are sent.","properties":{"sms_phones":{"type":"array","description":"Phone numbers to notify by SMS.","items":{"type":"string"}},"emails":{"type":"array","description":"Email addresses to notify.","items":{"type":"string"}},"push_enabled":{"type":"boolean","description":"Whether push notifications are sent."}}}},"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/service_task/read":{"post":{"tags":["Vehicles"],"summary":"Read service task","description":"Return one service work by ID. Also accepts GET.","operationId":"vehicleServiceTaskRead","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"integer","description":"ID of the service work."},"return_prediction":{"type":"boolean","description":"Optional. Default `true`. Include the legacy `prediction` field."}},"required":["task_id"]}}}},"responses":{"200":{"description":"The service work","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"value":{"$ref":"#/components/schemas/ServiceTask"}}}}}},"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"}}}}}}
```

***

Updates a task status. On `done`, the current date and the counter values used in its conditions are saved, which freezes the wear percentage.

## Set service task status

> Set a service work's status. On \`done\`, the current date and the counter values used in its conditions are saved, which freezes the wear percentage.\
> \
> \*\*Only \`done\` is accepted at present.\*\* Also accepts GET.

```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":{"OK":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true}}}}}},"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/service_task/set_status":{"post":{"tags":["Vehicles"],"summary":"Set service task status","description":"Set a service work's status. On `done`, the current date and the counter values used in its conditions are saved, which freezes the wear percentage.\n\n**Only `done` is accepted at present.** Also accepts GET.","operationId":"vehicleServiceTaskSetStatus","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"integer","description":"ID of the service work."},"status":{"type":"string","description":"The new status. Only `done` is allowed for now.","enum":["done"]}},"required":["task_id","status"]}}}},"responses":{"200":{"description":"Status set","$ref":"#/components/responses/OK"},"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.

***

Updates a service work. Pass a full task object including its `id`. `completion` is not editable.

## Update service task

> Update a service work. Pass a full task object including its \`id\`.\
> \
> \`completion\` is not editable.

```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":{"ServiceTask":{"type":"object","description":"A service work scheduled against a vehicle.","properties":{"id":{"type":"integer","description":"ID of the service work. Omit when creating."},"vehicle_id":{"type":"integer","description":"ID of the associated vehicle."},"vehicle_label":{"type":"string","description":"Label of the associated vehicle."},"description":{"type":"string","description":"Name of the service work. Up to 255 characters.","maxLength":255},"comment":{"type":"string","description":"Comment. Up to 255 characters.","maxLength":255},"status":{"type":"string","description":"Current status. `created` is the initial state, `notified` means a condition passed its notification limit, `expired` means a condition was exceeded, `done` means the user marked it complete.","enum":["created","notified","expired","done"]},"repeat":{"type":"boolean","description":"If `true`, a new task is created when this one is done."},"unplanned":{"type":"boolean","description":"If `true`, the work is unplanned. For information only."},"cost":{"type":"number","description":"Cost in the currency of the user. For information only."},"completion_date":{"type":["string","null"],"description":"Date the service work was completed."},"start":{"type":"object","description":"Counter values when the task was created.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"completion":{"allOf":[{"type":"object","description":"Date and counter values when the task was marked done.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}}],"description":"**Not editable.**"},"current_position":{"type":"object","description":"Current counter values.","properties":{"mileage":{"type":"integer","description":"Mileage in kilometres."},"date":{"type":"string","description":"Date and time."},"engine_hours":{"type":"integer","description":"Engine hours."}}},"conditions":{"$ref":"#/components/schemas/ServiceTaskConditions"},"notifications":{"$ref":"#/components/schemas/ServiceTaskNotifications"},"file_ids":{"type":"array","description":"IDs of attached files. One file may be attached to several service works, so deleting one task does not delete a shared file.","items":{"type":"integer"}},"prediction":{"type":["object","null"],"description":"**Legacy, no longer used.** Controlled by the `return_prediction` parameter on the list and download operations.","properties":{"end_date":{"type":"string","description":"Predicted completion date."},"wear_percentage":{"type":"integer","description":"Predicted wear percentage."}}}}},"ServiceTaskConditions":{"type":"object","description":"When the service work falls due. **At least one of `mileage`, `date`, or `engine_hours` must be given.**","properties":{"mileage":{"type":"object","description":"Fall due at a mileage.","properties":{"limit":{"type":"integer","description":"Mileage limit in kilometres."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"date":{"type":"object","description":"Fall due on a date.","properties":{"end":{"type":"string","description":"Date and time the work falls due."},"notification_interval":{"type":"integer","description":"How many days before the date to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}},"engine_hours":{"type":"object","description":"Fall due at an engine-hours reading.","properties":{"limit":{"type":"integer","description":"Engine-hours limit."},"notification_interval":{"type":"integer","description":"How far before the limit to start notifying."},"repeat_interval":{"type":"integer","description":"Interval for the repeated task, when `repeat` is true."}}}}},"ServiceTaskNotifications":{"type":"object","description":"Where notifications about this service work are sent.","properties":{"sms_phones":{"type":"array","description":"Phone numbers to notify by SMS.","items":{"type":"string"}},"emails":{"type":"array","description":"Email addresses to notify.","items":{"type":"string"}},"push_enabled":{"type":"boolean","description":"Whether push notifications are sent."}}}},"responses":{"OK":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true}}}}}},"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/service_task/update":{"post":{"tags":["Vehicles"],"summary":"Update service task","description":"Update a service work. Pass a full task object including its `id`.\n\n`completion` is not editable.","operationId":"vehicleServiceTaskUpdate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task":{"allOf":[{"$ref":"#/components/schemas/ServiceTask"}],"description":"The service work to update, including its `id`."}},"required":["task"]}}}},"responses":{"200":{"description":"Service work updated","$ref":"#/components/responses/OK"},"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):

* 204, 214.

## More in this section

#### Service task file

| Endpoint                                                                                                                                            | Method | What it does             |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------ |
| [`/vehicle/service_task/file/create`](/docs/navixy-api/user-api/resources/fleet/vehicle/service-task/file.md#post-vehicle-service_task-file-create) | POST   | Create service task file |


---

# 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/service-task.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.
