API: Create Route

Request

Create a new route with a POST request:

POST /routes

Request Body:


{
  "start_id": 2,
  "end_id": 2,
  "distance": 1300.3,
  "duration": "02:45",
  "is_popular": "0", // optional
}
                

Sample Response:


{
  "status": "success",
  "message": "Route created successfully",
  "data": {
    "id": 1,
    "start_name": "Updated District 1",
    "end_name": "Updated District 1",
    "distance": 1300,
    "duration": "02:45",
    "is_popular": "0",
    "popular_position": "",
    "status": "1"
  }
}