Routes
Read Routes
Returns all routes, including route points and route coordinates.
Endpoint
GET
/routes
When to Use
Use this endpoint when rendering route overlays, route setup forms, or route reference data.
Authentication
This endpoint requires an API key. Send either x-api-key: <api_key> or Authorization: Bearer <api_key>.
Requests are rate-limited per organization.
Example Request
curl --request GET \
--url https://api.jitra.app/public/v1/routes \
--header 'x-api-key: <api_key>'
Example Response
Successful response (200 OK):
{
"statusCode": 200,
"result": [
{
"id": 9,
"name": "Distribution Route A",
"description": "Primary city route",
"color": "#FF6600",
"deviation": 50,
"points": [
{
"location": [106.8, -6.2],
"order": 1
},
{
"location": [106.81, -6.21],
"order": 2
}
],
"coordinates": [
[
[
[106.8, -6.2],
[106.81, -6.21]
]
]
],
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-10T00:00:00.000Z"
}
]
}
Response Fields
All fields below are taken from each object inside result.
| Field | Type | Description |
|---|---|---|
id | number | Route ID. |
name | string | Route name. |
description | string | Route description. |
color | string | Display color (hex or configured color value). |
deviation | number | Allowed route deviation threshold. |
points | array of object | Route points. |
points[].location | array of number | Point location as [longitude, latitude]. |
points[].order | number or string | Point sequence order. |
coordinates | nested array of coordinate pairs | Route geometry coordinates. |
created_at | string (ISO 8601 datetime) | Record creation timestamp. |
updated_at | string (ISO 8601 datetime) | Last update timestamp. |
Error Responses
Main Error Responses
| HTTP Status | Example errorCode | When It Happens |
|---|---|---|
| 401 | ERR999 | API key is missing, invalid, or expired. |
| 400 | PUBLIC.400_xxx | The request format or parameter values are invalid. |
Other Error Responses
| HTTP Status | errorCode | When It Happens |
|---|---|---|
| 429 | ERR999 | Too many requests for the current organization throttle window. |
Notes
coordinates shape is multi-level geometry data and is returned as stored by the service.