Skip to main content
POST
/
mision
/
{id}
/
asignar
curl -X POST "https://api.example.com/mision/1/asignar" \
  -H "Content-Type: application/json" \
  -d '{
    "idVehiculoAsignado": 1,
    "idMotoristaAsignado": 5
  }'
{
  "success": true,
  "message": "Vehículo y motorista asignados exitosamente",
  "data": {
    "idMision": 1,
    "idSolicitud": 1,
    "idVehiculoAsignado": 1,
    "idMotoristaAsignado": 5,
    "descripcion": "Traslado de personal al aeropuerto",
    "fechaProgramada": "2025-06-15",
    "horaSalidaProgramada": "08:00:00",
    "idEstadoMision": 1,
    "codigoEstado": "PROGRAMADA"
  }
}

Assign Vehicle and Driver

Assigns a vehicle and driver to a mission in PROGRAMADA (scheduled) state.

Path Parameters

id
integer
required
ID of the mission to assign resources to.

Request Body

idVehiculoAsignado
integer
required
ID of the vehicle to assign. The vehicle must exist and not be deleted.
idMotoristaAsignado
integer
required
ID of the driver (Profile) to assign. The driver must exist and not be deleted.

Response

success
boolean
Indicates if the request was successful.
message
string
Response message: “Vehículo y motorista asignados exitosamente”
data
object
The updated mission object with assigned vehicle and driver.

Validations

  • Mission must be in PROGRAMADA state
  • Vehicle and driver must exist and not be deleted
  • Vehicle cannot have another active mission on the same date
  • Driver cannot have another active mission on the same date
curl -X POST "https://api.example.com/mision/1/asignar" \
  -H "Content-Type: application/json" \
  -d '{
    "idVehiculoAsignado": 1,
    "idMotoristaAsignado": 5
  }'
{
  "success": true,
  "message": "Vehículo y motorista asignados exitosamente",
  "data": {
    "idMision": 1,
    "idSolicitud": 1,
    "idVehiculoAsignado": 1,
    "idMotoristaAsignado": 5,
    "descripcion": "Traslado de personal al aeropuerto",
    "fechaProgramada": "2025-06-15",
    "horaSalidaProgramada": "08:00:00",
    "idEstadoMision": 1,
    "codigoEstado": "PROGRAMADA"
  }
}

Build docs developers (and LLMs) love