Quickstart

Three steps to your first optimized route.

1. Get an API key

  1. Sandbox (free) — create a test key in the console. Prefix: otg_test_…
  2. Production — buy a pack and receive a live key by email. Prefix: otg_live_…

2. Send a request

Authenticate with Authorization: Bearer <key>. Provide at least start and 2 stops.

curl https://app.otiggo.com/api/v1/optimize \
  -H "Authorization: Bearer otg_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "start": { "street": "12 rue de la Paix", "postalCode": "75002", "city": "Paris" },
  "end": { "latitude": 48.8566, "longitude": 2.3522 },
  "departureTime": "2026-10-20T07:30:00+02:00",
  "avoidTolls": true,
  "stops": [
    { "id": "A", "latitude": 48.87, "longitude": 2.30, "deadline": "10:30", "serviceSeconds": 120 },
    { "id": "B", "street": "5 avenue Foch", "postalCode": "75116", "city": "Paris" }
  ]
}'

3. Read the response

You get the optimal stop order, waypoints, distance, duration, and a schedule with arrival times.

200 · live
{
  "order": ["B", "A"],
  "waypoints": [
    { "id": "B", "order": 1, "latitude": 48.8738, "longitude": 2.2950 },
    { "id": "A", "order": 2, "latitude": 48.8700, "longitude": 2.3000 }
  ],
  "totalDistanceKm": 7.4,
  "estimatedTimeMin": 38,
  "schedule": [
    { "colisId": "B", "arrivee": "2026-10-20T05:41:00Z" },
    { "colisId": "A", "arrivee": "2026-10-20T05:55:00Z" }
  ],
  "departAt": "2026-10-20T05:30:00Z",
  "returnAt": "2026-10-20T06:08:00Z",
  "lateStops": null,
  "stopsCharged": 2,
  "stopsBalance": 1998
}
200 · sandbox
{
  "order": ["B", "A"],
  "waypoints": [
    { "id": "B", "order": 1, "latitude": 48.86, "longitude": 2.33 },
    { "id": "A", "order": 2, "latitude": 48.87, "longitude": 2.30 }
  ],
  "totalDistanceKm": 6.1,
  "estimatedTimeMin": 32,
  "schedule": [
    { "colisId": "B", "arrivee": "2026-10-20T05:40:00Z" },
    { "colisId": "A", "arrivee": "2026-10-20T05:52:00Z" }
  ],
  "departAt": "2026-10-20T05:30:00Z",
  "returnAt": "2026-10-20T06:02:00Z",
  "lateStops": null,
  "stopsCharged": 0,
  "sandbox": true,
  "sandboxStopsRemainingToday": 198
}

Next steps