Create Nutrition Session (v1)
Method & Path
POST /api/v1/workspace/:workspaceId/nutrition/sessions
Description
Schedules a new consultation session with a client.
Authentication
Required: Workspace token with nutrition management permission.
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer <token> |
| Content-Type | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| workspaceId | string | Yes | Workspace ID |
Request Body
{
"clientId": "507f1f77bcf86cd799439011",
"type": "online",
"date": "2024-01-20T00:00:00.000Z",
"startTime": "10:00",
"endTime": "10:30",
"durationMinutes": 30,
"topic": "متابعة أسبوعية",
"meetingLink": "https://zoom.us/j/123456789",
"notesPrivate": "ملاحظات للأخصائي فقط",
"notesShared": "ملاحظات مشتركة مع العميل"
}
Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
| clientId | string | Yes | Client ID |
| type | string | Yes | "in_person" or "online" |
| date | string | Yes | Session date (ISO 8601) |
| startTime | string | Yes | Start time (HH:mm) |
| endTime | string | No | End time (HH:mm) |
| durationMinutes | number | No | Duration in minutes |
| topic | string | No | Session topic |
| notesPrivate | string | No | Private notes (specialist only) |
| notesShared | string | No | Notes shared with client |
| meetingLink | string | No | Video meeting link (for online) |
| location | string | No | Location (for in-person) |
| specialistId | string | No | Staff member ID |
Response 201 Created
{
"session": {
"id": "507f1f77bcf86cd799439014",
"workspaceId": "507f1f77bcf86cd799439012",
"clientId": "507f1f77bcf86cd799439011",
"specialistId": null,
"type": "online",
"status": "scheduled",
"date": "2024-01-20T00:00:00.000Z",
"startTime": "10:00",
"endTime": "10:30",
"durationMinutes": 30,
"topic": "متابعة أسبوعية",
"notesPrivate": "ملاحظات للأخصائي فقط",
"notesShared": "ملاحظات مشتركة مع العميل",
"attachments": [],
"followUps": [],
"meetingLink": "https://zoom.us/j/123456789",
"location": null,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}
Session Status Flow
scheduled→completed(session finished)scheduled→cancelled(session cancelled)scheduled→no_show(client didn't attend)
Common Errors
- 400 Bad Request: Invalid input data
- 401 Unauthorized: Missing or invalid token
- 404 Not Found: Workspace or client not found