Skip to main content
DELETE
/
solicitud
/
{id}
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"
  }
}

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

id_solicitud
integer
required
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

success
boolean
Indicates if the operation was successful
message
string
Success message
data
object
Deletion confirmation

Status Codes

200
OK
Solicitud deleted successfully
404
Not Found
Solicitud with the specified ID does not exist
409
Conflict
Cannot delete (not in PENDIENTE_APROBACION status or has active missions)
500
Internal Server Error
Server error
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:
  1. Solicitud record - Main solicitud record
  2. Status history - All entries in HistoricoEstadoSolicitud
  3. 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:
  1. Solicitud exists and is not already deleted
  2. Status is PENDIENTE_APROBACION - No other status allows deletion
  3. 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.

Build docs developers (and LLMs) love