Skip to main content

Create Nutrition Client (v1)

Method & Path​

POST /api/v1/workspace/:workspaceId/nutrition/clients

Description​

Creates a new nutrition client in the workspace. The client will be used for tracking nutrition plans, progress, and sessions.

Authentication​

Required: Workspace token with nutrition management permission.

Headers​

HeaderRequiredDescription
AuthorizationYesBearer <token>
Content-TypeYesapplication/json

Path Parameters​

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID

Request Body​

{
"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", "high blood pressure"],
"allergies": ["peanuts", "shellfish"],
"goals": "خسارة 10 كيلو في 3 أشهر",
"notes": "يفضل الوجبات النباتية",
"tags": ["vip", "weight-loss"]
}

Body Fields​

FieldTypeRequiredDescription
namestringYesClient's full name
emailstringNoEmail address
phonestringNoPhone number
birthDatestringNoISO 8601 date
genderstringNo"male" or "female"
heightnumberNoHeight in cm
currentWeightnumberNoCurrent weight in kg
targetWeightnumberNoTarget weight in kg
activityLevelstringNosedentary, light, moderate, active, very_active
healthConditionsstring[]NoList of health conditions
allergiesstring[]NoList of allergies
goalsstringNoClient's nutrition goals
notesstringNoAdditional notes
tagsstring[]NoTags for categorization

Response 201 Created​

{
"client": {
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"clientId": null,
"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", "high blood pressure"],
"allergies": ["peanuts", "shellfish"],
"goals": "خسارة 10 كيلو في 3 أشهر",
"notes": "يفضل الوجبات النباتية",
"customFields": {},
"tags": ["vip", "weight-loss"],
"avatarUrl": null,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}

Common Errors​

  • 400 Bad Request: Invalid input data (missing name, invalid email format)
  • 401 Unauthorized: Missing or invalid token
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Workspace not found