Update Agency
Update an existing agency's information.
WARNING
Requires super-admin or partner role.
Endpoint
INFO
PUT /api/v1/dashboard/agencies/{agency}
Headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
agency | integer | Agency ID |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Agency name |
email | string | No | Contact email |
phone | string | No | Contact phone |
address | string | No | Physical address |
latitude | decimal | No | Location latitude |
longitude | decimal | No | Location longitude |
timezone | string | No | Agency timezone |
settings | object | No | Agency settings |
Example Request
bash
curl -X PUT https://api.daakey.com/api/v1/dashboard/agencies/1 \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"name": "Downtown Branch - Main",
"settings": {
"min_booking_hours": 2,
"deposit_amount": 250.00
}
}'Response
Success (200)
json
{
"success": true,
"message": "Agency updated",
"data": {
"id": 1,
"name": "Downtown Branch - Main",
"code": "ACME-DT",
"settings": {
"booking_advance_days": 90,
"min_booking_hours": 2,
"max_booking_days": 30,
"cancellation_hours": 24,
"deposit_required": true,
"deposit_amount": 250.00
},
"updated_at": "2024-01-15T00:00:00Z"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Agency code cannot be changed
- Settings are merged with existing settings