Overview
Performs a soft delete (logical deletion) of a solicitud. The solicitud is not physically removed from the database but marked as deleted.
Only solicitudes in PENDIENTE_APROBACION status can be deleted. Approved, rejected, or cancelled solicitudes cannot be deleted.
Authentication
Requires valid authentication token.
Path Parameters
The unique ID of the solicitud to delete
Business Rules
- Only solicitudes in PENDIENTE_APROBACION status can be deleted
- Cannot delete if there are active missions associated (PENDIENTE, ASIGNADA, EN_CURSO)
- Soft delete is performed (record remains in database with
Eliminado = 1)
- All associated records are also soft-deleted:
- Status history (
HistoricoEstadoSolicitud)
- Location details (
DetalleLugarSolicitud)
- This operation cannot be undone through the API
Response
Indicates if the operation was successful
Deletion confirmation
Confirmation message with solicitud code
Status Codes
Solicitud deleted successfully
Solicitud with the specified ID does not exist
Cannot delete (not in PENDIENTE_APROBACION status or has active missions)
curl -X DELETE https://api.example.com/solicitud/42 \
-H "Authorization: Bearer YOUR_TOKEN"
{
"success": true,
"message": "Solicitud eliminada exitosamente",
"data": {
"mensaje": "Solicitud 'SOL-2026-03-00000042' eliminada exitosamente"
}
}
What Gets Deleted
When a solicitud is deleted, the following records are soft-deleted:
- Solicitud record - Main solicitud record
- Status history - All entries in
HistoricoEstadoSolicitud
- Location details - All entries in
DetalleLugarSolicitud
The delete operation is a soft delete, meaning records are marked as deleted (Eliminado = 1) but remain in the database for audit purposes.
Validation Flow
Before deletion, the system validates:
- Solicitud exists and is not already deleted
- Status is PENDIENTE_APROBACION - No other status allows deletion
- No active missions - Checks for missions with status:
- PENDIENTE
- ASIGNADA
- EN_CURSO
If any validation fails, the deletion is rejected with a 409 Conflict error.
Alternative to Deletion
Instead of deleting a solicitud, consider:
Both cancellation and rejection maintain a complete audit trail and are more appropriate for most use cases.
This operation cannot be undone through the API. Deleted solicitudes can only be restored by direct database access.