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

# Route

A named, ordered set of checkpoints that must be visited in sequence.

A route is a named, ordered set of [checkpoints](/docs/navixy-api/user-api/resources/field-service/task/checkpoint.md#checkpoint-object), each of which is essentially a [task](/docs/navixy-api/user-api/resources/field-service/task.md) with a link back to the route.

Order is what separates a route from a set of separate tasks. A route completes only when every checkpoint has completed **and** they were visited in the specified sequence. Otherwise it completes with warnings, or fails.

## Route object

## The TaskRoute object

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"components":{"schemas":{"TaskRoute":{"type":"object","description":"A route: a named, ordered set of checkpoints. A route is complete when every checkpoint is complete and they were visited in order; otherwise it completes with warnings or fails.","properties":{"id":{"type":"integer","description":"Primary key. Used when updating; **ignored when creating**."},"user_id":{"type":"integer","description":"ID of the owning user. **Read-only.**","readOnly":true},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker this route is assigned to. **Ignored on update**; use `task/route/assign`.","minimum":1},"label":{"type":"string","description":"Name of the route. 1 to 200 characters, and not blank.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Description of the route. Up to 1024 characters. **Required**, but may be an empty string.","maxLength":1024},"creation_date":{"type":"string","description":"When the route was created. **Read-only.**","readOnly":true},"from":{"type":"string","description":"Date after which the first checkpoint zone must be visited. **Ignored on create and update**: it is taken from the first checkpoint."},"to":{"type":"string","description":"Date before which the last checkpoint zone must be visited. **Ignored on create and update**: it is taken from the last checkpoint."},"external_id":{"type":["string","null"],"description":"Free text tying this route to an external system. 1 to 100 characters.","minLength":1,"maxLength":100},"status":{"type":"string","description":"Current status. **Ignored on create and update.**","enum":["unassigned","assigned","done","failed","delayed","arrived","faulty"]},"status_change_date":{"type":"string","description":"When the status last changed. **Ignored on create and update.**"},"origin":{"type":"string","description":"How this route was created. **Ignored on create and update.**","enum":["manual","scheduled","imported"]},"tags":{"type":"array","description":"IDs of tags applied to the route.","items":{"type":"integer"}},"checkpoint_ids":{"type":"array","description":"IDs of the route checkpoints, in order of execution. **Ignored on create.** On update, reordering this array changes the order of execution.","items":{"type":"integer"}},"type":{"type":"string","description":"Always `route`.","enum":["route"]}}}}}}
```

## API actions

API base path: `/task/route`.

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

***

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

## Assign route

> Assign a route to a tracker, reassign it to a different one, or leave it unassigned.\
> \
> Pass \`tracker\_id\` as null, or leave it out, to unassign.\
> \
> Only a route in \`unassigned\` or \`assigned\` state can be changed. Anything else returns error 255.\
> \
> Also accepts GET with the same parameters as query-string values.\
> \
> Requires the \`task\_update\` right.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Field service tasks: the places to visit, the routes and checkpoints they group into, the history of every change, and the forms field employees fill in. All resources under the /task/ 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":{"/task/route/assign":{"post":{"tags":["Tasks"],"summary":"Assign route","description":"Assign a route to a tracker, reassign it to a different one, or leave it unassigned.\n\nPass `tracker_id` as null, or leave it out, to unassign.\n\nOnly a route in `unassigned` or `assigned` state can be changed. Anything else returns error 255.\n\nAlso accepts GET with the same parameters as query-string values.\n\nRequires the `task_update` right.","operationId":"taskRouteAssign","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"route_id":{"type":"integer","description":"ID of the route to assign.","minimum":1},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked. Null leaves the route assigned to no one.","minimum":1}},"required":["route_id"]}}}},"responses":{"200":{"description":"Route assigned","$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"},"402":{"description":"Error 236: the tracker's plan does not allow tasks.","$ref":"#/components/responses/ResponseError"},"403":{"description":"Error 208: the tracker exists but is blocked, normally because its tariff ended.","$ref":"#/components/responses/ResponseError"},"404":{"description":"Error 204: no tracker with this ID belongs to the authorized user.","$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 - if there is no task with such an ID.
* 204 - Entity not found - if there is no tracker with such ID belonging to authorized user.
* 208 - Device blocked - if tracker exists but was blocked due to tariff restrictions or some other reason.
* 255 - Invalid task state - if current task state is not "unassigned" or "assigned".
* 236 - Feature unavailable due to tariff restrictions - if device's tariff does not allow usage of tasks.

***

Give the checkpoints in order of execution. Their `from` and `to` must be agreed with each other, so a checkpoint's `to` cannot be before the `from` of a preceding one.

One of the checkpoints can have an ID, in which case it must be a task, and it will be transmuted from task to checkpoint.

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

## Create route

> Create a route together with its checkpoints, and return the created route.\
> \
> \*\*A route needs between 2 and 500 checkpoints.\*\* Sending one returns error 7 with "size must be between 2 and 500".\
> \
> Give the checkpoints in order of execution. Their windows must agree with each other: a checkpoint's \`to\` cannot be before the \`from\` of a preceding one. The route's own \`from\` and \`to\` are computed from the first and last checkpoint, which is why both are ignored on the route object.\
> \
> One checkpoint may carry an \`id\`, in which case it must be an existing \*\*task\*\*, and it is converted into a checkpoint of this route.\
> \
> \`external\_id\_counts\` reports each external ID that now has a count above zero. Different checkpoints may carry different external IDs, so several can come back. When there is nothing to report the field is absent.\
> \
> Requires the \`task\_update\` right.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Field service tasks: the places to visit, the routes and checkpoints they group into, the history of every change, and the forms field employees fill in. All resources under the /task/ 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":{"TaskRoute":{"type":"object","description":"A route: a named, ordered set of checkpoints. A route is complete when every checkpoint is complete and they were visited in order; otherwise it completes with warnings or fails.","properties":{"id":{"type":"integer","description":"Primary key. Used when updating; **ignored when creating**."},"user_id":{"type":"integer","description":"ID of the owning user. **Read-only.**","readOnly":true},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker this route is assigned to. **Ignored on update**; use `task/route/assign`.","minimum":1},"label":{"type":"string","description":"Name of the route. 1 to 200 characters, and not blank.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Description of the route. Up to 1024 characters. **Required**, but may be an empty string.","maxLength":1024},"creation_date":{"type":"string","description":"When the route was created. **Read-only.**","readOnly":true},"from":{"type":"string","description":"Date after which the first checkpoint zone must be visited. **Ignored on create and update**: it is taken from the first checkpoint."},"to":{"type":"string","description":"Date before which the last checkpoint zone must be visited. **Ignored on create and update**: it is taken from the last checkpoint."},"external_id":{"type":["string","null"],"description":"Free text tying this route to an external system. 1 to 100 characters.","minLength":1,"maxLength":100},"status":{"type":"string","description":"Current status. **Ignored on create and update.**","enum":["unassigned","assigned","done","failed","delayed","arrived","faulty"]},"status_change_date":{"type":"string","description":"When the status last changed. **Ignored on create and update.**"},"origin":{"type":"string","description":"How this route was created. **Ignored on create and update.**","enum":["manual","scheduled","imported"]},"tags":{"type":"array","description":"IDs of tags applied to the route.","items":{"type":"integer"}},"checkpoint_ids":{"type":"array","description":"IDs of the route checkpoints, in order of execution. **Ignored on create.** On update, reordering this array changes the order of execution.","items":{"type":"integer"}},"type":{"type":"string","description":"Always `route`.","enum":["route"]}}},"TaskCheckpoint":{"type":"object","description":"A checkpoint: one stop on a route. It carries every field a task does, plus its position in the route.\n\nA checkpoint inherits its performer from its route, so `tracker_id` is ignored on update.","properties":{"id":{"type":"integer","description":"Primary key. Used when updating; **ignored when creating**."},"user_id":{"type":"integer","description":"ID of the owning user, the office. **Read-only.**","readOnly":true},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker this checkpoint is assigned to. **Ignored on update**, where reassignment goes through a separate operation.","minimum":1},"location":{"type":"object","description":"The circular geofence for this checkpoint. Entering and leaving it are what the platform watches. Cannot be null.","properties":{"lat":{"type":"number","description":"Latitude."},"lng":{"type":"number","description":"Longitude."},"address":{"type":"string","description":"Address of the location. Set this to associate the task with an address."},"radius":{"type":"integer","description":"Radius of the zone in metres, from 1 to 300000.","minimum":1,"maximum":300000}}},"label":{"type":"string","description":"Name of the checkpoint. 1 to 200 characters, and not blank.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Description of the checkpoint. Up to 1024 characters. **Required**, but may be an empty string.","maxLength":1024},"creation_date":{"type":"string","description":"When the checkpoint was created. **Read-only.**","readOnly":true},"from":{"type":"string","description":"Date after which the zone must be visited."},"to":{"type":"string","description":"Date before which the zone must be visited. Required, and cannot be in the past."},"external_id":{"type":["string","null"],"description":"Free text tying this record to an external system, such as an order number. 1 to 100 characters. For reference only.","minLength":1,"maxLength":100},"status":{"type":"string","description":"Current status. **Ignored on create and update.** `arrived` means the performer reached the geofence without completing the checkpoint, and `faulty` means it completed with problems.","enum":["unassigned","assigned","done","failed","delayed","arrived","faulty"]},"status_change_date":{"type":"string","description":"When the status last changed. **Ignored on create and update.**"},"max_delay":{"type":"integer","description":"Maximum allowed completion delay, in minutes. Default 0, up to 512000.","minimum":0,"maximum":512000},"min_stay_duration":{"type":"integer","description":"Minimum time that must be spent inside the zone for completion, in minutes. Default 0, up to 512000.","minimum":0,"maximum":512000},"min_arrival_duration":{"type":"integer","description":"Visits shorter than this do not count as an arrival, in minutes. Default 0, up to 512000. Not listed in the published object description.","minimum":0,"maximum":512000},"arrival_date":{"type":["string","null"],"description":"When the tracker reached the zone, or null if it has not. **Read-only.**","readOnly":true},"stay_duration":{"type":"integer","description":"Seconds spent inside the zone. **Read-only.**","readOnly":true},"origin":{"type":"string","description":"How this record was created. **Ignored on create and update.** `imported` means it came from a spreadsheet.","enum":["manual","scheduled","imported"]},"tags":{"type":"array","description":"IDs of tags applied to this record.","items":{"type":"integer"}},"type":{"type":"string","description":"Which kind of record this is.","enum":["task","checkpoint","route"]},"form":{"allOf":[{"$ref":"#/components/schemas/Form"}],"description":"The attached form, when there is one."},"form_template_id":{"type":"integer","description":"ID of a form template. Read on create and update **only when `create_form` is `true`**."},"fields":{"type":"object","description":"Custom field values. Each key is a custom field ID **as a string**, and each value carries the field `type` and its `value`.","additionalProperties":true},"files":{"type":"array","description":"Files associated with this record. **Read-only**, and not listed in the published object description.","items":{"type":"object","additionalProperties":true},"readOnly":true},"parent_id":{"type":"integer","description":"ID of the route this checkpoint belongs to.","minimum":1},"order":{"type":"integer","description":"Zero-based position of this checkpoint within its route.","minimum":0}}},"Form":{"type":"object","description":"A filled-in or fillable form. A form is created from a template and used once: after submission it is kept with its values for reference and cannot be reused.","properties":{"id":{"type":"integer","description":"Form ID."},"label":{"type":"string","description":"Form label, 1 to 100 characters.","minLength":1,"maxLength":100},"description":{"type":"string","description":"Form description. May be empty."},"fields":{"type":"array","description":"The form fields. See the form fields and values reference for the shape of each type.","items":{"type":"object","additionalProperties":true}},"created":{"type":"string","description":"When this form was created, or attached to its task. **Read-only.**","readOnly":true},"submit_in_zone":{"type":"boolean","description":"When `true`, the form can only be submitted inside the task zone."},"task_id":{"type":["integer","null"],"description":"ID of the task this form is attached to."},"checkin_id":{"type":["integer","null"],"description":"ID of the check-in this form belongs to, when it came from one."},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker involved."},"template_id":{"type":["integer","null"],"description":"ID of the template this form was built from. **Null when that template has been deleted.**"},"template_version":{"type":["integer","null"],"description":"Version of the template at the time this form was created."},"values":{"type":["object","null"],"description":"The submitted values, keyed by field ID. **Null when the form has not been filled in.** See the form fields and values reference.","additionalProperties":true},"submitted":{"type":["string","null"],"description":"When the values were last submitted."},"submit_location":{"type":["object","null"],"description":"Where the values were last submitted.","properties":{"lat":{"type":"number","description":"Latitude."},"lng":{"type":"number","description":"Longitude."},"address":{"type":"string","description":"Address at that point."}}}}},"ExternalIdCounts":{"type":"array","description":"How many records share each `external_id` involved in this call, so a caller can spot a duplicate. Present only when the record carries an `external_id`.","items":{"type":"object","properties":{"external_id":{"type":"string","description":"The external ID."},"count":{"type":"integer","description":"How many records now carry 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":{"/task/route/create":{"post":{"tags":["Tasks"],"summary":"Create route","description":"Create a route together with its checkpoints, and return the created route.\n\n**A route needs between 2 and 500 checkpoints.** Sending one returns error 7 with \"size must be between 2 and 500\".\n\nGive the checkpoints in order of execution. Their windows must agree with each other: a checkpoint's `to` cannot be before the `from` of a preceding one. The route's own `from` and `to` are computed from the first and last checkpoint, which is why both are ignored on the route object.\n\nOne checkpoint may carry an `id`, in which case it must be an existing **task**, and it is converted into a checkpoint of this route.\n\n`external_id_counts` reports each external ID that now has a count above zero. Different checkpoints may carry different external IDs, so several can come back. When there is nothing to report the field is absent.\n\nRequires the `task_update` right.","operationId":"taskRouteCreate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"route":{"allOf":[{"$ref":"#/components/schemas/TaskRoute"}],"description":"The route to create. Read-only fields are ignored, as are `from`, `to` and `checkpoint_ids`."},"checkpoints":{"type":"array","description":"The checkpoints, in order of execution. Between 2 and 500.","items":{"$ref":"#/components/schemas/TaskCheckpoint"},"minItems":2,"maxItems":500},"create_form":{"type":"boolean","description":"Optional. Default `false`, for backward compatibility. When `true`, the `form_template_id` inside each checkpoint is read and a form is created from that template."}},"required":["route","checkpoints"]}}}},"responses":{"200":{"description":"The created route","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"result":{"$ref":"#/components/schemas/TaskRoute"},"external_id_counts":{"$ref":"#/components/schemas/ExternalIdCounts"}}}}}},"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 236: the tracker's plan does not allow tasks.","$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 - if task.tracker\_id is not null and belongs to nonexistent tracker.
* 236 - Feature unavailable due to tariff restrictions - if device's tariff does not allow usage of tasks.

***

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

## Delete route

> Delete a route \*\*and all of its checkpoints\*\* by ID.\
> \
> Also accepts GET with the same parameters as query-string values.\
> \
> Requires the \`task\_update\` right.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Field service tasks: the places to visit, the routes and checkpoints they group into, the history of every change, and the forms field employees fill in. All resources under the /task/ 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":{"/task/route/delete":{"post":{"tags":["Tasks"],"summary":"Delete route","description":"Delete a route **and all of its checkpoints** by ID.\n\nAlso accepts GET with the same parameters as query-string values.\n\nRequires the `task_update` right.","operationId":"taskRouteDelete","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"route_id":{"type":"integer","description":"ID of the route to delete.","minimum":1}},"required":["route_id"]}}}},"responses":{"200":{"description":"Route 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"}}}}}}
```

#### 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 - if there is no route with such an ID.

***

## List routes

> List the routes of the current user, with optional filtering.\
> \
> A parameter left out or set to null is simply not used as a filter.\
> \
> Callable with an empty body. Also accepts GET with the same parameters as query-string values.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Field service tasks: the places to visit, the routes and checkpoints they group into, the history of every change, and the forms field employees fill in. All resources under the /task/ 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":{"TaskRoute":{"type":"object","description":"A route: a named, ordered set of checkpoints. A route is complete when every checkpoint is complete and they were visited in order; otherwise it completes with warnings or fails.","properties":{"id":{"type":"integer","description":"Primary key. Used when updating; **ignored when creating**."},"user_id":{"type":"integer","description":"ID of the owning user. **Read-only.**","readOnly":true},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker this route is assigned to. **Ignored on update**; use `task/route/assign`.","minimum":1},"label":{"type":"string","description":"Name of the route. 1 to 200 characters, and not blank.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Description of the route. Up to 1024 characters. **Required**, but may be an empty string.","maxLength":1024},"creation_date":{"type":"string","description":"When the route was created. **Read-only.**","readOnly":true},"from":{"type":"string","description":"Date after which the first checkpoint zone must be visited. **Ignored on create and update**: it is taken from the first checkpoint."},"to":{"type":"string","description":"Date before which the last checkpoint zone must be visited. **Ignored on create and update**: it is taken from the last checkpoint."},"external_id":{"type":["string","null"],"description":"Free text tying this route to an external system. 1 to 100 characters.","minLength":1,"maxLength":100},"status":{"type":"string","description":"Current status. **Ignored on create and update.**","enum":["unassigned","assigned","done","failed","delayed","arrived","faulty"]},"status_change_date":{"type":"string","description":"When the status last changed. **Ignored on create and update.**"},"origin":{"type":"string","description":"How this route was created. **Ignored on create and update.**","enum":["manual","scheduled","imported"]},"tags":{"type":"array","description":"IDs of tags applied to the route.","items":{"type":"integer"}},"checkpoint_ids":{"type":"array","description":"IDs of the route checkpoints, in order of execution. **Ignored on create.** On update, reordering this array changes the order of execution.","items":{"type":"integer"}},"type":{"type":"string","description":"Always `route`.","enum":["route"]}}}},"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":{"/task/route/list":{"post":{"tags":["Tasks"],"summary":"List routes","description":"List the routes of the current user, with optional filtering.\n\nA parameter left out or set to null is simply not used as a filter.\n\nCallable with an empty body. Also accepts GET with the same parameters as query-string values.","operationId":"taskRouteList","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"statuses":{"type":"array","description":"Optional. Default all. Restrict to these route statuses.","items":{"type":"string","enum":["unassigned","assigned","done","failed","delayed","arrived","faulty"]},"minItems":1},"trackers":{"type":"array","description":"Optional. IDs of the trackers the routes are assigned to.","items":{"type":"integer"}},"from":{"type":"string","description":"Optional. Include routes that are actual after this date."},"to":{"type":"string","description":"Optional. Include routes that are actual before this date."},"filter":{"type":"string","description":"Optional. Filter over route label and description, up to 100 characters.","maxLength":100}}}}}},"responses":{"200":{"description":"Matching routes","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/TaskRoute"}},"count":{"type":"integer","description":"Total number of routes found."}}}}}},"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"}}}}}}
```

***

## Read route

> Return one route by ID.\
> \
> Also accepts GET with the same parameters as query-string values.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Field service tasks: the places to visit, the routes and checkpoints they group into, the history of every change, and the forms field employees fill in. All resources under the /task/ 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":{"TaskRoute":{"type":"object","description":"A route: a named, ordered set of checkpoints. A route is complete when every checkpoint is complete and they were visited in order; otherwise it completes with warnings or fails.","properties":{"id":{"type":"integer","description":"Primary key. Used when updating; **ignored when creating**."},"user_id":{"type":"integer","description":"ID of the owning user. **Read-only.**","readOnly":true},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker this route is assigned to. **Ignored on update**; use `task/route/assign`.","minimum":1},"label":{"type":"string","description":"Name of the route. 1 to 200 characters, and not blank.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Description of the route. Up to 1024 characters. **Required**, but may be an empty string.","maxLength":1024},"creation_date":{"type":"string","description":"When the route was created. **Read-only.**","readOnly":true},"from":{"type":"string","description":"Date after which the first checkpoint zone must be visited. **Ignored on create and update**: it is taken from the first checkpoint."},"to":{"type":"string","description":"Date before which the last checkpoint zone must be visited. **Ignored on create and update**: it is taken from the last checkpoint."},"external_id":{"type":["string","null"],"description":"Free text tying this route to an external system. 1 to 100 characters.","minLength":1,"maxLength":100},"status":{"type":"string","description":"Current status. **Ignored on create and update.**","enum":["unassigned","assigned","done","failed","delayed","arrived","faulty"]},"status_change_date":{"type":"string","description":"When the status last changed. **Ignored on create and update.**"},"origin":{"type":"string","description":"How this route was created. **Ignored on create and update.**","enum":["manual","scheduled","imported"]},"tags":{"type":"array","description":"IDs of tags applied to the route.","items":{"type":"integer"}},"checkpoint_ids":{"type":"array","description":"IDs of the route checkpoints, in order of execution. **Ignored on create.** On update, reordering this array changes the order of execution.","items":{"type":"integer"}},"type":{"type":"string","description":"Always `route`.","enum":["route"]}}}},"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":{"/task/route/read":{"post":{"tags":["Tasks"],"summary":"Read route","description":"Return one route by ID.\n\nAlso accepts GET with the same parameters as query-string values.","operationId":"taskRouteRead","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"route_id":{"type":"integer","description":"ID of the route.","minimum":1}},"required":["route_id"]}}}},"responses":{"200":{"description":"The route","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"value":{"$ref":"#/components/schemas/TaskRoute"}}}}}},"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 - if there is no route with such an ID.

***

Note that you cannot change task owner using this method. Reordering checkpoint IDs in the `checkpoint_ids` array changes order of execution.

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

## Update route

> Update a route and its checkpoints, and return the updated route.\
> \
> Reordering the IDs in \`checkpoint\_ids\` changes the order of execution. The route owner cannot be changed.\
> \
> \*\*Checkpoints not included in the request are deleted.\*\* A checkpoint carrying an \`id\` is updated, one without an \`id\` is created. \`checkpoints\` should be null when the route's \`checkpoint\_ids\` is null, and not null otherwise.\
> \
> Only a route in \`unassigned\` or \`assigned\` state can be changed. Anything else returns error 255.\
> \
> Requires the \`task\_update\` right.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Tasks","description":"Field service tasks: the places to visit, the routes and checkpoints they group into, the history of every change, and the forms field employees fill in. All resources under the /task/ 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":{"TaskRoute":{"type":"object","description":"A route: a named, ordered set of checkpoints. A route is complete when every checkpoint is complete and they were visited in order; otherwise it completes with warnings or fails.","properties":{"id":{"type":"integer","description":"Primary key. Used when updating; **ignored when creating**."},"user_id":{"type":"integer","description":"ID of the owning user. **Read-only.**","readOnly":true},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker this route is assigned to. **Ignored on update**; use `task/route/assign`.","minimum":1},"label":{"type":"string","description":"Name of the route. 1 to 200 characters, and not blank.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Description of the route. Up to 1024 characters. **Required**, but may be an empty string.","maxLength":1024},"creation_date":{"type":"string","description":"When the route was created. **Read-only.**","readOnly":true},"from":{"type":"string","description":"Date after which the first checkpoint zone must be visited. **Ignored on create and update**: it is taken from the first checkpoint."},"to":{"type":"string","description":"Date before which the last checkpoint zone must be visited. **Ignored on create and update**: it is taken from the last checkpoint."},"external_id":{"type":["string","null"],"description":"Free text tying this route to an external system. 1 to 100 characters.","minLength":1,"maxLength":100},"status":{"type":"string","description":"Current status. **Ignored on create and update.**","enum":["unassigned","assigned","done","failed","delayed","arrived","faulty"]},"status_change_date":{"type":"string","description":"When the status last changed. **Ignored on create and update.**"},"origin":{"type":"string","description":"How this route was created. **Ignored on create and update.**","enum":["manual","scheduled","imported"]},"tags":{"type":"array","description":"IDs of tags applied to the route.","items":{"type":"integer"}},"checkpoint_ids":{"type":"array","description":"IDs of the route checkpoints, in order of execution. **Ignored on create.** On update, reordering this array changes the order of execution.","items":{"type":"integer"}},"type":{"type":"string","description":"Always `route`.","enum":["route"]}}},"TaskCheckpoint":{"type":"object","description":"A checkpoint: one stop on a route. It carries every field a task does, plus its position in the route.\n\nA checkpoint inherits its performer from its route, so `tracker_id` is ignored on update.","properties":{"id":{"type":"integer","description":"Primary key. Used when updating; **ignored when creating**."},"user_id":{"type":"integer","description":"ID of the owning user, the office. **Read-only.**","readOnly":true},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker this checkpoint is assigned to. **Ignored on update**, where reassignment goes through a separate operation.","minimum":1},"location":{"type":"object","description":"The circular geofence for this checkpoint. Entering and leaving it are what the platform watches. Cannot be null.","properties":{"lat":{"type":"number","description":"Latitude."},"lng":{"type":"number","description":"Longitude."},"address":{"type":"string","description":"Address of the location. Set this to associate the task with an address."},"radius":{"type":"integer","description":"Radius of the zone in metres, from 1 to 300000.","minimum":1,"maximum":300000}}},"label":{"type":"string","description":"Name of the checkpoint. 1 to 200 characters, and not blank.","minLength":1,"maxLength":200},"description":{"type":"string","description":"Description of the checkpoint. Up to 1024 characters. **Required**, but may be an empty string.","maxLength":1024},"creation_date":{"type":"string","description":"When the checkpoint was created. **Read-only.**","readOnly":true},"from":{"type":"string","description":"Date after which the zone must be visited."},"to":{"type":"string","description":"Date before which the zone must be visited. Required, and cannot be in the past."},"external_id":{"type":["string","null"],"description":"Free text tying this record to an external system, such as an order number. 1 to 100 characters. For reference only.","minLength":1,"maxLength":100},"status":{"type":"string","description":"Current status. **Ignored on create and update.** `arrived` means the performer reached the geofence without completing the checkpoint, and `faulty` means it completed with problems.","enum":["unassigned","assigned","done","failed","delayed","arrived","faulty"]},"status_change_date":{"type":"string","description":"When the status last changed. **Ignored on create and update.**"},"max_delay":{"type":"integer","description":"Maximum allowed completion delay, in minutes. Default 0, up to 512000.","minimum":0,"maximum":512000},"min_stay_duration":{"type":"integer","description":"Minimum time that must be spent inside the zone for completion, in minutes. Default 0, up to 512000.","minimum":0,"maximum":512000},"min_arrival_duration":{"type":"integer","description":"Visits shorter than this do not count as an arrival, in minutes. Default 0, up to 512000. Not listed in the published object description.","minimum":0,"maximum":512000},"arrival_date":{"type":["string","null"],"description":"When the tracker reached the zone, or null if it has not. **Read-only.**","readOnly":true},"stay_duration":{"type":"integer","description":"Seconds spent inside the zone. **Read-only.**","readOnly":true},"origin":{"type":"string","description":"How this record was created. **Ignored on create and update.** `imported` means it came from a spreadsheet.","enum":["manual","scheduled","imported"]},"tags":{"type":"array","description":"IDs of tags applied to this record.","items":{"type":"integer"}},"type":{"type":"string","description":"Which kind of record this is.","enum":["task","checkpoint","route"]},"form":{"allOf":[{"$ref":"#/components/schemas/Form"}],"description":"The attached form, when there is one."},"form_template_id":{"type":"integer","description":"ID of a form template. Read on create and update **only when `create_form` is `true`**."},"fields":{"type":"object","description":"Custom field values. Each key is a custom field ID **as a string**, and each value carries the field `type` and its `value`.","additionalProperties":true},"files":{"type":"array","description":"Files associated with this record. **Read-only**, and not listed in the published object description.","items":{"type":"object","additionalProperties":true},"readOnly":true},"parent_id":{"type":"integer","description":"ID of the route this checkpoint belongs to.","minimum":1},"order":{"type":"integer","description":"Zero-based position of this checkpoint within its route.","minimum":0}}},"Form":{"type":"object","description":"A filled-in or fillable form. A form is created from a template and used once: after submission it is kept with its values for reference and cannot be reused.","properties":{"id":{"type":"integer","description":"Form ID."},"label":{"type":"string","description":"Form label, 1 to 100 characters.","minLength":1,"maxLength":100},"description":{"type":"string","description":"Form description. May be empty."},"fields":{"type":"array","description":"The form fields. See the form fields and values reference for the shape of each type.","items":{"type":"object","additionalProperties":true}},"created":{"type":"string","description":"When this form was created, or attached to its task. **Read-only.**","readOnly":true},"submit_in_zone":{"type":"boolean","description":"When `true`, the form can only be submitted inside the task zone."},"task_id":{"type":["integer","null"],"description":"ID of the task this form is attached to."},"checkin_id":{"type":["integer","null"],"description":"ID of the check-in this form belongs to, when it came from one."},"tracker_id":{"type":["integer","null"],"description":"ID of the tracker involved."},"template_id":{"type":["integer","null"],"description":"ID of the template this form was built from. **Null when that template has been deleted.**"},"template_version":{"type":["integer","null"],"description":"Version of the template at the time this form was created."},"values":{"type":["object","null"],"description":"The submitted values, keyed by field ID. **Null when the form has not been filled in.** See the form fields and values reference.","additionalProperties":true},"submitted":{"type":["string","null"],"description":"When the values were last submitted."},"submit_location":{"type":["object","null"],"description":"Where the values were last submitted.","properties":{"lat":{"type":"number","description":"Latitude."},"lng":{"type":"number","description":"Longitude."},"address":{"type":"string","description":"Address at that point."}}}}}},"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":{"/task/route/update":{"post":{"tags":["Tasks"],"summary":"Update route","description":"Update a route and its checkpoints, and return the updated route.\n\nReordering the IDs in `checkpoint_ids` changes the order of execution. The route owner cannot be changed.\n\n**Checkpoints not included in the request are deleted.** A checkpoint carrying an `id` is updated, one without an `id` is created. `checkpoints` should be null when the route's `checkpoint_ids` is null, and not null otherwise.\n\nOnly a route in `unassigned` or `assigned` state can be changed. Anything else returns error 255.\n\nRequires the `task_update` right.","operationId":"taskRouteUpdate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"route":{"allOf":[{"$ref":"#/components/schemas/TaskRoute"}],"description":"The route to update, including its `id`. Read-only fields and `tracker_id` are ignored."},"checkpoints":{"type":"array","description":"The checkpoints this route should end up with, in order. Anything absent is deleted.","items":{"$ref":"#/components/schemas/TaskCheckpoint"}},"create_form":{"type":"boolean","description":"Optional. Default `false`, for backward compatibility. When `true`, the `form_template_id` inside each checkpoint is read and that checkpoint's form is created, replaced or deleted to match it."}},"required":["route"]}}}},"responses":{"200":{"description":"The updated route","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"result":{"$ref":"#/components/schemas/TaskRoute"}}}}}},"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 - if there is no task with such an ID.
* 255 - Invalid task state - if current task state is not "unassigned" or "assigned".

## More in this section

#### Route optimization

| Endpoint                                                                                                                                  | Method | What it does          |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------- |
| [`/task/route/points/optimize`](/docs/navixy-api/user-api/resources/field-service/task/route/optimize.md#post-task-route-points-optimize) | POST   | Optimize route points |


---

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