List Branches
Display all branches with search and pagination support
Reading time: 1 minute
List Branches
Display all branches with search and pagination support.
GET
{{base_url}}/branchesQuery Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
phone_number_id | string | Yes | Phone number ID | - |
page | integer | No | Page number | 1 |
limit | integer | No | Number of results per page | 10 |
searchTerm | string | No | Search in branches (name, phone, address) | - |
Tip: Use the searchTerm parameter to search in branch name, phone number, or address.
Example Request
Example Requestbash
curl -X GET "{{base_url}}/branches?page=1&limit=10&phone_number_id=123456" \
-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"Example Response
Response200 OK
{
"status": true,
"data": [
{
"id": 1,
"name": "Main Branch",
"phone": "966500000000",
"email": "main@example.com",
"address": "King Fahd Road, Riyadh, Saudi Arabia",
"description": "Main branch in Riyadh",
"is_favorite": true,
"contact_group_id": 5,
"created_at": "2025-01-01T10:00:00Z",
"updated_at": "2025-01-08T14:30:00Z"
},
{
"id": 2,
"name": "Jeddah Branch",
"phone": "966500000001",
"email": "jeddah@example.com",
"address": "Tahlia Street, Jeddah, Saudi Arabia",
"description": "Jeddah branch",
"is_favorite": false,
"contact_group_id": null,
"created_at": "2025-01-02T11:00:00Z",
"updated_at": "2025-01-07T09:15:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 10,
"total": 2,
"last_page": 1
}
}Use Cases
Search for Specific Branch
Searchbash
GET /branches?searchTerm=Jeddah&phone_number_id=123456Get Favorite Branches Only
Filter Favoritesjavascript
const response = await fetch('/branches?phone_number_id=123456');
const data = await response.json();
const favorites = data.data.filter(branch => branch.is_favorite);Related
ā Back to Branches
View Guide