Skip to main content
PUT
/
rutas
/
{id}
curl -X PUT https://api.tesisrutas.com/rutas/507f1f77bcf86cd799439020 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Ruta Colonial Extendida",
    "descripcion": "Recorrido ampliado por monumentos coloniales",
    "categoria": "Cultural",
    "pois": [
      {"poi_id": "507f1f77bcf86cd799439011", "order": 0},
      {"poi_id": "507f1f77bcf86cd799439012", "order": 1},
      {"poi_id": "507f1f77bcf86cd799439015", "order": 2},
      {"poi_id": "507f1f77bcf86cd799439013", "order": 3}
    ]
  }'
{
  "mensaje": "Ruta actualizada correctamente"
}
Updates a tourist route with new information. You can modify the name, description, category, and reorder or change the POIs in the route.

Authentication

Requires Editor role or higher.
id
string
required
The unique identifier of the route to update
nombre
string
required
Updated name of the route
descripcion
string
Updated description (optional)
categoria
string
Updated category classification
pois
array
Updated array of POI objects
poi_id
string
required
ID of the POI
order
integer
Position in the route. If not provided, uses array index.
mensaje
string
Confirmation message
curl -X PUT https://api.tesisrutas.com/rutas/507f1f77bcf86cd799439020 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Ruta Colonial Extendida",
    "descripcion": "Recorrido ampliado por monumentos coloniales",
    "categoria": "Cultural",
    "pois": [
      {"poi_id": "507f1f77bcf86cd799439011", "order": 0},
      {"poi_id": "507f1f77bcf86cd799439012", "order": 1},
      {"poi_id": "507f1f77bcf86cd799439015", "order": 2},
      {"poi_id": "507f1f77bcf86cd799439013", "order": 3}
    ]
  }'
{
  "mensaje": "Ruta actualizada correctamente"
}

Update Behavior

  • All fields are updated atomically
  • POI order is respected as provided in the request
  • If order is not specified for a POI, array index is used
  • Route maintains its original creado_en timestamp
  • Update timestamp is managed automatically by the system

Error Responses

  • 404 Not Found: Route does not exist or update failed
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: User does not have Editor role
  • 422 Unprocessable Entity: Invalid request data

Build docs developers (and LLMs) love