Get Nutrition Settings (v1)
Method & Path
GET /api/v1/workspace/:workspaceId/nutrition/settings
Description
Retrieves the nutrition module settings for the workspace. Creates default settings if none exist.
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 |
Response 200 OK
{
"settings": {
"id": "507f1f77bcf86cd799439015",
"workspaceId": "507f1f77bcf86cd799439012",
"specialistSlug": "dr-ahmed-nutrition",
"businessName": "عيادة د. أحمد للتغذية",
"measurementUnits": "metric",
"defaultCurrency": "ILS",
"branding": {
"logoUrl": "https://storage.placio.app/logos/clinic.png",
"primaryColor": "#10b981",
"welcomeMessage": "مرحباً بك في بوابة التغذية"
},
"portalOptions": {
"allowDiaryEntry": true,
"allowProgressEntry": true,
"showCalories": true,
"showMacros": true,
"showSessions": true
},
"defaultDailyCalories": 2000,
"defaultMacros": {
"protein": 100,
"carbs": 250,
"fats": 65
},
"mealNames": ["فطور", "غداء", "عشاء", "وجبة خفيفة"],
"workingDays": [0, 1, 2, 3, 4],
"sessionDuration": 30,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}
Settings Fields
| Field | Type | Description |
|---|---|---|
| specialistSlug | string | Unique URL slug for client portal |
| businessName | string | Display name in portal |
| measurementUnits | string | "metric" or "imperial" |
| branding | object | Portal branding settings |
| portalOptions | object | Features enabled for clients |
| mealNames | string[] | Default meal names |
| workingDays | number[] | Working days (0=Sunday) |
| sessionDuration | number | Default session duration in minutes |
Common Errors
- 401 Unauthorized: Missing or invalid token
- 404 Not Found: Workspace not found