Skip to main content
POST
/
destinos
curl -X POST https://api.tesisrutas.com/destinos \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Catedral de Lima",
    "ubicacion": "Plaza Mayor, Lima Centro",
    "importancia": "Principal templo católico del Perú, construcción colonial",
    "coordenadas": {
      "latitud": -12.046374,
      "longitud": -77.030090
    },
    "anio_construccion": [1535, 1649],
    "arquitecto": "Francisco Becerra",
    "area_construccion": 8900,
    "funcion": "Templo religioso y sede arquidiocesana"
  }'
{
  "message": "Destino creado correctamente",
  "id": "507f1f77bcf86cd799439011"
}

Authentication

Required Role: Admin This endpoint requires authentication with admin privileges. Include a valid JWT token in the Authorization header.

Request Body

nombre
string
required
Name of the heritage site
ubicacion
string
required
Location or address of the site
importancia
string
required
Historical or cultural significance of the site
coordenadas
object
required
Geographic coordinates of the site
coordenadas.latitud
number
required
Latitude (-90 to 90)
coordenadas.longitud
number
required
Longitude (-180 to 180)
anio_construccion
array
required
Year(s) of construction. Must contain 1 or 2 integer values.
  • Single value: [1850] (exact year)
  • Range: [1850, 1860] (construction period)
arquitecto
string
Name of the architect (optional)
area_construccion
number
Construction area in square meters (optional)
funcion
string
Current or historical function of the site (optional)

Response

message
string
Success message
id
string
MongoDB ObjectId of the newly created destination
curl -X POST https://api.tesisrutas.com/destinos \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Catedral de Lima",
    "ubicacion": "Plaza Mayor, Lima Centro",
    "importancia": "Principal templo católico del Perú, construcción colonial",
    "coordenadas": {
      "latitud": -12.046374,
      "longitud": -77.030090
    },
    "anio_construccion": [1535, 1649],
    "arquitecto": "Francisco Becerra",
    "area_construccion": 8900,
    "funcion": "Templo religioso y sede arquidiocesana"
  }'
{
  "message": "Destino creado correctamente",
  "id": "507f1f77bcf86cd799439011"
}

Validation Rules

  • nombre, ubicacion, importancia: Required, will be trimmed of whitespace
  • coordenadas.latitud: Must be between -90 and 90
  • coordenadas.longitud: Must be between -180 and 180
  • anio_construccion: Must be an array with exactly 1 or 2 integer values
  • New destinations are created with activo: true by default
  • multimedia array is initialized as empty; use the multimedia endpoints to add files

Implementation Details

This endpoint:
  1. Validates the request data against domain rules
  2. Creates a Destino entity with validated coordinates
  3. Stores the document in the sitios_patrimoniales MongoDB collection
  4. Returns the generated MongoDB ObjectId for future operations
Source: destinos_router.py:20-28

Build docs developers (and LLMs) love