Skip to main content

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

HeaderRequiredDescription
AuthorizationYesBearer <token>
Content-TypeYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace 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

FieldTypeRequiredDescription
clientIdstringYesClient ID
typestringYes"in_person" or "online"
datestringYesSession date (ISO 8601)
startTimestringYesStart time (HH:mm)
endTimestringNoEnd time (HH:mm)
durationMinutesnumberNoDuration in minutes
topicstringNoSession topic
notesPrivatestringNoPrivate notes (specialist only)
notesSharedstringNoNotes shared with client
meetingLinkstringNoVideo meeting link (for online)
locationstringNoLocation (for in-person)
specialistIdstringNoStaff 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

  • scheduledcompleted (session finished)
  • scheduledcancelled (session cancelled)
  • scheduledno_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