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

# Route with OSRM

Build a driving route with OSRM, and read back OSRM's own failure detail.

This is [`route/get`](/docs/navixy-api/user-api/resources/tracking/route.md#post-route-get) with the provider pinned to the [OSRM API](https://github.com/Project-OSRM/osrm-backend/wiki/Server-api#requesting-routes). Use it when the route must come from OSRM regardless of the account's default provider.

What differs from the generic operation is the failure detail. Each entry in the `errors` array carries OSRM's own status alongside the Navixy platform error code.

## API actions

API base path: `/route/osrm`.

***

## Get route with OSRM

> Return a route calculated by OSRM. Identical to \`route/get\` with \`provider\_type\` pinned to \`osrm\`; a \`provider\_type\` sent here is ignored.\
> \
> Requires the \`routing\` tariff feature on \*\*every\*\* tracker on the account. Without it the call returns error 236.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Routes","description":"Routing between points, using the account's default provider or a named one. All resources under the /route/ 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":{"RoutePoint":{"type":"object","description":"A geographic point on a route.","properties":{"lat":{"type":"number","description":"Latitude."},"lng":{"type":"number","description":"Longitude."}},"required":["lat","lng"]},"RouteKeyPoint":{"type":"object","description":"One of the points the caller asked for, located within the returned route.","properties":{"id":{"type":"integer","description":"Index of this point within the route's `list`."},"lat":{"type":"number","description":"Latitude."},"lng":{"type":"number","description":"Longitude."},"distance":{"type":"integer","description":"Length of the route from the start up to this point, in metres. 0 at the start."},"time":{"type":"integer","description":"Duration of the route from the start up to this point, in seconds. 0 at the start."}}}},"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":{"/route/osrm/get":{"post":{"tags":["Routes"],"summary":"Get route with OSRM","description":"Return a route calculated by OSRM. Identical to `route/get` with `provider_type` pinned to `osrm`; a `provider_type` sent here is ignored.\n\nRequires the `routing` tariff feature on **every** tracker on the account. Without it the call returns error 236.","operationId":"routeOsrmGet","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"$ref":"#/components/schemas/RoutePoint"},"end":{"$ref":"#/components/schemas/RoutePoint"},"waypoints":{"type":"array","description":"Optional. Intermediate points, visited in the order given unless the provider reorders them. **At most 98**, since start and end count towards the provider's hundred-point limit.","items":{"$ref":"#/components/schemas/RoutePoint"},"maxItems":98},"point_limit":{"type":"integer","description":"Optional. Simplify the returned route to at most this many points.","minimum":2}},"required":["start","end"]}}}},"responses":{"200":{"description":"The route","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"distance":{"type":"integer","description":"Total length in metres."},"time":{"type":"integer","description":"Total duration in seconds."},"list":{"type":"array","description":"The route as an ordered list of points.","items":{"$ref":"#/components/schemas/RoutePoint"}},"key_points":{"type":"array","description":"The start, each waypoint and the end, in that order, located within `list`. Each entry carries the cumulative `distance` and `time` from the start.","items":{"$ref":"#/components/schemas/RouteKeyPoint"}}}}}}},"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: at least one tracker on the account lacks the `routing` tariff feature.","$ref":"#/components/responses/ResponseError"},"403":{"description":"Error 215: the OSRM service failed. Error 218: OSRM rejected the parameters. The `errors` array holds objects with `status`, either `NOT_FOUND` when a point could not be matched or no route exists, or `UNKNOWN_ERROR`; plus `status_code` and `message` passed through from OSRM, neither of which should be relied on.","$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):

* 215 - External service error.
* 218 - Malformed external service parameters. Each entry in the `errors` array carries `status`, either `NOT_FOUND`, when at least one of the origin, destination, or waypoint locations could not be geocoded or OSRM cannot find a route, or `UNKNOWN_ERROR`, for an unexpected OSRM code. The entry also carries `status_code`, the OSRM status code, and `message`, the OSRM error message. Don't rely on those last two.
* 236 - Feature unavailable due to tariff restrictions, when at least one tracker in the request has no `routing` tariff feature.

An error response looks like this:

```json
{
  "success": false,
  "status": {
    "code": 218,
    "description": "Malformed external service parameters"
  },
  "errors": [
    {
      "status": "NOT_FOUND",
      "status_code": 207,
      "message": "Cannot find route between 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://navixy.com/docs/navixy-api/user-api/resources/tracking/route/route_osrm.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
