List Nutrition Clients (v1)
Method & Path
GET /api/v1/workspace/:workspaceId/nutrition/clients
Description
Retrieves a paginated list of nutrition clients in the workspace.
Authentication
Required: Workspace token with nutrition view permission.
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer <token> |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| workspaceId | string | Yes | Workspace ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| search | string | No | Search by name, email, or phone |
| tags | string | No | Comma-separated tag names |
| limit | number | No | Number of results (default: 50, max: 100) |
| offset | number | No | Pagination offset (default: 0) |
Response 200 OK
{
"clients": [
{
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"name": "أحمد محمد",
"email": "ahmed@example.com",
"phone": "+972501234567",
"birthDate": "1990-05-15T00:00:00.000Z",
"gender": "male",
"height": 175,
"currentWeight": 85,
"targetWeight": 75,
"activityLevel": "moderate",
"healthConditions": ["diabetes"],
"allergies": ["peanuts"],
"goals": "خسارة 10 كيلو",
"tags": ["vip"],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
],
"total": 25
}
Common Errors
- 401 Unauthorized: Missing or invalid token
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Workspace not found