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.

FieldTypeDescription
idnumberRoute ID.
namestringRoute name.
descriptionstringRoute description.
colorstringDisplay color (hex or configured color value).
deviationnumberAllowed route deviation threshold.
pointsarray of objectRoute points.
points[].locationarray of numberPoint location as [longitude, latitude].
points[].ordernumber or stringPoint sequence order.
coordinatesnested array of coordinate pairsRoute geometry coordinates.
created_atstring (ISO 8601 datetime)Record creation timestamp.
updated_atstring (ISO 8601 datetime)Last update timestamp.

Error Responses

Main Error Responses

HTTP StatusExample errorCodeWhen It Happens
401ERR999API key is missing, invalid, or expired.
400PUBLIC.400_xxxThe request format or parameter values are invalid.

Other Error Responses

HTTP StatuserrorCodeWhen It Happens
429ERR999Too many requests for the current organization throttle window.

Notes

coordinates shape is multi-level geometry data and is returned as stored by the service.