Saltar al contenido principal
Routal
API ReferencePlan

Create a plan

Creates a plan inside a project.

POST
/v2/plan

Creates a plan inside a project. The plan is the container for the routes and stops executed on a given date.

Recommended integration flow

  1. POST /v2/plan?project_id=... creates the plan for the execution date.
  2. POST /v2/stops?plan_id=... (or POST /v2/stops/geocode) pushes the day's orders.
  3. POST /v2/plan/{id}/optimize builds the routes.
  4. POST /v2/route/{id}/dispatch sends each route to its driver.

Payload size is capped at 3 MB. To send more stops, split them across several POST /v2/stops calls once the plan exists.

Plan-level GeoFences are deprecated. The plan inherits the GeoFences defined at project level and cannot override them.

private_key<token>

Pass your API key as the private_key query string parameter. Generate and rotate keys in Developer Settings of your Routal workspace.

Keys stay server-side. Never ship them to a browser or mobile app.

In: query

Query Parameters

project_id*string
Match^[0-9a-f]{24}

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v2/plan?project_id=string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "4f75d991ac359f8c4c79d762",
  "organization_id": "4f75d991ac359f8c4c79d762",
  "project_id": "4f75d991ac359f8c4c79d762",
  "completed_stops": 1,
  "canceled_stops": 2,
  "pending_stops": 3,
  "incomplete_stops": 3,
  "total_stops": 6,
  "total_routes": 5,
  "label": "Eixample route — 2026-05-21",
  "execution_date": "2026-09-09T07:20:39.214Z",
  "status": "planning",
  "created_by": "4f75d991ac359f8c4c79d762",
  "created_at": "2026-09-09T07:20:39.214Z",
  "updated_at": "2026-09-09T07:20:39.214Z",
  "deleted_at": "2026-09-09T07:20:39.214Z",
  "deleted": true
}
{
  "message": "Domain not found",
  "message_id": "highway.domain.error.not_found"
}
Empty
{
  "message": "Domain not found",
  "message_id": "highway.domain.error.not_found"
}
{
  "message": "Domain not found",
  "message_id": "highway.domain.error.not_found"
}
Empty
Empty