Skip to main content
POST
/
solicitud
/
{id}
/
rechazar
curl -X POST https://api.example.com/solicitud/42/rechazar \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "motivo": "No cumple con los requisitos mínimos establecidos en la política institucional"
  }'
{
  "success": true,
  "message": "Solicitud rechazada 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": 3,
    "CodigoEstadoActual": "RECHAZADA",
    "NombreEstadoActual": "Rechazada",
    "ColorEstadoActual": "#FF0000",
    "EsEstadoFinal": true,
    "FechaHoraCreacion": "2026-03-10T14:30:00",
    "FechaHoraActualizacion": "2026-03-10T15:50:00",
    "lugares": [
      {
        "Id": 1,
        "IdLugar": 5,
        "NombreLugar": "Sede Central",
        "EsOrigen": true,
        "Orden": 0
      }
    ],
    "misiones": []
  }
}

Overview

Rejects a transport solicitud, changing its status from PENDIENTE_APROBACION to RECHAZADA (final status).
Rejection is a final action. Once rejected, the solicitud cannot be approved or modified.

Authentication

Requires valid authentication token.

Path Parameters

id_solicitud
integer
required
The unique ID of the solicitud to reject

Request Body

motivo
string
required
Required reason for rejection. Must not be empty. This will be sent to the requester in the notification email.

Business Rules

  • Only solicitudes in PENDIENTE_APROBACION status can be rejected
  • The reason (motivo) is mandatory and must not be empty
  • RECHAZADA is a final status (cannot be changed)
  • The status change is recorded in the status history
  • A notification email is sent to the requester with the rejection reason

Response

success
boolean
Indicates if the operation was successful
message
string
Success message
data
object
The updated solicitud object with:
  • Status updated to RECHAZADA
  • All solicitud details
  • Associated locations
  • Empty missions array (no missions created yet)

Status Codes

200
OK
Solicitud rejected successfully
400
Bad Request
Validation error (missing or empty reason)
404
Not Found
Solicitud with the specified ID does not exist
409
Conflict
Solicitud is not in PENDIENTE_APROBACION status
500
Internal Server Error
Server error
curl -X POST https://api.example.com/solicitud/42/rechazar \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "motivo": "No cumple con los requisitos mínimos establecidos en la política institucional"
  }'
{
  "success": true,
  "message": "Solicitud rechazada 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": 3,
    "CodigoEstadoActual": "RECHAZADA",
    "NombreEstadoActual": "Rechazada",
    "ColorEstadoActual": "#FF0000",
    "EsEstadoFinal": true,
    "FechaHoraCreacion": "2026-03-10T14:30:00",
    "FechaHoraActualizacion": "2026-03-10T15:50:00",
    "lugares": [
      {
        "Id": 1,
        "IdLugar": 5,
        "NombreLugar": "Sede Central",
        "EsOrigen": true,
        "Orden": 0
      }
    ],
    "misiones": []
  }
}

Email Notification

When a solicitud is rejected, an automatic email notification is sent to the requester with:
  • Solicitud code and subject
  • Rejection date and time
  • Rejection reason (the motivo provided)
  • Information about next steps (e.g., submitting a new solicitud)
Provide a clear and detailed rejection reason. This helps the requester understand why the solicitud was not approved and what they need to improve for future requests.

Build docs developers (and LLMs) love