Skip to main content
POST
/
solicitud
/
{id}
/
aprobar
curl -X POST https://api.example.com/solicitud/42/aprobar \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "success": true,
  "message": "Solicitud aprobada 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": 2,
    "NombrePrioridad": "Normal",
    "IdTipoServicioSolicitud": 1,
    "NombreTipoServicio": "Transporte de personal",
    "Asunto": "Transporte de personal a sede central",
    "Descripcion": "Se requiere transporte para personal de la unidad",
    "CantidadPasajeros": 5,
    "FechaServicioRequerido": "2026-04-15",
    "HoraServicioRequerido": "08:00:00",
    "IdEstadoActual": 2,
    "CodigoEstadoActual": "APROBADA",
    "NombreEstadoActual": "Aprobada",
    "ColorEstadoActual": "#00FF00",
    "EsEstadoFinal": false,
    "FechaHoraCreacion": "2026-03-10T14:30:00",
    "FechaHoraActualizacion": "2026-03-10T15:45:00",
    "lugares": [
      {
        "Id": 1,
        "IdLugar": 5,
        "NombreLugar": "Sede Central",
        "EsOrigen": true,
        "Orden": 0
      }
    ],
    "misiones": []
  }
}

Overview

Approves a transport solicitud, changing its status from PENDIENTE_APROBACION to APROBADA.
Missions are not created automatically when approving. The approver must manually create missions later in the Missions module.

Authentication

Requires valid authentication token.

Path Parameters

id_solicitud
integer
required
The unique ID of the solicitud to approve

Request Body

motivo
string
Optional reason for approval (will be included in email notification)

Business Rules

  • Only solicitudes in PENDIENTE_APROBACION status can be approved
  • The status change is recorded in the status history (HistoricoEstadoSolicitud)
  • A confirmation email is sent to the requester
  • The approval reason (if provided) is included in the notification

Response

success
boolean
Indicates if the operation was successful
message
string
Success message
data
object
The updated solicitud object with:
  • Status updated to APROBADA
  • All solicitud details
  • Associated locations
  • Associated missions (if any)

Status Codes

200
OK
Solicitud approved successfully
404
Not Found
Solicitud with the specified ID does not exist
409
Conflict
Solicitud is not in PENDIENTE_APROBACION status (already approved, rejected, or cancelled)
500
Internal Server Error
Server error
curl -X POST https://api.example.com/solicitud/42/aprobar \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "success": true,
  "message": "Solicitud aprobada 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": 2,
    "NombrePrioridad": "Normal",
    "IdTipoServicioSolicitud": 1,
    "NombreTipoServicio": "Transporte de personal",
    "Asunto": "Transporte de personal a sede central",
    "Descripcion": "Se requiere transporte para personal de la unidad",
    "CantidadPasajeros": 5,
    "FechaServicioRequerido": "2026-04-15",
    "HoraServicioRequerido": "08:00:00",
    "IdEstadoActual": 2,
    "CodigoEstadoActual": "APROBADA",
    "NombreEstadoActual": "Aprobada",
    "ColorEstadoActual": "#00FF00",
    "EsEstadoFinal": false,
    "FechaHoraCreacion": "2026-03-10T14:30:00",
    "FechaHoraActualizacion": "2026-03-10T15:45:00",
    "lugares": [
      {
        "Id": 1,
        "IdLugar": 5,
        "NombreLugar": "Sede Central",
        "EsOrigen": true,
        "Orden": 0
      }
    ],
    "misiones": []
  }
}

Email Notification

When a solicitud is approved, an automatic email notification is sent to the requester with:
  • Solicitud code and subject
  • Approval date and time
  • Approval reason (if provided)
  • Next steps information
This action cannot be undone. Once approved, the solicitud cannot return to PENDIENTE_APROBACION status.

Build docs developers (and LLMs) love