Delete Station
Delete a station.
Endpoint
INFO
DELETE /api/v1/dashboard/stations/{station}
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
station | integer | Station ID |
Example Request
bash
curl -X DELETE https://api.daakey.com/api/v1/dashboard/stations/1 \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Station deleted",
"data": null,
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Error (400)
json
{
"success": false,
"message": "Cannot delete station",
"data": {
"reason": "Station has vehicles assigned",
"vehicles_count": 5
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Stations with assigned vehicles cannot be deleted
- Reassign vehicles before deleting the station