Skip to main content
PUT
/
solicitud
/
{id}
curl -X PUT https://api.example.com/solicitud/42 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "asunto": "Transporte urgente a sede central",
    "idTipoPrioridadSolicitud": 1,
    "cantidadPasajeros": 8,
    "observaciones": "Aumentaron los participantes"
  }'
{
  "success": true,
  "message": "Solicitud actualizada exitosamente",
  "data": {
    "Id": 42,
    "CodigoSolicitud": "SOL-2026-03-00000042",
    "IdUsuarioSolicitante": 1,
    "NombreSolicitante": "Juan Pérez",
    "EmailSolicitante": "[email protected]",
    "IdDepartamentoSolicitante": 2,
    "NombreDepartamento": "Logística",
    "IdUsuarioAprobador": 3,
    "NombreAprobador": "María González",
    "EmailAprobador": "[email protected]",
    "IdTipoPrioridadSolicitud": 1,
    "NombrePrioridad": "Urgente",
    "IdTipoServicioSolicitud": 1,
    "NombreTipoServicio": "Transporte de personal",
    "Asunto": "Transporte urgente a sede central",
    "CantidadPasajeros": 8,
    "FechaServicioRequerido": "2026-04-15",
    "HoraServicioRequerido": "08:00:00",
    "Observaciones": "Aumentaron los participantes",
    "IdEstadoActual": 1,
    "CodigoEstadoActual": "PENDIENTE_APROBACION",
    "NombreEstadoActual": "Pendiente de Aprobación",
    "ColorEstadoActual": "#FFA500",
    "FechaHoraCreacion": "2026-03-10T14:30:00",
    "FechaHoraActualizacion": "2026-03-10T16:20:00",
    "lugares": [
      {
        "Id": 1,
        "IdLugar": 5,
        "NombreLugar": "Sede Central",
        "EsOrigen": true,
        "Orden": 0
      }
    ],
    "misiones": []
  }
}

Overview

Updates an existing solicitud. This operation is only allowed for solicitudes in PENDIENTE_APROBACION status.
Once a solicitud is approved, rejected, or in any other status, it cannot be updated.

Authentication

Requires valid authentication token.

Path Parameters

id_solicitud
integer
required
The unique ID of the solicitud to update

Request Body

All fields are optional. Only the fields provided will be updated.
idUsuarioAprobador
integer
ID of the approver profile (FK to Perfil)
idTipoPrioridadSolicitud
integer
ID of the priority type (FK to TipoPrioridadSolicitud)
idTipoServicioSolicitud
integer
ID of the service type (FK to TipoServicioSolicitud)
asunto
string
Subject of the solicitud (5-250 characters)
descripcion
string
Detailed description
justificacion
string
Justification for the request
cantidadPasajeros
integer
Number of passengers (minimum 0)
nombresPasajeros
string
Names of passengers
fechaServicioRequerido
date
Date when service is required (YYYY-MM-DD format, cannot be in the past)
horaServicioRequerido
time
Time when service is required (HH:MM format)
observaciones
string
Additional observations
lugares
array
New list of locations (replaces existing locations completely)

Business Rules

  • Only solicitudes in PENDIENTE_APROBACION status can be updated
  • Service date cannot be in the past
  • If lugares array is provided, it completely replaces existing locations
  • All location validation rules from creation apply (see Create Solicitud)

Response

success
boolean
Indicates if the operation was successful
message
string
Success message
data
object
The updated solicitud object with all fields, including:
  • Updated solicitud details
  • Current lugares array
  • Associated misiones array
  • Requester and approver information
  • Current status details

Status Codes

200
OK
Solicitud updated successfully
400
Bad Request
Validation error (invalid fields, date in past)
404
Not Found
Solicitud with the specified ID does not exist
409
Conflict
Solicitud is not in PENDIENTE_APROBACION status
422
Unprocessable Entity
Business logic validation error (invalid location rules)
500
Internal Server Error
Server error
curl -X PUT https://api.example.com/solicitud/42 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "asunto": "Transporte urgente a sede central",
    "idTipoPrioridadSolicitud": 1,
    "cantidadPasajeros": 8,
    "observaciones": "Aumentaron los participantes"
  }'
{
  "success": true,
  "message": "Solicitud actualizada exitosamente",
  "data": {
    "Id": 42,
    "CodigoSolicitud": "SOL-2026-03-00000042",
    "IdUsuarioSolicitante": 1,
    "NombreSolicitante": "Juan Pérez",
    "EmailSolicitante": "[email protected]",
    "IdDepartamentoSolicitante": 2,
    "NombreDepartamento": "Logística",
    "IdUsuarioAprobador": 3,
    "NombreAprobador": "María González",
    "EmailAprobador": "[email protected]",
    "IdTipoPrioridadSolicitud": 1,
    "NombrePrioridad": "Urgente",
    "IdTipoServicioSolicitud": 1,
    "NombreTipoServicio": "Transporte de personal",
    "Asunto": "Transporte urgente a sede central",
    "CantidadPasajeros": 8,
    "FechaServicioRequerido": "2026-04-15",
    "HoraServicioRequerido": "08:00:00",
    "Observaciones": "Aumentaron los participantes",
    "IdEstadoActual": 1,
    "CodigoEstadoActual": "PENDIENTE_APROBACION",
    "NombreEstadoActual": "Pendiente de Aprobación",
    "ColorEstadoActual": "#FFA500",
    "FechaHoraCreacion": "2026-03-10T14:30:00",
    "FechaHoraActualizacion": "2026-03-10T16:20:00",
    "lugares": [
      {
        "Id": 1,
        "IdLugar": 5,
        "NombreLugar": "Sede Central",
        "EsOrigen": true,
        "Orden": 0
      }
    ],
    "misiones": []
  }
}
When updating locations with the lugares array, the existing locations are completely replaced. Make sure to include all desired locations in the update.

Build docs developers (and LLMs) love