Ir al contenido

Crear vehículo

POST
/vehicles
curl --request POST \
--url https://api.dev.lade.com.mx/vehicles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "teamId": "550e8400-e29b-41d4-a716-446655440000", "plate": "ABC-123-XY", "brand": "Kenworth", "model": "T680", "year": 2022, "type": "TRUCK", "fuelType": "DIESEL" }'

Registra un nuevo vehículo para el equipo

Media typeapplication/json
object
teamId
required
string format: uuid
plate
required
string
>= 1 characters <= 20 characters
brand
string
<= 50 characters
model
string
<= 50 characters
year
integer
0 <= 2100
vin
string
<= 17 characters
type
string
<= 50 characters
capacity
string
<= 50 characters
fuelType
string
<= 50 characters
insuranceNumber
string
<= 50 characters
insuranceExpiry
string
<= 20 characters
mileage
integer
0 <= 9999999
notes
string
<= 1000 characters
Example
{
"teamId": "550e8400-e29b-41d4-a716-446655440000",
"plate": "ABC-123-XY",
"brand": "Kenworth",
"model": "T680",
"year": 2022,
"type": "TRUCK",
"fuelType": "DIESEL"
}

Vehículo creado

Media typeapplication/json
object
id
string format: uuid
teamId
string format: uuid
plate
string
brand
string
nullable
model
string
nullable
year
integer
vin
string
nullable <= 17 characters
type
string
nullable
imageUrl
string
nullable
capacity
string
nullable
fuelType
string
nullable
status

Estado del vehículo

string
Allowed values: DISPONIBLE EN_USO MANTENIMIENTO FUERA_DE_SERVICIO
insuranceNumber
string
nullable
insuranceExpiry
string
nullable
registrationExpiry
string
nullable
lastMaintenance
string
nullable
nextMaintenance
string
nullable
mileage
integer
notes
string
nullable
createdAt
string format: date-time
Example
{
"status": "DISPONIBLE"
}

Solicitud inválida

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Validation failed",
"field": "email",
"message": "Invalid email format"
}

No autenticado

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Unauthorized",
"message": "Invalid or expired token"
}

Sin permisos

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Forbidden",
"message": "You don't have permission to access this resource"
}