Routing and optimization

Route calculation, travel-time matrices and route proposals to approve.

Calculate a route

POSThttps://api.drometra.com/v1/routing/routes

Requires the access token of a person in your company.

Headers

x-tenant-idmandatorystring · uuid
Your company's identifier. The server checks that you are still an active member of it.

Body

profilemandatoryenum: car | truck | bicycle | pedestrian
coordinatesmandatoryarray de object
vehicleobject

Response · 200

  • profileenum: car | truck | bicycle | pedestrianalways
  • array de objectalways
  • objectalways
  • distanceMetersintegeralways
  • durationSecondsintegeralways
  • estimatedbooleanalways
  • trafficIncludedbooleanalways
  • objectalways
  • ferryMetersinteger

It can respond with error 400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503. The error body is explained in Concepts.

request
curl -X POST "https://api.drometra.com/v1/routing/routes" \
  -H "Authorization: Bearer $DROMETRA _ TOKEN"\
  -H "x-tenant-id: $DROMETRA_TENANT" \
  -H "Content-Type: application/json" \ -d '{
    "profile": "…",
    "coordinates": []
  }'
response · 200
{
  "profile": "car",
  "waypoints": [
    {
      "latitude": 0,
      "longitude": 0
    }
  ],
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [
        null
      ]
    ]
  },
  "distanceMeters": 0,
  "durationSeconds": 0,
  "estimated": true,
  "trafficIncluded": false,
  "provenance": {
    "kind": "valhalla",
    "engine": "…",
    "engineVersion": "…",
    "graphVersion": "…",
    "coverage": {
      "id": "…",
      "status": "covered"
    },
    "roadNetwork": true
  },
  "ferryMeters": 0
}

Calculate a travel-time matrix

POSThttps://api.drometra.com/v1/routing/matrices

Requires the access token of a person in your company.

Headers

x-tenant-idmandatorystring · uuid
Your company's identifier. The server checks that you are still an active member of it.

Body

profilemandatoryenum: car | truck | bicycle | pedestrian
coordinatesmandatoryarray de object
vehicleobject

Response · 200

  • profileenum: car | truck | bicycle | pedestrianalways
  • pointCountintegeralways
  • distancesMetersarray de array de integer o nullalways
  • durationsSecondsarray de array de integer o nullalways
  • estimatedbooleanalways
  • trafficIncludedbooleanalways
  • objectalways

It can respond with error 400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503. The error body is explained in Concepts.

request
curl -X POST "https://api.drometra.com/v1/routing/matrices" \
  -H "Authorization: Bearer $DROMETRA _ TOKEN"\
  -H "x-tenant-id: $DROMETRA_TENANT" \
  -H "Content-Type: application/json" \ -d '{
    "profile": "…",
    "coordinates": []
  }'
response · 200
{
  "profile": "car",
  "pointCount": 27,
  "distancesMeters": [
    [
      0
    ]
  ],
  "durationsSeconds": [
    [
      0
    ]
  ],
  "estimated": true,
  "trafficIncluded": false,
  "provenance": {
    "kind": "valhalla",
    "engine": "…",
    "engineVersion": "…",
    "graphVersion": "…",
    "coverage": {
      "id": "…",
      "status": "covered"
    },
    "roadNetwork": true
  }
}

Propose optimized routes

POSThttps://api.drometra.com/v1/routing/optimization-previews

Requires the access token of a person in your company.

Headers

x-tenant-idmandatorystring · uuid
Your company's identifier. The server checks that you are still an active member of it.
idempotency-keymandatorystring · uuid
A new UUID per operation. If you repeat the request with the same key, the change is not applied twice.

Body

profilemandatoryenum: car | truck | bicycle | pedestrian
depotmandatoryobject
vehiclesmandatoryarray de object
stopsmandatoryarray de object
maxComputationMsinteger
vehicleobject

Response · 201

  • idstring · uuidalways
  • tenantIdstring · uuidalways
  • stateenum: ready | approvedalways
  • versionintegeralways
  • profileenum: car | truck | bicycle | pedestrianalways
  • objectalways
  • array de objectalways
  • objectalways
  • objectalways
  • createdAtstring · date-timealways
  • approvedAtstring · date-time o nullalways
  • routePlanIdstring · uuid o nullalways

It can respond with error 400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503. The error body is explained in Concepts.

request
curl -X POST "https://api.drometra.com/v1/routing/optimization-previews" \
  -H "Authorization: Bearer $DROMETRA _ TOKEN"\
  -H "x-tenant-id: $DROMETRA_TENANT" \
  -H "idempotency-key: $(uuidgen)" \
  -H "Content-Type: application/json" \ -d '{
    "profile": "…",
    "depot": {},
    "vehicles": [],
    "stops": []
  }'
response · 201
{
  "id": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "tenantId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "state": "ready",
  "version": 1,
  "profile": "car",
  "solution": {
    "feasible": true,
    "timedOut": true,
    "optimal": false,
    "routes": [
      {
        "vehicleId": "…",
        "fleetVehicleId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
        "orderedStops": [],
        "distanceMeters": 0,
        "durationSeconds": 0
      }
    ],
    "unassigned": [
      {
        "id": "…",
        "reason": "capacity_exceeded"
      }
    ],
    "totalDistanceMeters": 0,
    "totalDurationSeconds": 0,
    "baselineDistanceMeters": 0,
    "improvementMeters": 0
  },
  "roadRoutes": [
    {
      "vehicleId": "…",
      "fleetVehicleId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
      "route": {
        "profile": "car",
        "waypoints": [],
        "geometry": {
          "type": "LineString",
          "coordinates": []
        },
        "distanceMeters": 0,
        "durationSeconds": 0,
        "estimated": true,
        "trafficIncluded": false,
        "provenance": {
          "kind": "valhalla",
          "engine": "…",
          "engineVersion": "…",
          "graphVersion": "…",
          "coverage": {},
          "roadNetwork": true
        },
        "ferryMeters": 0
      }
    }
  ],
  "matrixProvenance": {
    "kind": "valhalla",
    "engine": "…",
    "engineVersion": "…",
    "graphVersion": "…",
    "coverage": {
      "id": "…",
      "status": "covered"
    },
    "roadNetwork": true
  },
  "solver": {
    "name": "…",
    "maxComputationMs": 1000.5,
    "optimal": false
  },
  "createdAt": "2026-10-21T14:02:31Z",
  "approvedAt": "2026-10-21T14:02:31Z",
  "routePlanId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d"
}

Get a route proposal

GEThttps://api.drometra.com/v1/routing/optimization-previews/{id}

Requires the access token of a person in your company.

Headers

x-tenant-idmandatorystring · uuid
Your company's identifier. The server checks that you are still an active member of it.

Road parameters

idmandatorystring · uuid
e. g. 0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d

Response · 200

  • idstring · uuidalways
  • tenantIdstring · uuidalways
  • stateenum: ready | approvedalways
  • versionintegeralways
  • profileenum: car | truck | bicycle | pedestrianalways
  • objectalways
  • array de objectalways
  • objectalways
  • objectalways
  • createdAtstring · date-timealways
  • approvedAtstring · date-time o nullalways
  • routePlanIdstring · uuid o nullalways

It can respond with error 400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503. The error body is explained in Concepts.

request
curl -X GET "https://api.drometra.com/v1/routing/optimization-previews/0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d" \
  -H "Authorization: Bearer $DROMETRA _ TOKEN"\
  -H "x-tenant-id: $DROMETRA_TENANT" \
  -H "Accept: application / json"
response · 200
{
  "id": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "tenantId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "state": "ready",
  "version": 1,
  "profile": "car",
  "solution": {
    "feasible": true,
    "timedOut": true,
    "optimal": false,
    "routes": [
      {
        "vehicleId": "…",
        "fleetVehicleId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
        "orderedStops": [],
        "distanceMeters": 0,
        "durationSeconds": 0
      }
    ],
    "unassigned": [
      {
        "id": "…",
        "reason": "capacity_exceeded"
      }
    ],
    "totalDistanceMeters": 0,
    "totalDurationSeconds": 0,
    "baselineDistanceMeters": 0,
    "improvementMeters": 0
  },
  "roadRoutes": [
    {
      "vehicleId": "…",
      "fleetVehicleId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
      "route": {
        "profile": "car",
        "waypoints": [],
        "geometry": {
          "type": "LineString",
          "coordinates": []
        },
        "distanceMeters": 0,
        "durationSeconds": 0,
        "estimated": true,
        "trafficIncluded": false,
        "provenance": {
          "kind": "valhalla",
          "engine": "…",
          "engineVersion": "…",
          "graphVersion": "…",
          "coverage": {},
          "roadNetwork": true
        },
        "ferryMeters": 0
      }
    }
  ],
  "matrixProvenance": {
    "kind": "valhalla",
    "engine": "…",
    "engineVersion": "…",
    "graphVersion": "…",
    "coverage": {
      "id": "…",
      "status": "covered"
    },
    "roadNetwork": true
  },
  "solver": {
    "name": "…",
    "maxComputationMs": 1000.5,
    "optimal": false
  },
  "createdAt": "2026-10-21T14:02:31Z",
  "approvedAt": "2026-10-21T14:02:31Z",
  "routePlanId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d"
}

Approve a route proposal

POSThttps://api.drometra.com/v1/routing/optimization-previews/{id}/approve

Requires the access token of a person in your company.

Headers

x-tenant-idmandatorystring · uuid
Your company's identifier. The server checks that you are still an active member of it.
idempotency-keymandatorystring · uuid
A new UUID per operation. If you repeat the request with the same key, the change is not applied twice.

Road parameters

idmandatorystring · uuid
e. g. 0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d

Body

versionmandatoryinteger

Response · 200

  • idstring · uuidalways
  • tenantIdstring · uuidalways
  • previewIdstring · uuidalways
  • versionintegeralways
  • profileenum: car | truck | bicycle | pedestrianalways
  • array de objectalways
  • array de objectalways
  • array de objectalways
  • objectalways
  • createdAtstring · date-timealways

It can respond with error 400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503. The error body is explained in Concepts.

request
curl -X POST "https://api.drometra.com/v1/routing/optimization-previews/0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d/approve" \
  -H "Authorization: Bearer $DROMETRA _ TOKEN"\
  -H "x-tenant-id: $DROMETRA_TENANT" \
  -H "idempotency-key: $(uuidgen)" \
  -H "Content-Type: application/json" \ -d '{
    "version": 0
  }'
response · 200
{
  "id": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "tenantId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "previewId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "version": 1,
  "profile": "car",
  "routes": [
    {
      "vehicleId": "…",
      "fleetVehicleId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
      "orderedStops": [
        {
          "id": "…",
          "arrivalAt": "2026-10-21T14:02:31Z",
          "serviceStartsAt": "2026-10-21T14:02:31Z",
          "departureAt": "2026-10-21T14:02:31Z",
          "loadAfter": 0
        }
      ],
      "distanceMeters": 0,
      "durationSeconds": 0
    }
  ],
  "unassigned": [
    {
      "id": "…",
      "reason": "capacity_exceeded"
    }
  ],
  "roadRoutes": [
    {
      "vehicleId": "…",
      "fleetVehicleId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
      "route": {
        "profile": "car",
        "waypoints": [],
        "geometry": {
          "type": "LineString",
          "coordinates": []
        },
        "distanceMeters": 0,
        "durationSeconds": 0,
        "estimated": true,
        "trafficIncluded": false,
        "provenance": {
          "kind": "valhalla",
          "engine": "…",
          "engineVersion": "…",
          "graphVersion": "…",
          "coverage": {},
          "roadNetwork": true
        },
        "ferryMeters": 0
      }
    }
  ],
  "matrixProvenance": {
    "kind": "valhalla",
    "engine": "…",
    "engineVersion": "…",
    "graphVersion": "…",
    "coverage": {
      "id": "…",
      "status": "covered"
    },
    "roadNetwork": true
  },
  "createdAt": "2026-10-21T14:02:31Z"
}

Get a route plan

GEThttps://api.drometra.com/v1/routing/route-plans/{id}

Requires the access token of a person in your company.

Headers

x-tenant-idmandatorystring · uuid
Your company's identifier. The server checks that you are still an active member of it.

Road parameters

idmandatorystring · uuid
e. g. 0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d

Response · 200

  • idstring · uuidalways
  • tenantIdstring · uuidalways
  • previewIdstring · uuidalways
  • versionintegeralways
  • profileenum: car | truck | bicycle | pedestrianalways
  • array de objectalways
  • array de objectalways
  • array de objectalways
  • objectalways
  • createdAtstring · date-timealways

It can respond with error 400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503. The error body is explained in Concepts.

request
curl -X GET "https://api.drometra.com/v1/routing/route-plans/0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d" \
  -H "Authorization: Bearer $DROMETRA _ TOKEN"\
  -H "x-tenant-id: $DROMETRA_TENANT" \
  -H "Accept: application / json"
response · 200
{
  "id": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "tenantId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "previewId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
  "version": 1,
  "profile": "car",
  "routes": [
    {
      "vehicleId": "…",
      "fleetVehicleId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
      "orderedStops": [
        {
          "id": "…",
          "arrivalAt": "2026-10-21T14:02:31Z",
          "serviceStartsAt": "2026-10-21T14:02:31Z",
          "departureAt": "2026-10-21T14:02:31Z",
          "loadAfter": 0
        }
      ],
      "distanceMeters": 0,
      "durationSeconds": 0
    }
  ],
  "unassigned": [
    {
      "id": "…",
      "reason": "capacity_exceeded"
    }
  ],
  "roadRoutes": [
    {
      "vehicleId": "…",
      "fleetVehicleId": "0b6f8c2e-4a1d-4e5b-9c3f-2d7e8a9b1c4d",
      "route": {
        "profile": "car",
        "waypoints": [],
        "geometry": {
          "type": "LineString",
          "coordinates": []
        },
        "distanceMeters": 0,
        "durationSeconds": 0,
        "estimated": true,
        "trafficIncluded": false,
        "provenance": {
          "kind": "valhalla",
          "engine": "…",
          "engineVersion": "…",
          "graphVersion": "…",
          "coverage": {},
          "roadNetwork": true
        },
        "ferryMeters": 0
      }
    }
  ],
  "matrixProvenance": {
    "kind": "valhalla",
    "engine": "…",
    "engineVersion": "…",
    "graphVersion": "…",
    "coverage": {
      "id": "…",
      "status": "covered"
    },
    "roadNetwork": true
  },
  "createdAt": "2026-10-21T14:02:31Z"
}