Update Branch
Modify an existing branch's data
Reading time: 1 minute
Update Branch
Modify an existing branch's data.
PATCH
{{base_url}}/branches/{id}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Branch ID |
Request Body (form-data)
Same parameters as creation. All are optional - only sent fields will be updated.
Partial Update: You can send only the fields you want to update. Unsent fields will remain unchanged.
Example Request
Example Requestbash
curl -X PATCH "{{base_url}}/branches/3" \
-H "Accept: application/json" \
-H "X-Awal-Signature-256: sha256=abc..." \
-H "X-Timestamp: 1704124800" \
-H "X-Domain: your-workspace" \
-H "X-Client-ID: your-client-id" \
-F "phone=966500000003" \
-F "is_favorite=true"Example Response
Response200 OK
{
"status": true,
"message": "Branch updated successfully",
"data": {
"id": 3,
"name": "Khobar Branch",
"phone": "966500000003",
"is_favorite": true,
"updated_at": "2025-01-08T16:00:00Z"
}
}Use Case: Update Contact Information
Update Contactbash
PATCH /branches/2
-F "phone=966500111222"
-F "email=newemail@example.com"Error Codes
| Code | Description | Cause | Solution |
|---|---|---|---|
| 400 | Bad Request | Invalid data | Check sent data |
| 404 | Not Found | Branch not found | Verify branch ID |
| 422 | Validation Error | Validation error | Review error message |
Related
ā Back to Branches
View Guide