Skip to content

Delete Agency

Delete an agency and all associated data.

WARNING

Requires super-admin or partner role.

DANGER

This action is irreversible and will delete all vehicles, bookings, and client data associated with the agency.

Endpoint

INFO

DELETE /api/v1/dashboard/agencies/{agency}

Headers

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeDescription
agencyintegerAgency ID

Example Request

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

Response

Success (200)

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

Error (400)

json
{
  "success": false,
  "message": "Cannot delete agency",
  "data": {
    "reason": "Agency has active bookings",
    "active_bookings": 3
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Notes

  • Agencies with active bookings cannot be deleted
  • Consider deactivating instead of deleting

Daakey Car Sharing Platform