Skip to content

Delete Vehicle

Delete a vehicle from the fleet.

Endpoint

INFO

DELETE /api/v1/dashboard/vehicles/{vehicle}

Headers

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeDescription
vehicleintegerVehicle ID

Example Request

bash
curl -X DELETE https://api.daakey.com/api/v1/dashboard/vehicles/1 \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}"

Response

Success (200)

json
{
  "success": true,
  "message": "Vehicle deleted",
  "data": null,
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Error (400)

json
{
  "success": false,
  "message": "Cannot delete vehicle",
  "data": {
    "reason": "Vehicle has active or upcoming bookings",
    "bookings_count": 2
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Notes

  • Vehicles with active/upcoming bookings cannot be deleted
  • Consider setting status to unavailable instead

Daakey Car Sharing Platform