List Agencies
Retrieve a paginated list of agencies.
WARNING
Requires agencies.view permission.
Endpoint
INFO
GET /api/v1/dashboard/agencies
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
partner_id | integer | - | Filter by partner |
search | string | - | Search by name or code |
status | string | - | Filter: active, inactive |
page | integer | 1 | Page number |
per_page | integer | 15 | Items per page |
Example Request
bash
curl -X GET "https://api.daakey.com/api/v1/dashboard/agencies?partner_id=1&page=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Agencies retrieved",
"data": [
{
"id": 1,
"name": "Downtown Branch",
"code": "ACME-DT",
"partner": {
"id": 1,
"name": "Acme Car Rentals"
},
"email": "downtown@acme.com",
"phone": "+1234567890",
"address": "123 Main St, Downtown",
"status": "active",
"vehicles_count": 25,
"active_bookings_count": 8,
"created_at": "2024-01-01T00:00:00Z"
},
{
"id": 2,
"name": "Airport Branch",
"code": "ACME-AP",
"partner": {
"id": 1,
"name": "Acme Car Rentals"
},
"email": "airport@acme.com",
"phone": "+1234567891",
"address": "456 Airport Blvd",
"status": "active",
"vehicles_count": 50,
"active_bookings_count": 20,
"created_at": "2024-01-15T00:00:00Z"
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 2
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}