Skip to main content

Nutrition API (v1)

Overview

The Nutrition API provides endpoints for managing nutrition specialist workspaces, including client management, meal planning, progress tracking, sessions, and client portal access.

Base URL

/api/v1/workspace/:workspaceId/nutrition

All endpoints require workspace authentication unless specified otherwise.

Authentication

Most endpoints require a valid workspace token:

Authorization: Bearer <workspace_token>

Modules

Clients

  • Create Client - Register a new nutrition client
  • List Clients - Get all clients in workspace
  • Get Client – Get client details (coming soon)
  • Update Client – Update client information (coming soon)

Plans

  • Create Plan - Create a new nutrition plan
  • List Plans – Get plans (optionally filtered by client) (coming soon)
  • Get Plan – Get plan details (coming soon)
  • Update Plan – Update plan (coming soon)
  • Archive Plan – Archive a plan (coming soon)

Sessions

  • Create Session - Schedule a consultation session
  • List Sessions – Get sessions (coming soon)
  • Get Session – Get session details (coming soon)
  • Update Session – Update session (coming soon)
  • Cancel Session – Cancel a session (coming soon)

Diaries

  • Create Diary – Create/update food diary entry (coming soon)
  • List Diaries – Get diary entries (coming soon)
  • Get Diary – Get diary by date (coming soon)

Progress

  • Create Progress – Add progress measurement (coming soon)
  • List Progress – Get progress history (coming soon)
  • Get Progress – Get progress entry (coming soon)
  • Update Progress – Update progress entry (coming soon)

Settings

  • Get Settings - Get nutrition workspace settings
  • Update Settings – Update settings (coming soon)

Client Accounts

  • Create Account - Create portal account for client
  • Get Account – Get client's portal account (coming soon)
  • Reset Password – Reset client password (coming soon)
  • Toggle Status – Enable/disable account (coming soon)

Response Format

All responses follow a consistent format:

{
"client": { ... }, // Single resource
"clients": [ ... ], // Array of resources
"total": 100 // For paginated responses
}

Error Responses

{
"error": {
"message": "Error description",
"details": { ... }
}
}

Common Error Codes

CodeDescription
400Bad Request - Invalid input data
401Unauthorized - Missing or invalid token
403Forbidden - Insufficient permissions
404Not Found - Resource not found
409Conflict - Resource already exists
422Unprocessable Entity - Validation failed
500Internal Server Error