# Coach Platform API reference > The API is available to Coach account holders and the people who build their automations. Create an API key in your Coach account under Settings → מפתחים ואוטומציות (Developers and automations), or connect an MCP client with one-click OAuth. The reference covers 97 endpoints across 18 resources. - Base URL: https://api.coach-platform.com - Authentication: `Authorization: Bearer cp_live_...` (6 public endpoints need no key) - OpenAPI spec: https://www.coach-platform.com/openapi.json - Interactive explorer: https://www.coach-platform.com/docs/api - MCP server (API key or one-click OAuth): https://api.coach-platform.com/api/public/mcp - Agent guide served by the API: https://api.coach-platform.com/api/public/llms.txt - Overview in Hebrew: https://www.coach-platform.com/developers ## Discovery Unauthenticated discovery and reference endpoints. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/health` | [Check API health](https://www.coach-platform.com/docs/api/reference/get-health/index.md) | | `GET` | `/api/public/catalog` | [Get the catalog of scopes and webhook events](https://www.coach-platform.com/docs/api/reference/get-catalog/index.md) | | `GET` | `/api/public/llms.txt` | [Get the AI agent guide (llms.txt)](https://www.coach-platform.com/docs/api/reference/get-llms-txt/index.md) | | `GET` | `/api/public/errors` | [List error codes](https://www.coach-platform.com/docs/api/reference/get-errors/index.md) | | `GET` | `/api/public/changelog` | [Get the API changelog](https://www.coach-platform.com/docs/api/reference/get-changelog/index.md) | | `GET` | `/api/public/limits` | [Get API limits](https://www.coach-platform.com/docs/api/reference/get-limits/index.md) | ## Coach The authenticated coach profile. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/me` | [Get the authenticated coach profile](https://www.coach-platform.com/docs/api/reference/get-me/index.md) | ## Trainees Create, read, and update trainees. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/trainees` | [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md) | | `POST` | `/api/public/trainees` | [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md) | | `POST` | `/api/public/trainees/pending` | [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md) | | `GET` | `/api/public/trainees/{traineeId}` | [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md) | | `PATCH` | `/api/public/trainees/{traineeId}` | [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md) | | `DELETE` | `/api/public/trainees/{traineeId}` | [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md) | | `POST` | `/api/public/trainees/{traineeId}/restore` | [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md) | | `POST` | `/api/public/trainees/{traineeId}/send-credentials` | [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md) | | `GET` | `/api/public/trainees/{traineeId}/weekly-activity` | [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md) | | `GET` | `/api/public/trainees/{traineeId}/measurements` | [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md) | | `POST` | `/api/public/trainees/{traineeId}/body-metrics` | [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md) | | `GET` | `/api/public/trainees/{traineeId}/photos` | [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md) | | `GET` | `/api/public/trainees/{traineeId}/personal-records` | [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md) | ## Labels Trainee labels. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/labels` | [List labels](https://www.coach-platform.com/docs/api/reference/get-labels/index.md) | | `POST` | `/api/public/trainees/{traineeId}/labels` | [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md) | | `DELETE` | `/api/public/trainees/{traineeId}/labels/{labelId}` | [Remove a label from a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id/index.md) | | `PATCH` | `/api/public/labels/{labelId}` | [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md) | | `DELETE` | `/api/public/labels/{labelId}` | [Delete a label](https://www.coach-platform.com/docs/api/reference/delete-labels-label-id/index.md) | ## Escorts Coaching periods linking a coach and a trainee. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/escorts/{escortId}` | [Get a coaching period](https://www.coach-platform.com/docs/api/reference/get-escorts-escort-id/index.md) | | `PATCH` | `/api/public/escorts/{escortId}` | [Update a coaching period](https://www.coach-platform.com/docs/api/reference/patch-escorts-escort-id/index.md) | | `DELETE` | `/api/public/escorts/{escortId}` | [Cancel a coaching period](https://www.coach-platform.com/docs/api/reference/delete-escorts-escort-id/index.md) | | `POST` | `/api/public/escorts` | [Start a coaching period](https://www.coach-platform.com/docs/api/reference/post-escorts/index.md) | ## Training Plans Workout plans and their workout days. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/training-plans` | [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md) | | `POST` | `/api/public/training-plans` | [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md) | | `GET` | `/api/public/training-plans/{planId}` | [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md) | | `PATCH` | `/api/public/training-plans/{planId}` | [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md) | | `DELETE` | `/api/public/training-plans/{planId}` | [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md) | | `GET` | `/api/public/trainees/{traineeId}/active-training-plan` | [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md) | | `POST` | `/api/public/training-plans/{planId}/duplicate` | [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md) | ## Workout Logs Completed workout logs. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/workout-logs` | [List workout logs](https://www.coach-platform.com/docs/api/reference/get-workout-logs/index.md) | | `GET` | `/api/public/trainees/{traineeId}/exercise-notes` | [List a trainee's exercise notes](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-exercise-notes/index.md) | ## Exercises The exercise catalog. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/exercises` | [Search the exercise catalog](https://www.coach-platform.com/docs/api/reference/get-exercises/index.md) | ## Nutrition Menus Nutrition menus and meals. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/trainees/{traineeId}/nutrition-log` | [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md) | | `GET` | `/api/public/nutrition-menus` | [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md) | | `POST` | `/api/public/nutrition-menus` | [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md) | | `GET` | `/api/public/nutrition-menus/{menuId}` | [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md) | | `PATCH` | `/api/public/nutrition-menus/{menuId}` | [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md) | | `DELETE` | `/api/public/nutrition-menus/{menuId}` | [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md) | | `GET` | `/api/public/trainees/{traineeId}/active-nutrition-menu` | [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md) | | `POST` | `/api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives` | [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md) | | `DELETE` | `/api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}` | [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md) | | `GET` | `/api/public/food-items` | [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md) | ## Meetings Scheduled meetings. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/meetings` | [List meetings](https://www.coach-platform.com/docs/api/reference/get-meetings/index.md) | | `POST` | `/api/public/meetings` | [Schedule a meeting](https://www.coach-platform.com/docs/api/reference/post-meetings/index.md) | | `GET` | `/api/public/meetings/{meetingId}` | [Get a meeting](https://www.coach-platform.com/docs/api/reference/get-meetings-meeting-id/index.md) | | `PATCH` | `/api/public/meetings/{meetingId}` | [Update a meeting](https://www.coach-platform.com/docs/api/reference/patch-meetings-meeting-id/index.md) | | `DELETE` | `/api/public/meetings/{meetingId}` | [Delete a meeting](https://www.coach-platform.com/docs/api/reference/delete-meetings-meeting-id/index.md) | ## Forms Coach forms. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/forms` | [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md) | | `GET` | `/api/public/forms/registration` | [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md) | | `GET` | `/api/public/updates` | [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md) | | `POST` | `/api/public/updates/{updateId}/respond` | [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md) | | `GET` | `/api/public/forms/{formId}` | [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md) | | `GET` | `/api/public/forms/{formId}/response/{responseId}` | [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md) | | `GET` | `/api/public/forms/{formId}/responses` | [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md) | ## Notifications Send notifications to trainees. | Method | Path | Endpoint | |---|---|---| | `POST` | `/api/public/notifications` | [Send a notification](https://www.coach-platform.com/docs/api/reference/post-notifications/index.md) | | `POST` | `/api/public/notifications/bulk` | [Send a bulk notification](https://www.coach-platform.com/docs/api/reference/post-notifications-bulk/index.md) | ## Monitoring Trainee adherence monitoring and stalled-exercise tracking. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/monitoring/overview` | [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md) | | `GET` | `/api/public/monitoring/training` | [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md) | | `GET` | `/api/public/monitoring/steps` | [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md) | | `GET` | `/api/public/monitoring/nutrition` | [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md) | | `GET` | `/api/public/monitoring/nutrition/logged-today` | [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md) | | `GET` | `/api/public/monitoring/nutrition/not-logged` | [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md) | | `GET` | `/api/public/monitoring/weight` | [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md) | | `GET` | `/api/public/monitoring/water` | [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md) | | `GET` | `/api/public/monitoring/updates` | [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md) | | `GET` | `/api/public/monitoring/incomplete-updates` | [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md) | | `GET` | `/api/public/monitoring/stalled-exercises` | [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md) | | `PATCH` | `/api/public/monitoring/incomplete-updates/read` | [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md) | | `POST` | `/api/public/monitoring/stalled-exercises/dismiss` | [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md) | | `POST` | `/api/public/monitoring/stalled-exercises/dismiss-all` | [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md) | | `POST` | `/api/public/monitoring/stalled-exercises/undismiss` | [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md) | | `POST` | `/api/public/monitoring/stalled-exercises/undismiss-all` | [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md) | | `POST` | `/api/public/monitoring/stalled-exercises/handle` | [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md) | | `POST` | `/api/public/monitoring/stalled-exercises/handle-all` | [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md) | | `GET` | `/api/public/quick-wins` | [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md) | ## Journeys Customer journeys and trainee enrollment progress. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/journeys` | [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md) | | `POST` | `/api/public/journeys` | [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md) | | `GET` | `/api/public/journeys/enrollments` | [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md) | | `GET` | `/api/public/journeys/{journeyId}` | [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md) | | `PATCH` | `/api/public/journeys/{journeyId}` | [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md) | | `GET` | `/api/public/journeys/{journeyId}/analytics` | [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md) | | `POST` | `/api/public/journeys/{journeyId}/enroll` | [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md) | | `GET` | `/api/public/trainees/{traineeId}/journey-progress` | [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md) | ## Employees Team members. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/employees` | [List employees](https://www.coach-platform.com/docs/api/reference/get-employees/index.md) | ## Products The coach product catalog and pricing. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/products` | [List products](https://www.coach-platform.com/docs/api/reference/get-products/index.md) | | `GET` | `/api/public/products/{productId}` | [Get a product](https://www.coach-platform.com/docs/api/reference/get-products-product-id/index.md) | ## Purchases Customer purchase records and membership status. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/purchases` | [List purchases](https://www.coach-platform.com/docs/api/reference/get-purchases/index.md) | | `POST` | `/api/public/purchases` | [Record a purchase](https://www.coach-platform.com/docs/api/reference/post-purchases/index.md) | | `GET` | `/api/public/purchases/{purchaseId}` | [Get a purchase](https://www.coach-platform.com/docs/api/reference/get-purchases-purchase-id/index.md) | ## Webhooks Read configured webhooks. | Method | Path | Endpoint | |---|---|---| | `GET` | `/api/public/webhooks` | [List webhook subscriptions](https://www.coach-platform.com/docs/api/reference/get-webhooks/index.md) | --- # Check API health `GET https://api.coach-platform.com/api/public/health` Public health check. No auth required. - Resource: Discovery - Authentication: none - HTML version: https://www.coach-platform.com/docs/api/reference/get-health - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `status` | string | | | `timestamp` | string | | | `version` | string | | Example: ```json { "status": "", "timestamp": "", "version": "" } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/health' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/health', { method: 'GET', }); const data = await response.json(); ``` ## Related endpoints - [Get the catalog of scopes and webhook events](https://www.coach-platform.com/docs/api/reference/get-catalog/index.md): `GET /api/public/catalog`. Public catalog of available scopes, webhook events, payload schemas, and docs URL. - [Get the AI agent guide (llms.txt)](https://www.coach-platform.com/docs/api/reference/get-llms-txt/index.md): `GET /api/public/llms.txt`. Plain-text guide for AI agents: auth, conventions, machine-readable references, and the MCP tool list. - [List error codes](https://www.coach-platform.com/docs/api/reference/get-errors/index.md): `GET /api/public/errors`. Reference for every error code returned by the API. - [Get the API changelog](https://www.coach-platform.com/docs/api/reference/get-changelog/index.md): `GET /api/public/changelog`. Changelog of breaking and non-breaking changes to this API. - [Get API limits](https://www.coach-platform.com/docs/api/reference/get-limits/index.md): `GET /api/public/limits`. Body size, timeout, retry, and pagination limits. - Next: [Get the catalog of scopes and webhook events](https://www.coach-platform.com/docs/api/reference/get-catalog/index.md): `GET /api/public/catalog`. Public catalog of available scopes, webhook events, payload schemas, and docs URL. --- # Get the catalog of scopes and webhook events `GET https://api.coach-platform.com/api/public/catalog` Public catalog of available scopes, webhook events, payload schemas, and docs URL. No auth required. - Resource: Discovery - Authentication: none - HTML version: https://www.coach-platform.com/docs/api/reference/get-catalog - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/catalog' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/catalog', { method: 'GET', }); const data = await response.json(); ``` ## Related endpoints - [Check API health](https://www.coach-platform.com/docs/api/reference/get-health/index.md): `GET /api/public/health`. Public health check. - [Get the AI agent guide (llms.txt)](https://www.coach-platform.com/docs/api/reference/get-llms-txt/index.md): `GET /api/public/llms.txt`. Plain-text guide for AI agents: auth, conventions, machine-readable references, and the MCP tool list. - [List error codes](https://www.coach-platform.com/docs/api/reference/get-errors/index.md): `GET /api/public/errors`. Reference for every error code returned by the API. - [Get the API changelog](https://www.coach-platform.com/docs/api/reference/get-changelog/index.md): `GET /api/public/changelog`. Changelog of breaking and non-breaking changes to this API. - [Get API limits](https://www.coach-platform.com/docs/api/reference/get-limits/index.md): `GET /api/public/limits`. Body size, timeout, retry, and pagination limits. - Previous: [Check API health](https://www.coach-platform.com/docs/api/reference/get-health/index.md): `GET /api/public/health`. Public health check. - Next: [Get the AI agent guide (llms.txt)](https://www.coach-platform.com/docs/api/reference/get-llms-txt/index.md): `GET /api/public/llms.txt`. Plain-text guide for AI agents: auth, conventions, machine-readable references, and the MCP tool list. --- # Get the AI agent guide (llms.txt) `GET https://api.coach-platform.com/api/public/llms.txt` Plain-text guide for AI agents: auth, conventions, machine-readable references, and the MCP tool list. No auth required. - Resource: Discovery - Authentication: none - HTML version: https://www.coach-platform.com/docs/api/reference/get-llms-txt - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/llms.txt' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/llms.txt', { method: 'GET', }); const text = await response.text(); ``` ## Related endpoints - [Check API health](https://www.coach-platform.com/docs/api/reference/get-health/index.md): `GET /api/public/health`. Public health check. - [Get the catalog of scopes and webhook events](https://www.coach-platform.com/docs/api/reference/get-catalog/index.md): `GET /api/public/catalog`. Public catalog of available scopes, webhook events, payload schemas, and docs URL. - [List error codes](https://www.coach-platform.com/docs/api/reference/get-errors/index.md): `GET /api/public/errors`. Reference for every error code returned by the API. - [Get the API changelog](https://www.coach-platform.com/docs/api/reference/get-changelog/index.md): `GET /api/public/changelog`. Changelog of breaking and non-breaking changes to this API. - [Get API limits](https://www.coach-platform.com/docs/api/reference/get-limits/index.md): `GET /api/public/limits`. Body size, timeout, retry, and pagination limits. - Previous: [Get the catalog of scopes and webhook events](https://www.coach-platform.com/docs/api/reference/get-catalog/index.md): `GET /api/public/catalog`. Public catalog of available scopes, webhook events, payload schemas, and docs URL. - Next: [List error codes](https://www.coach-platform.com/docs/api/reference/get-errors/index.md): `GET /api/public/errors`. Reference for every error code returned by the API. --- # List error codes `GET https://api.coach-platform.com/api/public/errors` Reference for every error code returned by the API. No auth required. - Resource: Discovery - Authentication: none - HTML version: https://www.coach-platform.com/docs/api/reference/get-errors - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/errors' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/errors', { method: 'GET', }); const data = await response.json(); ``` ## Related endpoints - [Check API health](https://www.coach-platform.com/docs/api/reference/get-health/index.md): `GET /api/public/health`. Public health check. - [Get the catalog of scopes and webhook events](https://www.coach-platform.com/docs/api/reference/get-catalog/index.md): `GET /api/public/catalog`. Public catalog of available scopes, webhook events, payload schemas, and docs URL. - [Get the AI agent guide (llms.txt)](https://www.coach-platform.com/docs/api/reference/get-llms-txt/index.md): `GET /api/public/llms.txt`. Plain-text guide for AI agents: auth, conventions, machine-readable references, and the MCP tool list. - [Get the API changelog](https://www.coach-platform.com/docs/api/reference/get-changelog/index.md): `GET /api/public/changelog`. Changelog of breaking and non-breaking changes to this API. - [Get API limits](https://www.coach-platform.com/docs/api/reference/get-limits/index.md): `GET /api/public/limits`. Body size, timeout, retry, and pagination limits. - Previous: [Get the AI agent guide (llms.txt)](https://www.coach-platform.com/docs/api/reference/get-llms-txt/index.md): `GET /api/public/llms.txt`. Plain-text guide for AI agents: auth, conventions, machine-readable references, and the MCP tool list. - Next: [Get the API changelog](https://www.coach-platform.com/docs/api/reference/get-changelog/index.md): `GET /api/public/changelog`. Changelog of breaking and non-breaking changes to this API. --- # Get the API changelog `GET https://api.coach-platform.com/api/public/changelog` Changelog of breaking and non-breaking changes to this API. No auth required. - Resource: Discovery - Authentication: none - HTML version: https://www.coach-platform.com/docs/api/reference/get-changelog - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/changelog' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/changelog', { method: 'GET', }); const data = await response.json(); ``` ## Related endpoints - [Check API health](https://www.coach-platform.com/docs/api/reference/get-health/index.md): `GET /api/public/health`. Public health check. - [Get the catalog of scopes and webhook events](https://www.coach-platform.com/docs/api/reference/get-catalog/index.md): `GET /api/public/catalog`. Public catalog of available scopes, webhook events, payload schemas, and docs URL. - [Get the AI agent guide (llms.txt)](https://www.coach-platform.com/docs/api/reference/get-llms-txt/index.md): `GET /api/public/llms.txt`. Plain-text guide for AI agents: auth, conventions, machine-readable references, and the MCP tool list. - [List error codes](https://www.coach-platform.com/docs/api/reference/get-errors/index.md): `GET /api/public/errors`. Reference for every error code returned by the API. - [Get API limits](https://www.coach-platform.com/docs/api/reference/get-limits/index.md): `GET /api/public/limits`. Body size, timeout, retry, and pagination limits. - Previous: [List error codes](https://www.coach-platform.com/docs/api/reference/get-errors/index.md): `GET /api/public/errors`. Reference for every error code returned by the API. - Next: [Get API limits](https://www.coach-platform.com/docs/api/reference/get-limits/index.md): `GET /api/public/limits`. Body size, timeout, retry, and pagination limits. --- # Get API limits `GET https://api.coach-platform.com/api/public/limits` Body size, timeout, retry, and pagination limits. No auth required. - Resource: Discovery - Authentication: none - HTML version: https://www.coach-platform.com/docs/api/reference/get-limits - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/limits' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/limits', { method: 'GET', }); const data = await response.json(); ``` ## Related endpoints - [Check API health](https://www.coach-platform.com/docs/api/reference/get-health/index.md): `GET /api/public/health`. Public health check. - [Get the catalog of scopes and webhook events](https://www.coach-platform.com/docs/api/reference/get-catalog/index.md): `GET /api/public/catalog`. Public catalog of available scopes, webhook events, payload schemas, and docs URL. - [Get the AI agent guide (llms.txt)](https://www.coach-platform.com/docs/api/reference/get-llms-txt/index.md): `GET /api/public/llms.txt`. Plain-text guide for AI agents: auth, conventions, machine-readable references, and the MCP tool list. - [List error codes](https://www.coach-platform.com/docs/api/reference/get-errors/index.md): `GET /api/public/errors`. Reference for every error code returned by the API. - [Get the API changelog](https://www.coach-platform.com/docs/api/reference/get-changelog/index.md): `GET /api/public/changelog`. Changelog of breaking and non-breaking changes to this API. - Previous: [Get the API changelog](https://www.coach-platform.com/docs/api/reference/get-changelog/index.md): `GET /api/public/changelog`. Changelog of breaking and non-breaking changes to this API. - Next: [Get the authenticated coach profile](https://www.coach-platform.com/docs/api/reference/get-me/index.md): `GET /api/public/me`. Returns the authenticated coach profile (name, email, plan limits). --- # Get the authenticated coach profile `GET https://api.coach-platform.com/api/public/me` Returns the authenticated coach profile (name, email, plan limits). - Resource: Coach - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-me - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.name` | string | | | `data.email` | string | | | `data.phoneNumber` | string | | | `data.businessName` | string | | | `data.businessType` | string | | | `data.workMethod` | string | | | `data.businessColor` | string | | | `data.profileImageUrl` | string | | | `data.activeTraineesCount` | number | | | `data.traineesLimit` | number | | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "name": "", "email": "", "phoneNumber": "", "businessName": "", "businessType": "", "workMethod": "", "businessColor": "", "profileImageUrl": "", "activeTraineesCount": 123, "traineesLimit": 123, "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/me' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/me', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - Previous: [Get API limits](https://www.coach-platform.com/docs/api/reference/get-limits/index.md): `GET /api/public/limits`. Body size, timeout, retry, and pagination limits. - Next: [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. --- # List trainees `GET https://api.coach-platform.com/api/public/trainees` List trainees of the coach, filterable by label/search. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | string | No | Page number (1-based, default 1) | | `limit` | string | No | Items per page (1-500, default 25) | | `search` | string | No | Search by name, email, or phone | | `labelId` | string | No | Filter to trainees with this label | | `email` | string | No | Match by email (case insensitive) | | `phone` | string | No | Match by phone number | | `status` | string | No | Filter by coaching status. "active" = has an active coaching period. "pending" = invited but not yet approved by the coach; these trainees are not returned by the other filters, and their activeCoachDetails.pendingCoachDate tells you how long they have been waiting. "archived" = removed with DELETE /trainees/{traineeId}; they are excluded from every other filter and from GET /trainees/{traineeId}, which answers 403 for them, so this is the only way to see them. Archived results carry no activeCoachDetails, and support only page, limit, search, email and phone. Bring one back with POST /trainees/{traineeId}/restore. Allowed values: `active`, `inactive`, `pending`, `archived`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].name` | string | | | `data[].email` | string | | | `data[].phoneNumber` | string | | | `data[].goal` | string | | | `data[].profileImageUrl` | string | | | `data[].personalDetails` | object | | | `data[].labels` | object[] | | | `data[].labels[].id` | string | | | `data[].labels[].text` | string | | | `data[].labels[].color` | string | | | `data[].labels[].coachId` | string | | | `data[].assignedEmployees` | object[] | | | `data[].assignedEmployees[].id` | string | | | `data[].assignedEmployees[].name` | string | | | `data[].activeCoachDetails` | object | | | `data[].activeCoachDetails.activeEscort` | string \| null | Id of the escort currently in use for this trainee. Fetch the full escort with GET /escorts/{escortId}. | | `data[].activeCoachDetails.pendingCoach` | string \| null | Coach id this trainee is pending approval for. Set when the trainee was invited but has not been approved yet; null once approved. Use ?status=pending on GET /trainees to list only these. | | `data[].activeCoachDetails.pendingCoachDate` | string \| null | When the trainee entered the pending state. Use it to measure how long approval has been waiting. | | `data[].createdAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "name": "", "email": "", "phoneNumber": "", "goal": "", "profileImageUrl": "", "personalDetails": {}, "labels": [ { "id": "", "text": "", "color": "", "coachId": "" } ], "assignedEmployees": [ { "id": "", "name": "" } ], "activeCoachDetails": { "activeEscort": "", "pendingCoach": "", "pendingCoachDate": "" }, "createdAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Get the authenticated coach profile](https://www.coach-platform.com/docs/api/reference/get-me/index.md): `GET /api/public/me`. Returns the authenticated coach profile (name, email, plan limits). - Next: [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. --- # Create a trainee `POST https://api.coach-platform.com/api/public/trainees` Create a new trainee for the coach. Requires name, email, and phoneNumber. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-trainees - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | Yes | Trainee full name | | `email` | string | Yes | Trainee email | | `phoneNumber` | string | Yes | Trainee phone number | | `goal` | string | No | Optional coaching goal | | `passwordAsPhoneNumber` | boolean | No | Set the trainee login password to their phone number instead of a random one. Israeli numbers are normalized to their local 0-prefixed form, so "+972501234567", "972-50-123-4567" and "050 123 4567" all become the password "0501234567", and the trainee can log in by typing any of those forms. Numbers from every other country are supported too and keep their international form, so "+1 415 555 2671" becomes "+14155552671"; a trainee with a non-Israeli number must include the country code when logging in, because the national form ("415-555-2671") cannot be mapped back. Send a clean number: any extra digits, such as an extension, become part of the password. The resulting password is always returned in the password field of this response and is not retrievable afterwards. Changing the phone number later with PATCH /trainees/{traineeId} does not change the password. Rejected with 400 only when phoneNumber has no digits at all, or fewer than 6 digits; error.details.reason says which. If the email belongs to an existing trainee account that is merely attached to the coach, that account keeps its current password and a warning is returned. | | `labels` | string[] | No | Optional ids of existing labels to attach. Each item must be the label id (24-character MongoDB ObjectId) as returned in the id field of GET /labels — not the label text. Label text is not accepted here and no new label is created; to attach a label by text, or to create one, use POST /trainees/{traineeId}/labels instead. Requires the labels:write scope: without it the trainee is still created and a warning is returned in the warnings array. Maximum items: `100`. | | `sendCredentials` | object | No | Deliver the new trainee their app access details as part of creating them, instead of calling POST /trainees/{traineeId}/send-credentials afterwards (which would reset the password again). Only applies to a newly created account: if the email belongs to an existing trainee that is merely attached to this coach, that account keeps its current password, nothing is sent, and a warning is returned. | | `sendCredentials.email` | boolean | No | Email the trainee their app access details right after creation. | | `sendCredentials.whatsapp` | boolean | No | Also send the access details over WhatsApp, followed by the password in a separate message. Requires a connected WhatsApp account and a phone number on the trainee. | | `whatsappTemplate` | string | No | Optional message wording used when sendCredentials.whatsapp is true, with the {firstName}, {email}, {password} and {appLink} placeholders. When omitted, the template saved in the dashboard is used, then a built-in default. The password is always sent in a separate follow-up message, so the template normally does not need {password}. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.name` | string | | | `data.email` | string | | | `data.phoneNumber` | string | | | `data.goal` | string | | | `data.profileImageUrl` | string | | | `data.personalDetails` | object | | | `data.labels` | object[] | | | `data.labels[].id` | string | | | `data.labels[].text` | string | | | `data.labels[].color` | string | | | `data.labels[].coachId` | string | | | `data.assignedEmployees` | object[] | | | `data.assignedEmployees[].id` | string | | | `data.assignedEmployees[].name` | string | | | `data.activeCoachDetails` | object | | | `data.activeCoachDetails.activeEscort` | string \| null | Id of the escort currently in use for this trainee. Fetch the full escort with GET /escorts/{escortId}. | | `data.activeCoachDetails.pendingCoach` | string \| null | Coach id this trainee is pending approval for. Set when the trainee was invited but has not been approved yet; null once approved. Use ?status=pending on GET /trainees to list only these. | | `data.activeCoachDetails.pendingCoachDate` | string \| null | When the trainee entered the pending state. Use it to measure how long approval has been waiting. | | `data.createdAt` | string | | | `data.password` | string | Login password, returned only in this create response and never retrievable again. Randomly generated, or the normalized phone number when passwordAsPhoneNumber was sent as true. Present only when a brand-new trainee account was created; absent when an existing trainee was attached to the coach. Calling POST /trainees/{traineeId}/send-credentials resets it. | | `data.credentialsSent` | object | Present only when sendCredentials was supplied. Reports which channels the access details were handed off to for delivery. A false value is always explained by an entry in warnings. WhatsApp delivery happens in the background and is spaced out to protect the account, so true means the message was queued, not that it has already arrived. | | `data.credentialsSent.email` | boolean | | | `data.credentialsSent.whatsapp` | boolean | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "name": "", "email": "", "phoneNumber": "", "goal": "", "profileImageUrl": "", "personalDetails": {}, "labels": [ { "id": "", "text": "", "color": "", "coachId": "" } ], "assignedEmployees": [ { "id": "", "name": "" } ], "activeCoachDetails": { "activeEscort": "", "pendingCoach": "", "pendingCoachDate": "" }, "createdAt": "", "password": "", "credentialsSent": { "email": true, "whatsapp": true } }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/trainees' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "name": "", "email": "", "phoneNumber": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "", "email": "", "phoneNumber": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - Next: [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. --- # Approve or reject pending trainees `POST https://api.coach-platform.com/api/public/trainees/pending` Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. Approving counts them against the coach's trainee limit and returns 422 if that limit would be exceeded. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-trainees-pending - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeIds` | string[] | Yes | Ids of trainees currently in the pending queue. Ids that are not pending make the whole request fail with 422. Minimum items: `1`. Maximum items: `500`. | | `approve` | boolean | Yes | true to approve the trainees, false to reject them. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.success` | boolean | | Example: ```json { "data": { "success": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/trainees/pending' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeIds": [ "" ], "approve": true }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees/pending', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeIds": [ "" ], "approve": true }), }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - Next: [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. --- # Get a trainee `GET https://api.coach-platform.com/api/public/trainees/{traineeId}` Get a single trainee by id. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.name` | string | | | `data.email` | string | | | `data.phoneNumber` | string | | | `data.goal` | string | | | `data.profileImageUrl` | string | | | `data.personalDetails` | object | | | `data.labels` | object[] | | | `data.labels[].id` | string | | | `data.labels[].text` | string | | | `data.labels[].color` | string | | | `data.labels[].coachId` | string | | | `data.assignedEmployees` | object[] | | | `data.assignedEmployees[].id` | string | | | `data.assignedEmployees[].name` | string | | | `data.activeCoachDetails` | object | | | `data.activeCoachDetails.activeEscort` | string \| null | Id of the escort currently in use for this trainee. Fetch the full escort with GET /escorts/{escortId}. | | `data.activeCoachDetails.pendingCoach` | string \| null | Coach id this trainee is pending approval for. Set when the trainee was invited but has not been approved yet; null once approved. Use ?status=pending on GET /trainees to list only these. | | `data.activeCoachDetails.pendingCoachDate` | string \| null | When the trainee entered the pending state. Use it to measure how long approval has been waiting. | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "name": "", "email": "", "phoneNumber": "", "goal": "", "profileImageUrl": "", "personalDetails": {}, "labels": [ { "id": "", "text": "", "color": "", "coachId": "" } ], "assignedEmployees": [ { "id": "", "name": "" } ], "activeCoachDetails": { "activeEscort": "", "pendingCoach": "", "pendingCoachDate": "" }, "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - Next: [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. --- # Update a trainee `PATCH https://api.coach-platform.com/api/public/trainees/{traineeId}` Update a trainee's personal details. Only supplied fields change. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | No | | | `phoneNumber` | string | No | | | `goal` | string | No | | | `height` | number | No | Height in cm. Must not be negative. Minimum: `0`. | | `dateOfBirth` | string | No | Date of birth as an ISO date, for example 1990-04-23. Pattern: `^\d{4}-\d{2}-\d{2}`. | | `gender` | string | No | One of: Male, Female, Other. Matching is case-insensitive, so "male" is accepted and stored as "Male". | | `activityLevel` | string | No | One of: Sedentary, Lightly Active, Moderately Active, Very Active, Extremely Active. Matching is case-insensitive. Feeds the TDEE calculation, so changing it changes the calorie targets derived for this trainee. Weight is NOT set here: it is a dated history, use POST /trainees/{traineeId}/body-metrics. | | `injuries` | string | No | | | `healthConditions` | string | No | | | `allergies` | string | No | | | `foodPreferences` | string | No | | | `foodDislikes` | string | No | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.name` | string | | | `data.email` | string | | | `data.phoneNumber` | string | | | `data.goal` | string | | | `data.profileImageUrl` | string | | | `data.personalDetails` | object | | | `data.labels` | object[] | | | `data.labels[].id` | string | | | `data.labels[].text` | string | | | `data.labels[].color` | string | | | `data.labels[].coachId` | string | | | `data.assignedEmployees` | object[] | | | `data.assignedEmployees[].id` | string | | | `data.assignedEmployees[].name` | string | | | `data.activeCoachDetails` | object | | | `data.activeCoachDetails.activeEscort` | string \| null | Id of the escort currently in use for this trainee. Fetch the full escort with GET /escorts/{escortId}. | | `data.activeCoachDetails.pendingCoach` | string \| null | Coach id this trainee is pending approval for. Set when the trainee was invited but has not been approved yet; null once approved. Use ?status=pending on GET /trainees to list only these. | | `data.activeCoachDetails.pendingCoachDate` | string \| null | When the trainee entered the pending state. Use it to measure how long approval has been waiting. | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "name": "", "email": "", "phoneNumber": "", "goal": "", "profileImageUrl": "", "personalDetails": {}, "labels": [ { "id": "", "text": "", "color": "", "coachId": "" } ], "assignedEmployees": [ { "id": "", "name": "" } ], "activeCoachDetails": { "activeEscort": "", "pendingCoach": "", "pendingCoachDate": "" }, "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request PATCH \ --url 'https://api.coach-platform.com/api/public/trainees/' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "name": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees/', { method: 'PATCH', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - Next: [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. --- # Remove a trainee `DELETE https://api.coach-platform.com/api/public/trainees/{traineeId}` Remove a trainee from the coach account. This ends the active escort, cancels their upcoming meetings, unlinks their training plan and nutrition menu and deletes their gamification profile. The trainee is archived rather than erased: their account, history and measurements are kept, they stop counting against your trainee limit, and they disappear from GET /trainees and from GET /trainees/{traineeId}, which answers 403 for them afterwards. List archived trainees with GET /trainees?status=archived and bring one back with POST /trainees/{traineeId}/restore. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.deleted` | boolean | | Example: ```json { "data": { "id": "", "deleted": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request DELETE \ --url 'https://api.coach-platform.com/api/public/trainees/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees/', { method: 'DELETE', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - Next: [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. --- # Restore an archived trainee `POST https://api.coach-platform.com/api/public/trainees/{traineeId}/restore` Bring a trainee back from the archive, exactly as the dashboard does it. Their last coaching period with you is revived (status Active when its end date is still ahead, Finished when it has passed) and its training plan and nutrition menu are re-linked, so the trainee keeps the history they had before being removed. A trainee with no previous coaching period is simply moved back to the active list. A training plan or nutrition menu that was deleted while the trainee was archived is not re-linked: the coaching period comes back without an active plan or menu, the deleted training plan stays in the trainee's plan history, and data.detachedDeletedPlans reports it (training / nutrition set to true). When either flag is true, tell the coach and assign a new plan or menu. Use this instead of POST /trainees for a returning trainee: re-creating them by email does attach the same account rather than a duplicate, but it leaves them without a coaching period, plan or menu, which looks like a brand-new empty trainee. Fires the trainee.restored webhook. Returns 404 when the trainee is not in the archive (list it with GET /trainees?status=archived), 422 when restoring would exceed your trainee limit, and 422 when the trainee has since been taken on by another coach. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.name` | string | | | `data.email` | string | | | `data.phoneNumber` | string | | | `data.goal` | string | | | `data.profileImageUrl` | string | | | `data.personalDetails` | object | | | `data.labels` | object[] | | | `data.labels[].id` | string | | | `data.labels[].text` | string | | | `data.labels[].color` | string | | | `data.labels[].coachId` | string | | | `data.assignedEmployees` | object[] | | | `data.assignedEmployees[].id` | string | | | `data.assignedEmployees[].name` | string | | | `data.activeCoachDetails` | object | | | `data.activeCoachDetails.activeEscort` | string \| null | Id of the escort currently in use for this trainee. Fetch the full escort with GET /escorts/{escortId}. | | `data.activeCoachDetails.pendingCoach` | string \| null | Coach id this trainee is pending approval for. Set when the trainee was invited but has not been approved yet; null once approved. Use ?status=pending on GET /trainees to list only these. | | `data.activeCoachDetails.pendingCoachDate` | string \| null | When the trainee entered the pending state. Use it to measure how long approval has been waiting. | | `data.createdAt` | string | | | `data.detachedDeletedPlans` | object | Which of the restored coaching period's previous assignments were left out because they were deleted while the trainee was archived. training is true when the training plan was deleted, nutrition is true when the nutrition menu was deleted. A deleted plan or menu is never re-linked: the coaching period is left without an active plan or menu, and the deleted training plan stays visible in the trainee's plan history. When either is true, assign a new one (POST /training-plans or POST /nutrition-menus with the traineeId). | | `data.detachedDeletedPlans.training` | boolean | | | `data.detachedDeletedPlans.nutrition` | boolean | | Example: ```json { "data": { "id": "", "name": "", "email": "", "phoneNumber": "", "goal": "", "profileImageUrl": "", "personalDetails": {}, "labels": [ { "id": "", "text": "", "color": "", "coachId": "" } ], "assignedEmployees": [ { "id": "", "name": "" } ], "activeCoachDetails": { "activeEscort": "", "pendingCoach": "", "pendingCoachDate": "" }, "createdAt": "", "detachedDeletedPlans": { "training": true, "nutrition": true } } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/trainees//restore' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//restore', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - Next: [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. --- # Send access details to a trainee `POST https://api.coach-platform.com/api/public/trainees/{traineeId}/send-credentials` Send the trainee their app access details by email, and optionally by WhatsApp. This generates a new password for the trainee and emails it to them, so it doubles as a password reset. Use it after creating a trainee, since POST /trainees does not send access details on its own. Set sendWhatsApp to true to also deliver the details over WhatsApp, which requires a connected WhatsApp account and a trainee phone number; the password follows in a separate message. Provide whatsappTemplate to override the message, using the {firstName}, {email}, {password} and {appLink} placeholders; when omitted the template saved in the dashboard is used. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `sendWhatsApp` | boolean | No | | | `whatsappTemplate` | string | No | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.sent` | boolean | | | `data.whatsappSent` | boolean | | Example: ```json { "data": { "id": "", "sent": true, "whatsappSent": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/trainees//send-credentials' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "sendWhatsApp": true }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//send-credentials', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "sendWhatsApp": true }), }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - Next: [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). --- # Get a trainee's weekly activity `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/weekly-activity` Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). The full cross-domain "what the trainee did" view. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `date` | string | No | Any date in the target week, YYYY-MM-DD. Defaults to current week. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//weekly-activity' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//weekly-activity', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - Next: [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. --- # Get a trainee's body measurements `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/measurements` A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. Every series is returned in full unless you narrow it with from/to or latest, which apply to all series at once. Not paginated: the response is many parallel dated series rather than one list, so a page number has no coherent meaning across them. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `from` | string | No | Only entries measured on or after this date (YYYY-MM-DD). | | `to` | string | No | Only entries measured on or before this date (YYYY-MM-DD). | | `latest` | integer | No | Keep only the most recent N entries of each series, applied after from/to. Use it to ask for a recent trend without pulling years of history. Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//measurements' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//measurements', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - Next: [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. --- # Record a weigh-in `POST https://api.coach-platform.com/api/public/trainees/{traineeId}/body-metrics` Record a weigh-in for a trainee: weight, body fat, and/or body measurements. This is the only way to write weight through the API, because weight is kept as a dated history rather than a single field: the previous value is moved into the history and the new one becomes current. PATCH /trainees/{traineeId} therefore does NOT accept weight. Every field is optional, but send at least one. Send only what was actually measured; omitted fields are left untouched, and each measurement field keeps its own dated history. Measurements are in cm, weight in kg, bodyFat in percent. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `weight` | number | No | Body weight in kg. Becomes the current weight; the previous one is pushed onto the weight history. Minimum: `0`. | | `bodyFat` | number | No | Body fat percentage. Kept as a dated history, exactly like weight. Minimum: `0`. | | `date` | string | No | ISO date this measurement was taken. Defaults to now. Use it to backfill an earlier weigh-in. | | `chest` | number | No | chest in cm. Minimum: `0`. | | `waist` | number | No | waist in cm. Minimum: `0`. | | `rightArm` | number | No | rightArm in cm. Minimum: `0`. | | `leftArm` | number | No | leftArm in cm. Minimum: `0`. | | `rightThigh` | number | No | rightThigh in cm. Minimum: `0`. | | `leftThigh` | number | No | leftThigh in cm. Minimum: `0`. | | `rightCalf` | number | No | rightCalf in cm. Minimum: `0`. | | `leftCalf` | number | No | leftCalf in cm. Minimum: `0`. | | `neck` | number | No | neck in cm. Minimum: `0`. | | `butt` | number | No | butt in cm. Minimum: `0`. | | `navel` | number | No | navel in cm. Minimum: `0`. | | `lowerAbdomen` | number | No | lowerAbdomen in cm. Minimum: `0`. | | `upperAbdomen` | number | No | upperAbdomen in cm. Minimum: `0`. | | `upperHip` | number | No | upperHip in cm. Minimum: `0`. | | `lowerHip` | number | No | lowerHip in cm. Minimum: `0`. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.traineeId` | string | | | `data.date` | string | | | `data.weight` | number \| null | | | `data.bodyFat` | number \| null | | | `data.measurements` | object | The measurement fields recorded by this request, in cm. | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "traineeId": "", "date": "", "weight": 123, "bodyFat": 123, "measurements": {} }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/trainees//body-metrics' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "weight": 123 }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//body-metrics', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "weight": 123 }), }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - Next: [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). --- # List a trainee's progress photos `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/photos` A trainee's progress photos as temporary viewable image URLs (valid a few minutes). Optionally filter by month with date=YYYY-MM. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `date` | string | No | Filter to a month, YYYY-MM. | | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//photos' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//photos', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Previous: [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - Next: [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. --- # List a trainee's personal records `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/personal-records` A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Resource: Trainees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `exerciseIds` | string | No | Optional comma-separated exercise (catalog) ids to filter to. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//personal-records' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//personal-records', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List trainees](https://www.coach-platform.com/docs/api/reference/get-trainees/index.md): `GET /api/public/trainees`. List trainees of the coach, filterable by label/search. - [Create a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees/index.md): `POST /api/public/trainees`. Create a new trainee for the coach. - [Approve or reject pending trainees](https://www.coach-platform.com/docs/api/reference/post-trainees-pending/index.md): `POST /api/public/trainees/pending`. Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. - [Get a trainee](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id/index.md): `GET /api/public/trainees/{traineeId}`. Get a single trainee by id. - [Update a trainee](https://www.coach-platform.com/docs/api/reference/patch-trainees-trainee-id/index.md): `PATCH /api/public/trainees/{traineeId}`. Update a trainee's personal details. - [Remove a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id/index.md): `DELETE /api/public/trainees/{traineeId}`. Remove a trainee from the coach account. - [Restore an archived trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-restore/index.md): `POST /api/public/trainees/{traineeId}/restore`. Bring a trainee back from the archive, exactly as the dashboard does it. - [Send access details to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-send-credentials/index.md): `POST /api/public/trainees/{traineeId}/send-credentials`. Send the trainee their app access details by email, and optionally by WhatsApp. - [Get a trainee's weekly activity](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-weekly-activity/index.md): `GET /api/public/trainees/{traineeId}/weekly-activity`. Day-by-day activity for the week containing the given date (workouts, cardio, nutrition logging, water, measurements, form submissions). - [Get a trainee's body measurements](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-measurements/index.md): `GET /api/public/trainees/{traineeId}/measurements`. A trainee's body measurements: weight history, body-fat history, circumference history, and custom measurement types. - [Record a weigh-in](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-body-metrics/index.md): `POST /api/public/trainees/{traineeId}/body-metrics`. Record a weigh-in for a trainee: weight, body fat, and/or body measurements. - [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - Previous: [List a trainee's progress photos](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-photos/index.md): `GET /api/public/trainees/{traineeId}/photos`. A trainee's progress photos as temporary viewable image URLs (valid a few minutes). - Next: [List labels](https://www.coach-platform.com/docs/api/reference/get-labels/index.md): `GET /api/public/labels`. List all trainee labels (tags) defined by the coach. --- # List labels `GET https://api.coach-platform.com/api/public/labels` List all trainee labels (tags) defined by the coach. - Resource: Labels - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-labels - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].text` | string | | | `data[].color` | string | | | `data[].coachId` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "text": "", "color": "", "coachId": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/labels' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/labels', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md): `POST /api/public/trainees/{traineeId}/labels`. Add labels to a trainee. - [Remove a label from a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id/index.md): `DELETE /api/public/trainees/{traineeId}/labels/{labelId}`. Detach a single label from one trainee. - [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md): `PATCH /api/public/labels/{labelId}`. Rename a label or change its color. - [Delete a label](https://www.coach-platform.com/docs/api/reference/delete-labels-label-id/index.md): `DELETE /api/public/labels/{labelId}`. Delete a label. - Previous: [List a trainee's personal records](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-personal-records/index.md): `GET /api/public/trainees/{traineeId}/personal-records`. A trainee's personal records per exercise: best weight, estimated 1RM, top-set reps, max reps, set and total volume, and max duration, each with the value achieved, the previous record and when it was set. - Next: [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md): `POST /api/public/trainees/{traineeId}/labels`. Add labels to a trainee. --- # Add labels to a trainee `POST https://api.coach-platform.com/api/public/trainees/{traineeId}/labels` Add labels to a trainee. Labels are matched by text and created if new; existing labels can be passed by id. - Resource: Labels - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `labels` | object[] | Yes | Minimum items: `1`. Maximum items: `100`. | | `labels[].id` | string | No | Existing label id to attach | | `labels[].text` | string | No | Label text; created if new | | `labels[].color` | string | No | Tailwind color key, e.g. "blue-500" | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/trainees//labels' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "labels": [ { "id": "" } ] }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//labels', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "labels": [ { "id": "" } ] }), }); const data = await response.json(); ``` ## Related endpoints - [List labels](https://www.coach-platform.com/docs/api/reference/get-labels/index.md): `GET /api/public/labels`. List all trainee labels (tags) defined by the coach. - [Remove a label from a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id/index.md): `DELETE /api/public/trainees/{traineeId}/labels/{labelId}`. Detach a single label from one trainee. - [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md): `PATCH /api/public/labels/{labelId}`. Rename a label or change its color. - [Delete a label](https://www.coach-platform.com/docs/api/reference/delete-labels-label-id/index.md): `DELETE /api/public/labels/{labelId}`. Delete a label. - Previous: [List labels](https://www.coach-platform.com/docs/api/reference/get-labels/index.md): `GET /api/public/labels`. List all trainee labels (tags) defined by the coach. - Next: [Remove a label from a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id/index.md): `DELETE /api/public/trainees/{traineeId}/labels/{labelId}`. Detach a single label from one trainee. --- # Remove a label from a trainee `DELETE https://api.coach-platform.com/api/public/trainees/{traineeId}/labels/{labelId}` Detach a single label from one trainee. The label itself is not deleted and other trainees keep it. Returns journeyOutcome, which reports whether removing this label left the trainee's active journey enrolment without a matching label. - Resource: Labels - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | | `labelId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.message` | string | | | `data.journeyOutcome` | object \| null | | | `data.journeyOutcome.status` | string | | | `data.journeyOutcome.enrollmentId` | string \| null | | | `data.journeyOutcome.journeyId` | string \| null | | | `data.journeyOutcome.journeyTitle` | string \| null | | | `data.journeyOutcome.canAct` | boolean \| null | | Example: ```json { "data": { "message": "", "journeyOutcome": { "status": "", "enrollmentId": "", "journeyId": "", "journeyTitle": "", "canAct": true } } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request DELETE \ --url 'https://api.coach-platform.com/api/public/trainees//labels/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//labels/', { method: 'DELETE', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List labels](https://www.coach-platform.com/docs/api/reference/get-labels/index.md): `GET /api/public/labels`. List all trainee labels (tags) defined by the coach. - [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md): `POST /api/public/trainees/{traineeId}/labels`. Add labels to a trainee. - [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md): `PATCH /api/public/labels/{labelId}`. Rename a label or change its color. - [Delete a label](https://www.coach-platform.com/docs/api/reference/delete-labels-label-id/index.md): `DELETE /api/public/labels/{labelId}`. Delete a label. - Previous: [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md): `POST /api/public/trainees/{traineeId}/labels`. Add labels to a trainee. - Next: [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md): `PATCH /api/public/labels/{labelId}`. Rename a label or change its color. --- # Update a label `PATCH https://api.coach-platform.com/api/public/labels/{labelId}` Rename a label or change its color. - Resource: Labels - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/patch-labels-label-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `labelId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `text` | string | No | | | `color` | string | No | Tailwind color key, e.g. "green-500" | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.text` | string | | | `data.color` | string | | | `data.coachId` | string | | Example: ```json { "data": { "id": "", "text": "", "color": "", "coachId": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request PATCH \ --url 'https://api.coach-platform.com/api/public/labels/' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "text": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/labels/', { method: 'PATCH', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "text": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List labels](https://www.coach-platform.com/docs/api/reference/get-labels/index.md): `GET /api/public/labels`. List all trainee labels (tags) defined by the coach. - [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md): `POST /api/public/trainees/{traineeId}/labels`. Add labels to a trainee. - [Remove a label from a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id/index.md): `DELETE /api/public/trainees/{traineeId}/labels/{labelId}`. Detach a single label from one trainee. - [Delete a label](https://www.coach-platform.com/docs/api/reference/delete-labels-label-id/index.md): `DELETE /api/public/labels/{labelId}`. Delete a label. - Previous: [Remove a label from a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id/index.md): `DELETE /api/public/trainees/{traineeId}/labels/{labelId}`. Detach a single label from one trainee. - Next: [Delete a label](https://www.coach-platform.com/docs/api/reference/delete-labels-label-id/index.md): `DELETE /api/public/labels/{labelId}`. Delete a label. --- # Delete a label `DELETE https://api.coach-platform.com/api/public/labels/{labelId}` Delete a label. Trainees that have this label will keep the others. - Resource: Labels - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/delete-labels-label-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `labelId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request DELETE \ --url 'https://api.coach-platform.com/api/public/labels/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/labels/', { method: 'DELETE', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List labels](https://www.coach-platform.com/docs/api/reference/get-labels/index.md): `GET /api/public/labels`. List all trainee labels (tags) defined by the coach. - [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md): `POST /api/public/trainees/{traineeId}/labels`. Add labels to a trainee. - [Remove a label from a trainee](https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id/index.md): `DELETE /api/public/trainees/{traineeId}/labels/{labelId}`. Detach a single label from one trainee. - [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md): `PATCH /api/public/labels/{labelId}`. Rename a label or change its color. - Previous: [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md): `PATCH /api/public/labels/{labelId}`. Rename a label or change its color. - Next: [Get a coaching period](https://www.coach-platform.com/docs/api/reference/get-escorts-escort-id/index.md): `GET /api/public/escorts/{escortId}`. Get a coaching period by id. --- # Get a coaching period `GET https://api.coach-platform.com/api/public/escorts/{escortId}` Get a coaching period by id. - Resource: Escorts - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-escorts-escort-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `escortId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.trainee` | object | The escorted trainee. email and phoneNumber are returned only when the key also has the trainees:read scope. | | `data.trainee.id` | string | | | `data.trainee.name` | string | | | `data.trainee.email` | string | | | `data.trainee.phoneNumber` | string | | | `data.status` | string | Allowed values: `pending`, `active`, `canceled`, `completed`, `suspended`. | | `data.escortType` | string | | | `data.startDate` | string | | | `data.endDate` | string \| null | When the coaching period ends. null when the escort runs with no time limit, in which case isUnlimited is true. | | `data.months` | integer \| null | Duration in months. null when the escort runs with no time limit. | | `data.isUnlimited` | boolean | True when the escort has no end date. | | `data.training` | object | | | `data.training.activeTrainingPlan` | object \| null | | | `data.training.activeTrainingPlan.id` | string | | | `data.training.activeTrainingPlan.title` | string | | | `data.training.activeTrainingPlan.level` | string | | | `data.training.trainingDays` | any | | | `data.nutrition` | object | | | `data.nutrition.activeNutritionPlan` | object \| null | | | `data.nutrition.activeNutritionPlan.id` | string | | | `data.nutrition.activeNutritionPlan.title` | string | | | `data.nutrition.activeNutritionPlan.level` | string | | | `data.skipRegistrationForms` | boolean | true when the trainee is not asked to fill registration forms in the app during this coaching period. Change it with PATCH /escorts/{escortId}. | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "trainee": { "id": "", "name": "", "email": "", "phoneNumber": "" }, "status": "pending", "escortType": "", "startDate": "", "endDate": "", "months": 123, "isUnlimited": true, "training": { "activeTrainingPlan": { "id": "", "title": "", "level": "" }, "trainingDays": null }, "nutrition": { "activeNutritionPlan": { "id": "", "title": "", "level": "" } }, "skipRegistrationForms": true, "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/escorts/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/escorts/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Update a coaching period](https://www.coach-platform.com/docs/api/reference/patch-escorts-escort-id/index.md): `PATCH /api/public/escorts/{escortId}`. Update a coaching period. - [Cancel a coaching period](https://www.coach-platform.com/docs/api/reference/delete-escorts-escort-id/index.md): `DELETE /api/public/escorts/{escortId}`. Cancel a coaching period. - [Start a coaching period](https://www.coach-platform.com/docs/api/reference/post-escorts/index.md): `POST /api/public/escorts`. Start a new coaching period (escort) for a trainee. - Previous: [Delete a label](https://www.coach-platform.com/docs/api/reference/delete-labels-label-id/index.md): `DELETE /api/public/labels/{labelId}`. Delete a label. - Next: [Update a coaching period](https://www.coach-platform.com/docs/api/reference/patch-escorts-escort-id/index.md): `PATCH /api/public/escorts/{escortId}`. Update a coaching period. --- # Update a coaching period `PATCH https://api.coach-platform.com/api/public/escorts/{escortId}` Update a coaching period. Only supplied fields change. Plan reassignment is not supported here, but the active plan or menu can be detached: send removeTrainingPlan or removeNutritionPlan as true to leave the trainee without an active training plan or nutrition menu (the plan or menu itself is kept and moves to the trainee's history). Send skipRegistrationForms to stop or resume asking the trainee to fill registration forms in the app. - Resource: Escorts - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/patch-escorts-escort-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `escortId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `goal` | string | No | | | `startDate` | string | No | | | `endDate` | string | No | | | `months` | number | No | | | `price` | number | No | | | `paymentDate` | string | No | | | `paymentMethod` | string | No | Allowed values: `Cash`, `Credit card`, `Bank transfer`, `Other`. | | `paymentNumber` | number | No | | | `escortMeetingType` | string | No | Allowed values: `Online`, `In person`. | | `onlineEscort` | string | No | | | `inPersonEscort` | string | No | | | `cardioDays` | number | No | | | `cardioTime` | number | No | | | `trainingDays` | number | No | | | `dailyStepsTarget` | number | No | | | `note` | string | No | Append a note to the coaching period. | | `skipRegistrationForms` | boolean | No | true: the trainee is not asked to fill registration forms in the app during this coaching period. false: the app asks the trainee to fill every active registration form aimed at them that they have not filled yet. Defaults to true when omitted on create. This is the same switch as the registration-forms toggle on the trainee profile. It belongs to this coaching period only, and a link to a specific form sent to the trainee keeps working either way. | | `removeTrainingPlan` | boolean | No | true detaches the active training plan from this coaching period without deleting the plan. The plan moves to the trainee's plan history and the trainee has no active training plan until a new one is assigned. Future scheduled plan changes are kept. Does nothing when no training plan is active. Cannot be combined with assigning a training plan in the same request. | | `removeNutritionPlan` | boolean | No | true detaches the active nutrition menu from this coaching period without deleting the menu. The menu moves to the trainee's menu history and the trainee has no active nutrition menu until a new one is assigned. Future scheduled menu changes are kept. Does nothing when no nutrition menu is active. Cannot be combined with assigning a nutrition menu in the same request. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.trainee` | object | The escorted trainee. email and phoneNumber are returned only when the key also has the trainees:read scope. | | `data.trainee.id` | string | | | `data.trainee.name` | string | | | `data.trainee.email` | string | | | `data.trainee.phoneNumber` | string | | | `data.status` | string | Allowed values: `pending`, `active`, `canceled`, `completed`, `suspended`. | | `data.escortType` | string | | | `data.startDate` | string | | | `data.endDate` | string \| null | When the coaching period ends. null when the escort runs with no time limit, in which case isUnlimited is true. | | `data.months` | integer \| null | Duration in months. null when the escort runs with no time limit. | | `data.isUnlimited` | boolean | True when the escort has no end date. | | `data.training` | object | | | `data.training.activeTrainingPlan` | object \| null | | | `data.training.activeTrainingPlan.id` | string | | | `data.training.activeTrainingPlan.title` | string | | | `data.training.activeTrainingPlan.level` | string | | | `data.training.trainingDays` | any | | | `data.nutrition` | object | | | `data.nutrition.activeNutritionPlan` | object \| null | | | `data.nutrition.activeNutritionPlan.id` | string | | | `data.nutrition.activeNutritionPlan.title` | string | | | `data.nutrition.activeNutritionPlan.level` | string | | | `data.skipRegistrationForms` | boolean | true when the trainee is not asked to fill registration forms in the app during this coaching period. Change it with PATCH /escorts/{escortId}. | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "trainee": { "id": "", "name": "", "email": "", "phoneNumber": "" }, "status": "pending", "escortType": "", "startDate": "", "endDate": "", "months": 123, "isUnlimited": true, "training": { "activeTrainingPlan": { "id": "", "title": "", "level": "" }, "trainingDays": null }, "nutrition": { "activeNutritionPlan": { "id": "", "title": "", "level": "" } }, "skipRegistrationForms": true, "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request PATCH \ --url 'https://api.coach-platform.com/api/public/escorts/' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "goal": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/escorts/', { method: 'PATCH', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "goal": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Get a coaching period](https://www.coach-platform.com/docs/api/reference/get-escorts-escort-id/index.md): `GET /api/public/escorts/{escortId}`. Get a coaching period by id. - [Cancel a coaching period](https://www.coach-platform.com/docs/api/reference/delete-escorts-escort-id/index.md): `DELETE /api/public/escorts/{escortId}`. Cancel a coaching period. - [Start a coaching period](https://www.coach-platform.com/docs/api/reference/post-escorts/index.md): `POST /api/public/escorts`. Start a new coaching period (escort) for a trainee. - Previous: [Get a coaching period](https://www.coach-platform.com/docs/api/reference/get-escorts-escort-id/index.md): `GET /api/public/escorts/{escortId}`. Get a coaching period by id. - Next: [Cancel a coaching period](https://www.coach-platform.com/docs/api/reference/delete-escorts-escort-id/index.md): `DELETE /api/public/escorts/{escortId}`. Cancel a coaching period. --- # Cancel a coaching period `DELETE https://api.coach-platform.com/api/public/escorts/{escortId}` Cancel a coaching period. The trainee keeps their history. - Resource: Escorts - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/delete-escorts-escort-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `escortId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `cancelReason` | string | No | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.trainee` | object | The escorted trainee. email and phoneNumber are returned only when the key also has the trainees:read scope. | | `data.trainee.id` | string | | | `data.trainee.name` | string | | | `data.trainee.email` | string | | | `data.trainee.phoneNumber` | string | | | `data.status` | string | Allowed values: `pending`, `active`, `canceled`, `completed`, `suspended`. | | `data.escortType` | string | | | `data.startDate` | string | | | `data.endDate` | string \| null | When the coaching period ends. null when the escort runs with no time limit, in which case isUnlimited is true. | | `data.months` | integer \| null | Duration in months. null when the escort runs with no time limit. | | `data.isUnlimited` | boolean | True when the escort has no end date. | | `data.training` | object | | | `data.training.activeTrainingPlan` | object \| null | | | `data.training.activeTrainingPlan.id` | string | | | `data.training.activeTrainingPlan.title` | string | | | `data.training.activeTrainingPlan.level` | string | | | `data.training.trainingDays` | any | | | `data.nutrition` | object | | | `data.nutrition.activeNutritionPlan` | object \| null | | | `data.nutrition.activeNutritionPlan.id` | string | | | `data.nutrition.activeNutritionPlan.title` | string | | | `data.nutrition.activeNutritionPlan.level` | string | | | `data.skipRegistrationForms` | boolean | true when the trainee is not asked to fill registration forms in the app during this coaching period. Change it with PATCH /escorts/{escortId}. | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "trainee": { "id": "", "name": "", "email": "", "phoneNumber": "" }, "status": "pending", "escortType": "", "startDate": "", "endDate": "", "months": 123, "isUnlimited": true, "training": { "activeTrainingPlan": { "id": "", "title": "", "level": "" }, "trainingDays": null }, "nutrition": { "activeNutritionPlan": { "id": "", "title": "", "level": "" } }, "skipRegistrationForms": true, "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request DELETE \ --url 'https://api.coach-platform.com/api/public/escorts/' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "cancelReason": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/escorts/', { method: 'DELETE', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "cancelReason": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Get a coaching period](https://www.coach-platform.com/docs/api/reference/get-escorts-escort-id/index.md): `GET /api/public/escorts/{escortId}`. Get a coaching period by id. - [Update a coaching period](https://www.coach-platform.com/docs/api/reference/patch-escorts-escort-id/index.md): `PATCH /api/public/escorts/{escortId}`. Update a coaching period. - [Start a coaching period](https://www.coach-platform.com/docs/api/reference/post-escorts/index.md): `POST /api/public/escorts`. Start a new coaching period (escort) for a trainee. - Previous: [Update a coaching period](https://www.coach-platform.com/docs/api/reference/patch-escorts-escort-id/index.md): `PATCH /api/public/escorts/{escortId}`. Update a coaching period. - Next: [Start a coaching period](https://www.coach-platform.com/docs/api/reference/post-escorts/index.md): `POST /api/public/escorts`. Start a new coaching period (escort) for a trainee. --- # Start a coaching period `POST https://api.coach-platform.com/api/public/escorts` Start a new coaching period (escort) for a trainee. The plan ids required depend on escortType: "Training" needs trainingPlanId, "Nutrition" needs nutritionMenuId, "Nutrition and training" needs both, and "Other" needs neither. Create the plan or menu first (POST /training-plans, POST /nutrition-menus) and pass its id here. A trainee may only have one active escort at a time. - Resource: Escorts - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-escorts - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | | `escortType` | string | Yes | Determines which plan ids are required: Training -> trainingPlanId, Nutrition -> nutritionMenuId, Nutrition and training -> both, Other -> none. Allowed values: `Nutrition`, `Training`, `Nutrition and training`, `Other`. | | `startDate` | string | Yes | ISO date. | | `endDate` | string | No | ISO date. Provide this or months. | | `months` | number | No | Duration in months. Provide this or endDate. | | `goal` | string | No | | | `price` | number | No | | | `paymentDate` | string | No | | | `paymentMethod` | string | No | Allowed values: `Cash`, `Credit card`, `Bank transfer`, `Other`. | | `paymentNumber` | number | No | | | `escortMeetingType` | string | No | Allowed values: `Online`, `In person`. | | `onlineEscort` | string | No | | | `inPersonEscort` | string | No | | | `notes` | string | No | Optional first note on the coaching period. | | `cardioDays` | number | No | | | `cardioTime` | number | No | | | `trainingDays` | number | No | | | `dailyStepsTarget` | number | No | | | `trainingPlanId` | string | No | Assign an existing training plan. Required when escortType is "Training" or "Nutrition and training". | | `nutritionMenuId` | string | No | Assign an existing nutrition menu. Required when escortType is "Nutrition" or "Nutrition and training". | | `skipRegistrationForms` | boolean | No | true: the trainee is not asked to fill registration forms in the app during this coaching period. false: the app asks the trainee to fill every active registration form aimed at them that they have not filled yet. Defaults to true when omitted on create. This is the same switch as the registration-forms toggle on the trainee profile. It belongs to this coaching period only, and a link to a specific form sent to the trainee keeps working either way. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.trainee` | object | The escorted trainee. email and phoneNumber are returned only when the key also has the trainees:read scope. | | `data.trainee.id` | string | | | `data.trainee.name` | string | | | `data.trainee.email` | string | | | `data.trainee.phoneNumber` | string | | | `data.status` | string | Allowed values: `pending`, `active`, `canceled`, `completed`, `suspended`. | | `data.escortType` | string | | | `data.startDate` | string | | | `data.endDate` | string \| null | When the coaching period ends. null when the escort runs with no time limit, in which case isUnlimited is true. | | `data.months` | integer \| null | Duration in months. null when the escort runs with no time limit. | | `data.isUnlimited` | boolean | True when the escort has no end date. | | `data.training` | object | | | `data.training.activeTrainingPlan` | object \| null | | | `data.training.activeTrainingPlan.id` | string | | | `data.training.activeTrainingPlan.title` | string | | | `data.training.activeTrainingPlan.level` | string | | | `data.training.trainingDays` | any | | | `data.nutrition` | object | | | `data.nutrition.activeNutritionPlan` | object \| null | | | `data.nutrition.activeNutritionPlan.id` | string | | | `data.nutrition.activeNutritionPlan.title` | string | | | `data.nutrition.activeNutritionPlan.level` | string | | | `data.skipRegistrationForms` | boolean | true when the trainee is not asked to fill registration forms in the app during this coaching period. Change it with PATCH /escorts/{escortId}. | | `data.createdAt` | string | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "coach": "", "trainee": { "id": "", "name": "", "email": "", "phoneNumber": "" }, "status": "pending", "escortType": "", "startDate": "", "endDate": "", "months": 123, "isUnlimited": true, "training": { "activeTrainingPlan": { "id": "", "title": "", "level": "" }, "trainingDays": null }, "nutrition": { "activeNutritionPlan": { "id": "", "title": "", "level": "" } }, "skipRegistrationForms": true, "createdAt": "" }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/escorts' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeId": "", "escortType": "Nutrition", "startDate": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/escorts', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeId": "", "escortType": "Nutrition", "startDate": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Get a coaching period](https://www.coach-platform.com/docs/api/reference/get-escorts-escort-id/index.md): `GET /api/public/escorts/{escortId}`. Get a coaching period by id. - [Update a coaching period](https://www.coach-platform.com/docs/api/reference/patch-escorts-escort-id/index.md): `PATCH /api/public/escorts/{escortId}`. Update a coaching period. - [Cancel a coaching period](https://www.coach-platform.com/docs/api/reference/delete-escorts-escort-id/index.md): `DELETE /api/public/escorts/{escortId}`. Cancel a coaching period. - Previous: [Cancel a coaching period](https://www.coach-platform.com/docs/api/reference/delete-escorts-escort-id/index.md): `DELETE /api/public/escorts/{escortId}`. Cancel a coaching period. - Next: [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md): `GET /api/public/training-plans`. List training plans. --- # List training plans `GET https://api.coach-platform.com/api/public/training-plans` List training plans. Filter by traineeId or escortId. - Resource: Training Plans - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-training-plans - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `traineeId` | string | No | | | `escortId` | string | No | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].coach` | string | | | `data[].escorts` | string[] | | | `data[].title` | string | | | `data[].notes` | string | | | `data[].level` | string | Allowed values: `Beginner`, `Intermediate`, `Advanced`. | | `data[].maxDuration` | number | Target session length in minutes. | | `data[].isTemplate` | boolean | True when the plan is a reusable template. | | `data[].workouts` | object[] | | | `data[].workouts[].trainingName` | string | Display name of the day, e.g. "Day A — Push". | | `data[].workouts[].trainingType` | string | Day label, e.g. "A", "B", "FullBody". Allowed values: `A`, `B`, `C`, `D`, `E`, `FullBody`, `CrossFit`, `Tabata`, `HIIT`, `EMOM`, `AMRAP`, `Circuit`, `ForTime`. | | `data[].workouts[].exerciseOrder` | string | How exercises are performed. Defaults to Sequential. Allowed values: `Sequential`, `Circuit`, `Superset`, `Complex`. | | `data[].workouts[].notes` | string | Free-text note for the whole day. | | `data[].workouts[].timeBasedDetails` | object | Timing configuration for circuit-style days (Tabata, HIIT, EMOM, AMRAP). Seconds unless noted. | | `data[].workouts[].timeBasedDetails.totalRounds` | number | | | `data[].workouts[].timeBasedDetails.timeLimit` | number | | | `data[].workouts[].timeBasedDetails.workInterval` | number | | | `data[].workouts[].timeBasedDetails.restInterval` | number | | | `data[].workouts[].timeBasedDetails.restBetweenRounds` | number | | | `data[].workouts[].exercises` | object[] | | | `data[].workouts[].exercises[].exerciseDetails` | object | The exercise catalog entry. On write, pass exerciseDetails as the catalog id string (from GET /exercises). | | `data[].workouts[].exercises[].exerciseDetails.id` | string | | | `data[].workouts[].exercises[].exerciseDetails.name` | string | | | `data[].workouts[].exercises[].setsNumber` | string | Number of sets, e.g. "3". | | `data[].workouts[].exercises[].repsNumber` | string | Reps per set, e.g. "10" or "8-12". | | `data[].workouts[].exercises[].restTime` | string | Rest between sets in seconds, e.g. "90". | | `data[].workouts[].exercises[].isDurationBased` | boolean | True for timed exercises (e.g. plank) instead of reps. | | `data[].workouts[].exercises[].setDuration` | string | Duration per set in seconds when isDurationBased is true. | | `data[].workouts[].exercises[].weightPercentage` | number | Working weight as % of 1RM, e.g. 75. | | `data[].workouts[].exercises[].customNotes` | string | Free-text note shown to the trainee for this exercise. | | `data[].workouts[].exercises[].weight` | number | Working weight in kg for the exercise. | | `data[].workouts[].exercises[].sets` | object[] | Per-set prescription. Takes precedence over setsNumber/repsNumber when present. | | `data[].workouts[].exercises[].sets[].setNumber` | number | 1-based position of the set. | | `data[].workouts[].exercises[].sets[].reps` | string | Reps for this set, e.g. "8". | | `data[].workouts[].exercises[].sets[].weight` | number | Working weight for this set. | | `data[].workouts[].exercises[].sets[].restTime` | string | Rest after this set in seconds. | | `data[].workouts[].exercises[].sets[].intensityValue` | number | Intensity for this set, read against intensityType. | | `data[].workouts[].exercises[].sets[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data[].workouts[].exercises[].sets[].isWarmupSet` | boolean | Warmup sets are not counted towards working volume. | | `data[].workouts[].exercises[].superSet` | boolean | True when this exercise belongs to a superset. | | `data[].workouts[].exercises[].superSetGroup` | string | Shared identifier grouping the exercises performed together in one superset. | | `data[].workouts[].exercises[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data[].workouts[].exercises[].restPause` | boolean | Rest-pause technique. | | `data[].workouts[].exercises[].cluster` | boolean | Cluster-set technique. | | `data[].workouts[].exercises[].trackingType` | string | What the trainee logs for this exercise. Allowed values: `weight_reps`, `reps_only`, `duration`, `completion`. | | `data[].workouts[].exercises[].intensityType` | string | How intensityValue is interpreted. Allowed values: `Percentage`, `RPE`, `RIR`. | | `data[].workouts[].exercises[].intensityValue` | number | Intensity target. | | `data[].workouts[].exercises[].tempo` | object | Tempo in seconds per phase of the lift. | | `data[].workouts[].exercises[].tempo.eccentric` | number | | | `data[].workouts[].exercises[].tempo.hold` | number | | | `data[].workouts[].exercises[].tempo.concentric` | number | | | `data[].workouts[].exercises[].tempo.rest` | number | | | `data[].workouts[].exercises[].distance` | number | Distance for cardio exercises. | | `data[].workouts[].exercises[].distanceUnit` | string | Allowed values: `meters`, `km`, `miles`, `yards`. | | `data[].workouts[].exercises[].specificAlternativeExercises` | string[] | Catalog ids the trainee may swap in for this exercise. | | `data[].createdAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "coach": "", "escorts": [ "" ], "title": "", "notes": "", "level": "Beginner", "maxDuration": 123, "isTemplate": true, "workouts": [ { "trainingName": "", "trainingType": "A", "exerciseOrder": "Sequential", "notes": "", "timeBasedDetails": { "totalRounds": 123, "timeLimit": 123, "workInterval": 123, "restInterval": 123, "restBetweenRounds": 123 }, "exercises": [ { "exerciseDetails": { "id": "", "name": "" }, "setsNumber": "", "repsNumber": "", "restTime": "", "isDurationBased": true, "setDuration": "", "weightPercentage": 123, "customNotes": "", "weight": 123, "sets": [ { "setNumber": 123, "reps": "", "weight": 123, "restTime": "", "intensityValue": 123, "dropSet": "DropSet", "isWarmupSet": true } ], "superSet": true, "superSetGroup": "", "dropSet": "DropSet", "restPause": true, "cluster": true, "trackingType": "weight_reps", "intensityType": "Percentage", "intensityValue": 123, "tempo": { "eccentric": 123, "hold": 123, "concentric": 123, "rest": 123 }, "distance": 123, "distanceUnit": "meters", "specificAlternativeExercises": [ "" ] } ] } ], "createdAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/training-plans' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/training-plans', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md): `POST /api/public/training-plans`. Create a training plan. - [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md): `GET /api/public/training-plans/{planId}`. Get a training plan by id. - [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md): `PATCH /api/public/training-plans/{planId}`. Partially update a training plan. - [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md): `DELETE /api/public/training-plans/{planId}`. Delete a training plan permanently. - [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md): `GET /api/public/trainees/{traineeId}/active-training-plan`. Get a trainee's currently active training plan (resolved via the active coaching period). - [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). - Previous: [Start a coaching period](https://www.coach-platform.com/docs/api/reference/post-escorts/index.md): `POST /api/public/escorts`. Start a new coaching period (escort) for a trainee. - Next: [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md): `POST /api/public/training-plans`. Create a training plan. --- # Create a training plan `POST https://api.coach-platform.com/api/public/training-plans` Create a training plan. Provide traineeId (or escortId) to attach it to a coaching period, or omit both to leave it unassigned. Set isTemplate to save it as a reusable template. The workouts array holds an ordered list of workout days; each day has a trainingName and an exercises array. Each exercise references a catalog id via exerciseDetails (get ids from GET /exercises). BREAKING CHANGE: the plan name is now "title". The previous "name" field has been removed, so a request sending "name" is rejected with 400 "must have required property title". This matches the field name used in every read response. The same rename applies to PATCH /training-plans/{planId}. To build a plan from an existing one, do not read it and re-create it: that silently drops per-set prescriptions, supersets, tempo and intensity. Use POST /training-plans/{planId}/duplicate instead. - Resource: Training Plans - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-training-plans - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | No | Owning trainee id. Omit both traineeId and escortId to leave the plan unassigned. | | `isTemplate` | boolean | No | Save as a reusable template. A template cannot be assigned, so omit traineeId and escortId. | | `escortId` | string | No | Optional coaching period id | | `title` | string | Yes | Plan title shown to the trainee | | `description` | string | No | | | `level` | string | No | Difficulty level of the plan. Allowed values: `Beginner`, `Intermediate`, `Advanced`. | | `maxDuration` | number | No | Target session length in minutes. | | `workouts` | object[] | No | Ordered workout days (e.g. A/B/C splits) Maximum items: `50`. | | `workouts[].trainingName` | string | No | Display name of the day, e.g. "Day A — Push". | | `workouts[].trainingType` | string | No | Day label, e.g. "A", "B", "FullBody". Allowed values: `A`, `B`, `C`, `D`, `E`, `FullBody`, `CrossFit`, `Tabata`, `HIIT`, `EMOM`, `AMRAP`, `Circuit`, `ForTime`. | | `workouts[].exerciseOrder` | string | No | How exercises are performed. Defaults to Sequential. Allowed values: `Sequential`, `Circuit`, `Superset`, `Complex`. | | `workouts[].notes` | string | No | Free-text note for the whole day. | | `workouts[].timeBasedDetails` | object | No | Timing configuration for circuit-style days (Tabata, HIIT, EMOM, AMRAP). Seconds unless noted. | | `workouts[].timeBasedDetails.totalRounds` | number | No | | | `workouts[].timeBasedDetails.timeLimit` | number | No | | | `workouts[].timeBasedDetails.workInterval` | number | No | | | `workouts[].timeBasedDetails.restInterval` | number | No | | | `workouts[].timeBasedDetails.restBetweenRounds` | number | No | | | `workouts[].exercises` | object[] | No | | | `workouts[].exercises[].exerciseDetails` | string | No | Exercise catalog id, taken from GET /exercises. | | `workouts[].exercises[].setsNumber` | string | No | Number of sets, e.g. "3". | | `workouts[].exercises[].repsNumber` | string | No | Reps per set, e.g. "10" or "8-12". | | `workouts[].exercises[].restTime` | string | No | Rest between sets in seconds, e.g. "90". | | `workouts[].exercises[].isDurationBased` | boolean | No | True for timed exercises (e.g. plank) instead of reps. | | `workouts[].exercises[].setDuration` | string | No | Duration per set in seconds when isDurationBased is true. | | `workouts[].exercises[].weightPercentage` | number | No | Working weight as % of 1RM, e.g. 75. | | `workouts[].exercises[].customNotes` | string | No | Free-text note shown to the trainee for this exercise. | | `workouts[].exercises[].weight` | number | No | Working weight in kg for the exercise. | | `workouts[].exercises[].sets` | object[] | No | Per-set prescription. Takes precedence over setsNumber/repsNumber when present. | | `workouts[].exercises[].sets[].setNumber` | number | No | 1-based position of the set. | | `workouts[].exercises[].sets[].reps` | string | No | Reps for this set, e.g. "8". | | `workouts[].exercises[].sets[].weight` | number | No | Working weight for this set. | | `workouts[].exercises[].sets[].restTime` | string | No | Rest after this set in seconds. | | `workouts[].exercises[].sets[].intensityValue` | number | No | Intensity for this set, read against intensityType. | | `workouts[].exercises[].sets[].dropSet` | string | No | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `workouts[].exercises[].sets[].isWarmupSet` | boolean | No | Warmup sets are not counted towards working volume. | | `workouts[].exercises[].superSet` | boolean | No | True when this exercise belongs to a superset. | | `workouts[].exercises[].superSetGroup` | string | No | Shared identifier grouping the exercises performed together in one superset. | | `workouts[].exercises[].dropSet` | string | No | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `workouts[].exercises[].restPause` | boolean | No | Rest-pause technique. | | `workouts[].exercises[].cluster` | boolean | No | Cluster-set technique. | | `workouts[].exercises[].trackingType` | string | No | What the trainee logs for this exercise. Allowed values: `weight_reps`, `reps_only`, `duration`, `completion`. | | `workouts[].exercises[].intensityType` | string | No | How intensityValue is interpreted. Allowed values: `Percentage`, `RPE`, `RIR`. | | `workouts[].exercises[].intensityValue` | number | No | Intensity target. | | `workouts[].exercises[].tempo` | object | No | Tempo in seconds per phase of the lift. | | `workouts[].exercises[].tempo.eccentric` | number | No | | | `workouts[].exercises[].tempo.hold` | number | No | | | `workouts[].exercises[].tempo.concentric` | number | No | | | `workouts[].exercises[].tempo.rest` | number | No | | | `workouts[].exercises[].distance` | number | No | Distance for cardio exercises. | | `workouts[].exercises[].distanceUnit` | string | No | Allowed values: `meters`, `km`, `miles`, `yards`. | | `workouts[].exercises[].specificAlternativeExercises` | string[] | No | Catalog ids the trainee may swap in for this exercise. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.notes` | string | | | `data.level` | string | Allowed values: `Beginner`, `Intermediate`, `Advanced`. | | `data.maxDuration` | number | Target session length in minutes. | | `data.isTemplate` | boolean | True when the plan is a reusable template. | | `data.workouts` | object[] | | | `data.workouts[].trainingName` | string | Display name of the day, e.g. "Day A — Push". | | `data.workouts[].trainingType` | string | Day label, e.g. "A", "B", "FullBody". Allowed values: `A`, `B`, `C`, `D`, `E`, `FullBody`, `CrossFit`, `Tabata`, `HIIT`, `EMOM`, `AMRAP`, `Circuit`, `ForTime`. | | `data.workouts[].exerciseOrder` | string | How exercises are performed. Defaults to Sequential. Allowed values: `Sequential`, `Circuit`, `Superset`, `Complex`. | | `data.workouts[].notes` | string | Free-text note for the whole day. | | `data.workouts[].timeBasedDetails` | object | Timing configuration for circuit-style days (Tabata, HIIT, EMOM, AMRAP). Seconds unless noted. | | `data.workouts[].timeBasedDetails.totalRounds` | number | | | `data.workouts[].timeBasedDetails.timeLimit` | number | | | `data.workouts[].timeBasedDetails.workInterval` | number | | | `data.workouts[].timeBasedDetails.restInterval` | number | | | `data.workouts[].timeBasedDetails.restBetweenRounds` | number | | | `data.workouts[].exercises` | object[] | | | `data.workouts[].exercises[].exerciseDetails` | object | The exercise catalog entry. On write, pass exerciseDetails as the catalog id string (from GET /exercises). | | `data.workouts[].exercises[].exerciseDetails.id` | string | | | `data.workouts[].exercises[].exerciseDetails.name` | string | | | `data.workouts[].exercises[].setsNumber` | string | Number of sets, e.g. "3". | | `data.workouts[].exercises[].repsNumber` | string | Reps per set, e.g. "10" or "8-12". | | `data.workouts[].exercises[].restTime` | string | Rest between sets in seconds, e.g. "90". | | `data.workouts[].exercises[].isDurationBased` | boolean | True for timed exercises (e.g. plank) instead of reps. | | `data.workouts[].exercises[].setDuration` | string | Duration per set in seconds when isDurationBased is true. | | `data.workouts[].exercises[].weightPercentage` | number | Working weight as % of 1RM, e.g. 75. | | `data.workouts[].exercises[].customNotes` | string | Free-text note shown to the trainee for this exercise. | | `data.workouts[].exercises[].weight` | number | Working weight in kg for the exercise. | | `data.workouts[].exercises[].sets` | object[] | Per-set prescription. Takes precedence over setsNumber/repsNumber when present. | | `data.workouts[].exercises[].sets[].setNumber` | number | 1-based position of the set. | | `data.workouts[].exercises[].sets[].reps` | string | Reps for this set, e.g. "8". | | `data.workouts[].exercises[].sets[].weight` | number | Working weight for this set. | | `data.workouts[].exercises[].sets[].restTime` | string | Rest after this set in seconds. | | `data.workouts[].exercises[].sets[].intensityValue` | number | Intensity for this set, read against intensityType. | | `data.workouts[].exercises[].sets[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].sets[].isWarmupSet` | boolean | Warmup sets are not counted towards working volume. | | `data.workouts[].exercises[].superSet` | boolean | True when this exercise belongs to a superset. | | `data.workouts[].exercises[].superSetGroup` | string | Shared identifier grouping the exercises performed together in one superset. | | `data.workouts[].exercises[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].restPause` | boolean | Rest-pause technique. | | `data.workouts[].exercises[].cluster` | boolean | Cluster-set technique. | | `data.workouts[].exercises[].trackingType` | string | What the trainee logs for this exercise. Allowed values: `weight_reps`, `reps_only`, `duration`, `completion`. | | `data.workouts[].exercises[].intensityType` | string | How intensityValue is interpreted. Allowed values: `Percentage`, `RPE`, `RIR`. | | `data.workouts[].exercises[].intensityValue` | number | Intensity target. | | `data.workouts[].exercises[].tempo` | object | Tempo in seconds per phase of the lift. | | `data.workouts[].exercises[].tempo.eccentric` | number | | | `data.workouts[].exercises[].tempo.hold` | number | | | `data.workouts[].exercises[].tempo.concentric` | number | | | `data.workouts[].exercises[].tempo.rest` | number | | | `data.workouts[].exercises[].distance` | number | Distance for cardio exercises. | | `data.workouts[].exercises[].distanceUnit` | string | Allowed values: `meters`, `km`, `miles`, `yards`. | | `data.workouts[].exercises[].specificAlternativeExercises` | string[] | Catalog ids the trainee may swap in for this exercise. | | `data.createdAt` | string | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "notes": "", "level": "Beginner", "maxDuration": 123, "isTemplate": true, "workouts": [ { "trainingName": "", "trainingType": "A", "exerciseOrder": "Sequential", "notes": "", "timeBasedDetails": { "totalRounds": 123, "timeLimit": 123, "workInterval": 123, "restInterval": 123, "restBetweenRounds": 123 }, "exercises": [ { "exerciseDetails": { "id": "", "name": "" }, "setsNumber": "", "repsNumber": "", "restTime": "", "isDurationBased": true, "setDuration": "", "weightPercentage": 123, "customNotes": "", "weight": 123, "sets": [ { "setNumber": 123, "reps": "", "weight": 123, "restTime": "", "intensityValue": 123, "dropSet": "DropSet", "isWarmupSet": true } ], "superSet": true, "superSetGroup": "", "dropSet": "DropSet", "restPause": true, "cluster": true, "trackingType": "weight_reps", "intensityType": "Percentage", "intensityValue": 123, "tempo": { "eccentric": 123, "hold": 123, "concentric": 123, "rest": 123 }, "distance": 123, "distanceUnit": "meters", "specificAlternativeExercises": [ "" ] } ] } ], "createdAt": "" }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/training-plans' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "title": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/training-plans', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "title": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md): `GET /api/public/training-plans`. List training plans. - [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md): `GET /api/public/training-plans/{planId}`. Get a training plan by id. - [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md): `PATCH /api/public/training-plans/{planId}`. Partially update a training plan. - [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md): `DELETE /api/public/training-plans/{planId}`. Delete a training plan permanently. - [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md): `GET /api/public/trainees/{traineeId}/active-training-plan`. Get a trainee's currently active training plan (resolved via the active coaching period). - [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). - Previous: [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md): `GET /api/public/training-plans`. List training plans. - Next: [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md): `GET /api/public/training-plans/{planId}`. Get a training plan by id. --- # Get a training plan `GET https://api.coach-platform.com/api/public/training-plans/{planId}` Get a training plan by id. - Resource: Training Plans - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `planId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.notes` | string | | | `data.level` | string | Allowed values: `Beginner`, `Intermediate`, `Advanced`. | | `data.maxDuration` | number | Target session length in minutes. | | `data.isTemplate` | boolean | True when the plan is a reusable template. | | `data.workouts` | object[] | | | `data.workouts[].trainingName` | string | Display name of the day, e.g. "Day A — Push". | | `data.workouts[].trainingType` | string | Day label, e.g. "A", "B", "FullBody". Allowed values: `A`, `B`, `C`, `D`, `E`, `FullBody`, `CrossFit`, `Tabata`, `HIIT`, `EMOM`, `AMRAP`, `Circuit`, `ForTime`. | | `data.workouts[].exerciseOrder` | string | How exercises are performed. Defaults to Sequential. Allowed values: `Sequential`, `Circuit`, `Superset`, `Complex`. | | `data.workouts[].notes` | string | Free-text note for the whole day. | | `data.workouts[].timeBasedDetails` | object | Timing configuration for circuit-style days (Tabata, HIIT, EMOM, AMRAP). Seconds unless noted. | | `data.workouts[].timeBasedDetails.totalRounds` | number | | | `data.workouts[].timeBasedDetails.timeLimit` | number | | | `data.workouts[].timeBasedDetails.workInterval` | number | | | `data.workouts[].timeBasedDetails.restInterval` | number | | | `data.workouts[].timeBasedDetails.restBetweenRounds` | number | | | `data.workouts[].exercises` | object[] | | | `data.workouts[].exercises[].exerciseDetails` | object | The exercise catalog entry. On write, pass exerciseDetails as the catalog id string (from GET /exercises). | | `data.workouts[].exercises[].exerciseDetails.id` | string | | | `data.workouts[].exercises[].exerciseDetails.name` | string | | | `data.workouts[].exercises[].setsNumber` | string | Number of sets, e.g. "3". | | `data.workouts[].exercises[].repsNumber` | string | Reps per set, e.g. "10" or "8-12". | | `data.workouts[].exercises[].restTime` | string | Rest between sets in seconds, e.g. "90". | | `data.workouts[].exercises[].isDurationBased` | boolean | True for timed exercises (e.g. plank) instead of reps. | | `data.workouts[].exercises[].setDuration` | string | Duration per set in seconds when isDurationBased is true. | | `data.workouts[].exercises[].weightPercentage` | number | Working weight as % of 1RM, e.g. 75. | | `data.workouts[].exercises[].customNotes` | string | Free-text note shown to the trainee for this exercise. | | `data.workouts[].exercises[].weight` | number | Working weight in kg for the exercise. | | `data.workouts[].exercises[].sets` | object[] | Per-set prescription. Takes precedence over setsNumber/repsNumber when present. | | `data.workouts[].exercises[].sets[].setNumber` | number | 1-based position of the set. | | `data.workouts[].exercises[].sets[].reps` | string | Reps for this set, e.g. "8". | | `data.workouts[].exercises[].sets[].weight` | number | Working weight for this set. | | `data.workouts[].exercises[].sets[].restTime` | string | Rest after this set in seconds. | | `data.workouts[].exercises[].sets[].intensityValue` | number | Intensity for this set, read against intensityType. | | `data.workouts[].exercises[].sets[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].sets[].isWarmupSet` | boolean | Warmup sets are not counted towards working volume. | | `data.workouts[].exercises[].superSet` | boolean | True when this exercise belongs to a superset. | | `data.workouts[].exercises[].superSetGroup` | string | Shared identifier grouping the exercises performed together in one superset. | | `data.workouts[].exercises[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].restPause` | boolean | Rest-pause technique. | | `data.workouts[].exercises[].cluster` | boolean | Cluster-set technique. | | `data.workouts[].exercises[].trackingType` | string | What the trainee logs for this exercise. Allowed values: `weight_reps`, `reps_only`, `duration`, `completion`. | | `data.workouts[].exercises[].intensityType` | string | How intensityValue is interpreted. Allowed values: `Percentage`, `RPE`, `RIR`. | | `data.workouts[].exercises[].intensityValue` | number | Intensity target. | | `data.workouts[].exercises[].tempo` | object | Tempo in seconds per phase of the lift. | | `data.workouts[].exercises[].tempo.eccentric` | number | | | `data.workouts[].exercises[].tempo.hold` | number | | | `data.workouts[].exercises[].tempo.concentric` | number | | | `data.workouts[].exercises[].tempo.rest` | number | | | `data.workouts[].exercises[].distance` | number | Distance for cardio exercises. | | `data.workouts[].exercises[].distanceUnit` | string | Allowed values: `meters`, `km`, `miles`, `yards`. | | `data.workouts[].exercises[].specificAlternativeExercises` | string[] | Catalog ids the trainee may swap in for this exercise. | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "notes": "", "level": "Beginner", "maxDuration": 123, "isTemplate": true, "workouts": [ { "trainingName": "", "trainingType": "A", "exerciseOrder": "Sequential", "notes": "", "timeBasedDetails": { "totalRounds": 123, "timeLimit": 123, "workInterval": 123, "restInterval": 123, "restBetweenRounds": 123 }, "exercises": [ { "exerciseDetails": { "id": "", "name": "" }, "setsNumber": "", "repsNumber": "", "restTime": "", "isDurationBased": true, "setDuration": "", "weightPercentage": 123, "customNotes": "", "weight": 123, "sets": [ { "setNumber": 123, "reps": "", "weight": 123, "restTime": "", "intensityValue": 123, "dropSet": "DropSet", "isWarmupSet": true } ], "superSet": true, "superSetGroup": "", "dropSet": "DropSet", "restPause": true, "cluster": true, "trackingType": "weight_reps", "intensityType": "Percentage", "intensityValue": 123, "tempo": { "eccentric": 123, "hold": 123, "concentric": 123, "rest": 123 }, "distance": 123, "distanceUnit": "meters", "specificAlternativeExercises": [ "" ] } ] } ], "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/training-plans/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/training-plans/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md): `GET /api/public/training-plans`. List training plans. - [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md): `POST /api/public/training-plans`. Create a training plan. - [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md): `PATCH /api/public/training-plans/{planId}`. Partially update a training plan. - [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md): `DELETE /api/public/training-plans/{planId}`. Delete a training plan permanently. - [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md): `GET /api/public/trainees/{traineeId}/active-training-plan`. Get a trainee's currently active training plan (resolved via the active coaching period). - [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). - Previous: [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md): `POST /api/public/training-plans`. Create a training plan. - Next: [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md): `PATCH /api/public/training-plans/{planId}`. Partially update a training plan. --- # Update a training plan `PATCH https://api.coach-platform.com/api/public/training-plans/{planId}` Partially update a training plan. Pass only fields you want to change. BREAKING CHANGE: the plan name is now "title"; the previous "name" field has been removed. Unknown fields are dropped during validation, so a PATCH sending only "name" is rejected with 400 "No updatable fields were supplied" rather than silently doing nothing. If the plan is attached to more than one trainee, editing it changes the plan for all of them, so the request returns 409 CONFLICT until you confirm with applyToAllSharedTrainees. - Resource: Training Plans - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `planId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `title` | string | No | | | `description` | string | No | | | `level` | string | No | Allowed values: `Beginner`, `Intermediate`, `Advanced`. | | `maxDuration` | number | No | | | `workouts` | object[] | No | Maximum items: `50`. | | `workouts[].trainingName` | string | No | Display name of the day, e.g. "Day A — Push". | | `workouts[].trainingType` | string | No | Day label, e.g. "A", "B", "FullBody". Allowed values: `A`, `B`, `C`, `D`, `E`, `FullBody`, `CrossFit`, `Tabata`, `HIIT`, `EMOM`, `AMRAP`, `Circuit`, `ForTime`. | | `workouts[].exerciseOrder` | string | No | How exercises are performed. Defaults to Sequential. Allowed values: `Sequential`, `Circuit`, `Superset`, `Complex`. | | `workouts[].notes` | string | No | Free-text note for the whole day. | | `workouts[].timeBasedDetails` | object | No | Timing configuration for circuit-style days (Tabata, HIIT, EMOM, AMRAP). Seconds unless noted. | | `workouts[].timeBasedDetails.totalRounds` | number | No | | | `workouts[].timeBasedDetails.timeLimit` | number | No | | | `workouts[].timeBasedDetails.workInterval` | number | No | | | `workouts[].timeBasedDetails.restInterval` | number | No | | | `workouts[].timeBasedDetails.restBetweenRounds` | number | No | | | `workouts[].exercises` | object[] | No | | | `workouts[].exercises[].exerciseDetails` | string | No | Exercise catalog id, taken from GET /exercises. | | `workouts[].exercises[].setsNumber` | string | No | Number of sets, e.g. "3". | | `workouts[].exercises[].repsNumber` | string | No | Reps per set, e.g. "10" or "8-12". | | `workouts[].exercises[].restTime` | string | No | Rest between sets in seconds, e.g. "90". | | `workouts[].exercises[].isDurationBased` | boolean | No | True for timed exercises (e.g. plank) instead of reps. | | `workouts[].exercises[].setDuration` | string | No | Duration per set in seconds when isDurationBased is true. | | `workouts[].exercises[].weightPercentage` | number | No | Working weight as % of 1RM, e.g. 75. | | `workouts[].exercises[].customNotes` | string | No | Free-text note shown to the trainee for this exercise. | | `workouts[].exercises[].weight` | number | No | Working weight in kg for the exercise. | | `workouts[].exercises[].sets` | object[] | No | Per-set prescription. Takes precedence over setsNumber/repsNumber when present. | | `workouts[].exercises[].sets[].setNumber` | number | No | 1-based position of the set. | | `workouts[].exercises[].sets[].reps` | string | No | Reps for this set, e.g. "8". | | `workouts[].exercises[].sets[].weight` | number | No | Working weight for this set. | | `workouts[].exercises[].sets[].restTime` | string | No | Rest after this set in seconds. | | `workouts[].exercises[].sets[].intensityValue` | number | No | Intensity for this set, read against intensityType. | | `workouts[].exercises[].sets[].dropSet` | string | No | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `workouts[].exercises[].sets[].isWarmupSet` | boolean | No | Warmup sets are not counted towards working volume. | | `workouts[].exercises[].superSet` | boolean | No | True when this exercise belongs to a superset. | | `workouts[].exercises[].superSetGroup` | string | No | Shared identifier grouping the exercises performed together in one superset. | | `workouts[].exercises[].dropSet` | string | No | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `workouts[].exercises[].restPause` | boolean | No | Rest-pause technique. | | `workouts[].exercises[].cluster` | boolean | No | Cluster-set technique. | | `workouts[].exercises[].trackingType` | string | No | What the trainee logs for this exercise. Allowed values: `weight_reps`, `reps_only`, `duration`, `completion`. | | `workouts[].exercises[].intensityType` | string | No | How intensityValue is interpreted. Allowed values: `Percentage`, `RPE`, `RIR`. | | `workouts[].exercises[].intensityValue` | number | No | Intensity target. | | `workouts[].exercises[].tempo` | object | No | Tempo in seconds per phase of the lift. | | `workouts[].exercises[].tempo.eccentric` | number | No | | | `workouts[].exercises[].tempo.hold` | number | No | | | `workouts[].exercises[].tempo.concentric` | number | No | | | `workouts[].exercises[].tempo.rest` | number | No | | | `workouts[].exercises[].distance` | number | No | Distance for cardio exercises. | | `workouts[].exercises[].distanceUnit` | string | No | Allowed values: `meters`, `km`, `miles`, `yards`. | | `workouts[].exercises[].specificAlternativeExercises` | string[] | No | Catalog ids the trainee may swap in for this exercise. | | `applyToAllSharedTrainees` | boolean | No | Required (true) to edit a plan shared by multiple trainees; the change then applies to all of them. Without it, a shared plan returns 409. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.notes` | string | | | `data.level` | string | Allowed values: `Beginner`, `Intermediate`, `Advanced`. | | `data.maxDuration` | number | Target session length in minutes. | | `data.isTemplate` | boolean | True when the plan is a reusable template. | | `data.workouts` | object[] | | | `data.workouts[].trainingName` | string | Display name of the day, e.g. "Day A — Push". | | `data.workouts[].trainingType` | string | Day label, e.g. "A", "B", "FullBody". Allowed values: `A`, `B`, `C`, `D`, `E`, `FullBody`, `CrossFit`, `Tabata`, `HIIT`, `EMOM`, `AMRAP`, `Circuit`, `ForTime`. | | `data.workouts[].exerciseOrder` | string | How exercises are performed. Defaults to Sequential. Allowed values: `Sequential`, `Circuit`, `Superset`, `Complex`. | | `data.workouts[].notes` | string | Free-text note for the whole day. | | `data.workouts[].timeBasedDetails` | object | Timing configuration for circuit-style days (Tabata, HIIT, EMOM, AMRAP). Seconds unless noted. | | `data.workouts[].timeBasedDetails.totalRounds` | number | | | `data.workouts[].timeBasedDetails.timeLimit` | number | | | `data.workouts[].timeBasedDetails.workInterval` | number | | | `data.workouts[].timeBasedDetails.restInterval` | number | | | `data.workouts[].timeBasedDetails.restBetweenRounds` | number | | | `data.workouts[].exercises` | object[] | | | `data.workouts[].exercises[].exerciseDetails` | object | The exercise catalog entry. On write, pass exerciseDetails as the catalog id string (from GET /exercises). | | `data.workouts[].exercises[].exerciseDetails.id` | string | | | `data.workouts[].exercises[].exerciseDetails.name` | string | | | `data.workouts[].exercises[].setsNumber` | string | Number of sets, e.g. "3". | | `data.workouts[].exercises[].repsNumber` | string | Reps per set, e.g. "10" or "8-12". | | `data.workouts[].exercises[].restTime` | string | Rest between sets in seconds, e.g. "90". | | `data.workouts[].exercises[].isDurationBased` | boolean | True for timed exercises (e.g. plank) instead of reps. | | `data.workouts[].exercises[].setDuration` | string | Duration per set in seconds when isDurationBased is true. | | `data.workouts[].exercises[].weightPercentage` | number | Working weight as % of 1RM, e.g. 75. | | `data.workouts[].exercises[].customNotes` | string | Free-text note shown to the trainee for this exercise. | | `data.workouts[].exercises[].weight` | number | Working weight in kg for the exercise. | | `data.workouts[].exercises[].sets` | object[] | Per-set prescription. Takes precedence over setsNumber/repsNumber when present. | | `data.workouts[].exercises[].sets[].setNumber` | number | 1-based position of the set. | | `data.workouts[].exercises[].sets[].reps` | string | Reps for this set, e.g. "8". | | `data.workouts[].exercises[].sets[].weight` | number | Working weight for this set. | | `data.workouts[].exercises[].sets[].restTime` | string | Rest after this set in seconds. | | `data.workouts[].exercises[].sets[].intensityValue` | number | Intensity for this set, read against intensityType. | | `data.workouts[].exercises[].sets[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].sets[].isWarmupSet` | boolean | Warmup sets are not counted towards working volume. | | `data.workouts[].exercises[].superSet` | boolean | True when this exercise belongs to a superset. | | `data.workouts[].exercises[].superSetGroup` | string | Shared identifier grouping the exercises performed together in one superset. | | `data.workouts[].exercises[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].restPause` | boolean | Rest-pause technique. | | `data.workouts[].exercises[].cluster` | boolean | Cluster-set technique. | | `data.workouts[].exercises[].trackingType` | string | What the trainee logs for this exercise. Allowed values: `weight_reps`, `reps_only`, `duration`, `completion`. | | `data.workouts[].exercises[].intensityType` | string | How intensityValue is interpreted. Allowed values: `Percentage`, `RPE`, `RIR`. | | `data.workouts[].exercises[].intensityValue` | number | Intensity target. | | `data.workouts[].exercises[].tempo` | object | Tempo in seconds per phase of the lift. | | `data.workouts[].exercises[].tempo.eccentric` | number | | | `data.workouts[].exercises[].tempo.hold` | number | | | `data.workouts[].exercises[].tempo.concentric` | number | | | `data.workouts[].exercises[].tempo.rest` | number | | | `data.workouts[].exercises[].distance` | number | Distance for cardio exercises. | | `data.workouts[].exercises[].distanceUnit` | string | Allowed values: `meters`, `km`, `miles`, `yards`. | | `data.workouts[].exercises[].specificAlternativeExercises` | string[] | Catalog ids the trainee may swap in for this exercise. | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "notes": "", "level": "Beginner", "maxDuration": 123, "isTemplate": true, "workouts": [ { "trainingName": "", "trainingType": "A", "exerciseOrder": "Sequential", "notes": "", "timeBasedDetails": { "totalRounds": 123, "timeLimit": 123, "workInterval": 123, "restInterval": 123, "restBetweenRounds": 123 }, "exercises": [ { "exerciseDetails": { "id": "", "name": "" }, "setsNumber": "", "repsNumber": "", "restTime": "", "isDurationBased": true, "setDuration": "", "weightPercentage": 123, "customNotes": "", "weight": 123, "sets": [ { "setNumber": 123, "reps": "", "weight": 123, "restTime": "", "intensityValue": 123, "dropSet": "DropSet", "isWarmupSet": true } ], "superSet": true, "superSetGroup": "", "dropSet": "DropSet", "restPause": true, "cluster": true, "trackingType": "weight_reps", "intensityType": "Percentage", "intensityValue": 123, "tempo": { "eccentric": 123, "hold": 123, "concentric": 123, "rest": 123 }, "distance": 123, "distanceUnit": "meters", "specificAlternativeExercises": [ "" ] } ] } ], "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request PATCH \ --url 'https://api.coach-platform.com/api/public/training-plans/' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "title": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/training-plans/', { method: 'PATCH', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "title": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md): `GET /api/public/training-plans`. List training plans. - [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md): `POST /api/public/training-plans`. Create a training plan. - [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md): `GET /api/public/training-plans/{planId}`. Get a training plan by id. - [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md): `DELETE /api/public/training-plans/{planId}`. Delete a training plan permanently. - [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md): `GET /api/public/trainees/{traineeId}/active-training-plan`. Get a trainee's currently active training plan (resolved via the active coaching period). - [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). - Previous: [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md): `GET /api/public/training-plans/{planId}`. Get a training plan by id. - Next: [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md): `DELETE /api/public/training-plans/{planId}`. Delete a training plan permanently. --- # Delete a training plan `DELETE https://api.coach-platform.com/api/public/training-plans/{planId}` Delete a training plan permanently. - Resource: Training Plans - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `planId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request DELETE \ --url 'https://api.coach-platform.com/api/public/training-plans/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/training-plans/', { method: 'DELETE', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md): `GET /api/public/training-plans`. List training plans. - [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md): `POST /api/public/training-plans`. Create a training plan. - [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md): `GET /api/public/training-plans/{planId}`. Get a training plan by id. - [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md): `PATCH /api/public/training-plans/{planId}`. Partially update a training plan. - [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md): `GET /api/public/trainees/{traineeId}/active-training-plan`. Get a trainee's currently active training plan (resolved via the active coaching period). - [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). - Previous: [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md): `PATCH /api/public/training-plans/{planId}`. Partially update a training plan. - Next: [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md): `GET /api/public/trainees/{traineeId}/active-training-plan`. Get a trainee's currently active training plan (resolved via the active coaching period). --- # Get a trainee's active training plan `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/active-training-plan` Get a trainee's currently active training plan (resolved via the active coaching period). 404 if the trainee has no active plan. - Resource: Training Plans - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.notes` | string | | | `data.level` | string | Allowed values: `Beginner`, `Intermediate`, `Advanced`. | | `data.maxDuration` | number | Target session length in minutes. | | `data.isTemplate` | boolean | True when the plan is a reusable template. | | `data.workouts` | object[] | | | `data.workouts[].trainingName` | string | Display name of the day, e.g. "Day A — Push". | | `data.workouts[].trainingType` | string | Day label, e.g. "A", "B", "FullBody". Allowed values: `A`, `B`, `C`, `D`, `E`, `FullBody`, `CrossFit`, `Tabata`, `HIIT`, `EMOM`, `AMRAP`, `Circuit`, `ForTime`. | | `data.workouts[].exerciseOrder` | string | How exercises are performed. Defaults to Sequential. Allowed values: `Sequential`, `Circuit`, `Superset`, `Complex`. | | `data.workouts[].notes` | string | Free-text note for the whole day. | | `data.workouts[].timeBasedDetails` | object | Timing configuration for circuit-style days (Tabata, HIIT, EMOM, AMRAP). Seconds unless noted. | | `data.workouts[].timeBasedDetails.totalRounds` | number | | | `data.workouts[].timeBasedDetails.timeLimit` | number | | | `data.workouts[].timeBasedDetails.workInterval` | number | | | `data.workouts[].timeBasedDetails.restInterval` | number | | | `data.workouts[].timeBasedDetails.restBetweenRounds` | number | | | `data.workouts[].exercises` | object[] | | | `data.workouts[].exercises[].exerciseDetails` | object | The exercise catalog entry. On write, pass exerciseDetails as the catalog id string (from GET /exercises). | | `data.workouts[].exercises[].exerciseDetails.id` | string | | | `data.workouts[].exercises[].exerciseDetails.name` | string | | | `data.workouts[].exercises[].setsNumber` | string | Number of sets, e.g. "3". | | `data.workouts[].exercises[].repsNumber` | string | Reps per set, e.g. "10" or "8-12". | | `data.workouts[].exercises[].restTime` | string | Rest between sets in seconds, e.g. "90". | | `data.workouts[].exercises[].isDurationBased` | boolean | True for timed exercises (e.g. plank) instead of reps. | | `data.workouts[].exercises[].setDuration` | string | Duration per set in seconds when isDurationBased is true. | | `data.workouts[].exercises[].weightPercentage` | number | Working weight as % of 1RM, e.g. 75. | | `data.workouts[].exercises[].customNotes` | string | Free-text note shown to the trainee for this exercise. | | `data.workouts[].exercises[].weight` | number | Working weight in kg for the exercise. | | `data.workouts[].exercises[].sets` | object[] | Per-set prescription. Takes precedence over setsNumber/repsNumber when present. | | `data.workouts[].exercises[].sets[].setNumber` | number | 1-based position of the set. | | `data.workouts[].exercises[].sets[].reps` | string | Reps for this set, e.g. "8". | | `data.workouts[].exercises[].sets[].weight` | number | Working weight for this set. | | `data.workouts[].exercises[].sets[].restTime` | string | Rest after this set in seconds. | | `data.workouts[].exercises[].sets[].intensityValue` | number | Intensity for this set, read against intensityType. | | `data.workouts[].exercises[].sets[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].sets[].isWarmupSet` | boolean | Warmup sets are not counted towards working volume. | | `data.workouts[].exercises[].superSet` | boolean | True when this exercise belongs to a superset. | | `data.workouts[].exercises[].superSetGroup` | string | Shared identifier grouping the exercises performed together in one superset. | | `data.workouts[].exercises[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].restPause` | boolean | Rest-pause technique. | | `data.workouts[].exercises[].cluster` | boolean | Cluster-set technique. | | `data.workouts[].exercises[].trackingType` | string | What the trainee logs for this exercise. Allowed values: `weight_reps`, `reps_only`, `duration`, `completion`. | | `data.workouts[].exercises[].intensityType` | string | How intensityValue is interpreted. Allowed values: `Percentage`, `RPE`, `RIR`. | | `data.workouts[].exercises[].intensityValue` | number | Intensity target. | | `data.workouts[].exercises[].tempo` | object | Tempo in seconds per phase of the lift. | | `data.workouts[].exercises[].tempo.eccentric` | number | | | `data.workouts[].exercises[].tempo.hold` | number | | | `data.workouts[].exercises[].tempo.concentric` | number | | | `data.workouts[].exercises[].tempo.rest` | number | | | `data.workouts[].exercises[].distance` | number | Distance for cardio exercises. | | `data.workouts[].exercises[].distanceUnit` | string | Allowed values: `meters`, `km`, `miles`, `yards`. | | `data.workouts[].exercises[].specificAlternativeExercises` | string[] | Catalog ids the trainee may swap in for this exercise. | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "notes": "", "level": "Beginner", "maxDuration": 123, "isTemplate": true, "workouts": [ { "trainingName": "", "trainingType": "A", "exerciseOrder": "Sequential", "notes": "", "timeBasedDetails": { "totalRounds": 123, "timeLimit": 123, "workInterval": 123, "restInterval": 123, "restBetweenRounds": 123 }, "exercises": [ { "exerciseDetails": { "id": "", "name": "" }, "setsNumber": "", "repsNumber": "", "restTime": "", "isDurationBased": true, "setDuration": "", "weightPercentage": 123, "customNotes": "", "weight": 123, "sets": [ { "setNumber": 123, "reps": "", "weight": 123, "restTime": "", "intensityValue": 123, "dropSet": "DropSet", "isWarmupSet": true } ], "superSet": true, "superSetGroup": "", "dropSet": "DropSet", "restPause": true, "cluster": true, "trackingType": "weight_reps", "intensityType": "Percentage", "intensityValue": 123, "tempo": { "eccentric": 123, "hold": 123, "concentric": 123, "rest": 123 }, "distance": 123, "distanceUnit": "meters", "specificAlternativeExercises": [ "" ] } ] } ], "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//active-training-plan' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//active-training-plan', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md): `GET /api/public/training-plans`. List training plans. - [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md): `POST /api/public/training-plans`. Create a training plan. - [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md): `GET /api/public/training-plans/{planId}`. Get a training plan by id. - [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md): `PATCH /api/public/training-plans/{planId}`. Partially update a training plan. - [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md): `DELETE /api/public/training-plans/{planId}`. Delete a training plan permanently. - [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). - Previous: [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md): `DELETE /api/public/training-plans/{planId}`. Delete a training plan permanently. - Next: [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). --- # Duplicate a training plan `POST https://api.coach-platform.com/api/public/training-plans/{planId}/duplicate` Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). This is the supported way to turn a template into a trainee plan, because a template itself can never be assigned: you assign the copy, not the template. The copy is always created with isTemplate=false and isEditable=true. Returns the new plan, including its id, so no follow-up lookup is needed. Assignment is optional. Send neither traineeId nor escortId to get an unassigned copy; send one of them to duplicate and assign in a single call. - Resource: Training Plans - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `planId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | No | Assign the copy to this trainee by resolving their coaching period automatically. Picks the trainee's most recently created Active escort. Returns 400 'No active escort found for this trainee' when the trainee has no Active escort, which is the case for Pending, Suspended, or not-yet-started periods; use escortId for those. Omit both ids to leave the copy unassigned. | | `escortId` | string | No | Assign the copy to this exact coaching period, whatever its status. Use this instead of traineeId when the target period is not Active (Pending, Suspended, or scheduled for the future), or when the trainee has more than one period and you must not rely on automatic selection. When both ids are sent, escortId decides the target and traineeId is only validated against it: a mismatch returns 400 "escortId does not belong to the provided traineeId", which is a useful safety check when the two ids come from an external system. | | `title` | string | No | Title for the copy. Defaults to the source title with a copy suffix. The copy stays in the same plan group as its source, so duplicates do not scatter the plans list. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.notes` | string | | | `data.level` | string | Allowed values: `Beginner`, `Intermediate`, `Advanced`. | | `data.maxDuration` | number | Target session length in minutes. | | `data.isTemplate` | boolean | True when the plan is a reusable template. | | `data.workouts` | object[] | | | `data.workouts[].trainingName` | string | Display name of the day, e.g. "Day A — Push". | | `data.workouts[].trainingType` | string | Day label, e.g. "A", "B", "FullBody". Allowed values: `A`, `B`, `C`, `D`, `E`, `FullBody`, `CrossFit`, `Tabata`, `HIIT`, `EMOM`, `AMRAP`, `Circuit`, `ForTime`. | | `data.workouts[].exerciseOrder` | string | How exercises are performed. Defaults to Sequential. Allowed values: `Sequential`, `Circuit`, `Superset`, `Complex`. | | `data.workouts[].notes` | string | Free-text note for the whole day. | | `data.workouts[].timeBasedDetails` | object | Timing configuration for circuit-style days (Tabata, HIIT, EMOM, AMRAP). Seconds unless noted. | | `data.workouts[].timeBasedDetails.totalRounds` | number | | | `data.workouts[].timeBasedDetails.timeLimit` | number | | | `data.workouts[].timeBasedDetails.workInterval` | number | | | `data.workouts[].timeBasedDetails.restInterval` | number | | | `data.workouts[].timeBasedDetails.restBetweenRounds` | number | | | `data.workouts[].exercises` | object[] | | | `data.workouts[].exercises[].exerciseDetails` | object | The exercise catalog entry. On write, pass exerciseDetails as the catalog id string (from GET /exercises). | | `data.workouts[].exercises[].exerciseDetails.id` | string | | | `data.workouts[].exercises[].exerciseDetails.name` | string | | | `data.workouts[].exercises[].setsNumber` | string | Number of sets, e.g. "3". | | `data.workouts[].exercises[].repsNumber` | string | Reps per set, e.g. "10" or "8-12". | | `data.workouts[].exercises[].restTime` | string | Rest between sets in seconds, e.g. "90". | | `data.workouts[].exercises[].isDurationBased` | boolean | True for timed exercises (e.g. plank) instead of reps. | | `data.workouts[].exercises[].setDuration` | string | Duration per set in seconds when isDurationBased is true. | | `data.workouts[].exercises[].weightPercentage` | number | Working weight as % of 1RM, e.g. 75. | | `data.workouts[].exercises[].customNotes` | string | Free-text note shown to the trainee for this exercise. | | `data.workouts[].exercises[].weight` | number | Working weight in kg for the exercise. | | `data.workouts[].exercises[].sets` | object[] | Per-set prescription. Takes precedence over setsNumber/repsNumber when present. | | `data.workouts[].exercises[].sets[].setNumber` | number | 1-based position of the set. | | `data.workouts[].exercises[].sets[].reps` | string | Reps for this set, e.g. "8". | | `data.workouts[].exercises[].sets[].weight` | number | Working weight for this set. | | `data.workouts[].exercises[].sets[].restTime` | string | Rest after this set in seconds. | | `data.workouts[].exercises[].sets[].intensityValue` | number | Intensity for this set, read against intensityType. | | `data.workouts[].exercises[].sets[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].sets[].isWarmupSet` | boolean | Warmup sets are not counted towards working volume. | | `data.workouts[].exercises[].superSet` | boolean | True when this exercise belongs to a superset. | | `data.workouts[].exercises[].superSetGroup` | string | Shared identifier grouping the exercises performed together in one superset. | | `data.workouts[].exercises[].dropSet` | string | Allowed values: `DropSet`, `DoubleDropSet`, `TripleDropSet`. | | `data.workouts[].exercises[].restPause` | boolean | Rest-pause technique. | | `data.workouts[].exercises[].cluster` | boolean | Cluster-set technique. | | `data.workouts[].exercises[].trackingType` | string | What the trainee logs for this exercise. Allowed values: `weight_reps`, `reps_only`, `duration`, `completion`. | | `data.workouts[].exercises[].intensityType` | string | How intensityValue is interpreted. Allowed values: `Percentage`, `RPE`, `RIR`. | | `data.workouts[].exercises[].intensityValue` | number | Intensity target. | | `data.workouts[].exercises[].tempo` | object | Tempo in seconds per phase of the lift. | | `data.workouts[].exercises[].tempo.eccentric` | number | | | `data.workouts[].exercises[].tempo.hold` | number | | | `data.workouts[].exercises[].tempo.concentric` | number | | | `data.workouts[].exercises[].tempo.rest` | number | | | `data.workouts[].exercises[].distance` | number | Distance for cardio exercises. | | `data.workouts[].exercises[].distanceUnit` | string | Allowed values: `meters`, `km`, `miles`, `yards`. | | `data.workouts[].exercises[].specificAlternativeExercises` | string[] | Catalog ids the trainee may swap in for this exercise. | | `data.createdAt` | string | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "notes": "", "level": "Beginner", "maxDuration": 123, "isTemplate": true, "workouts": [ { "trainingName": "", "trainingType": "A", "exerciseOrder": "Sequential", "notes": "", "timeBasedDetails": { "totalRounds": 123, "timeLimit": 123, "workInterval": 123, "restInterval": 123, "restBetweenRounds": 123 }, "exercises": [ { "exerciseDetails": { "id": "", "name": "" }, "setsNumber": "", "repsNumber": "", "restTime": "", "isDurationBased": true, "setDuration": "", "weightPercentage": 123, "customNotes": "", "weight": 123, "sets": [ { "setNumber": 123, "reps": "", "weight": 123, "restTime": "", "intensityValue": 123, "dropSet": "DropSet", "isWarmupSet": true } ], "superSet": true, "superSetGroup": "", "dropSet": "DropSet", "restPause": true, "cluster": true, "trackingType": "weight_reps", "intensityType": "Percentage", "intensityValue": 123, "tempo": { "eccentric": 123, "hold": 123, "concentric": 123, "rest": 123 }, "distance": 123, "distanceUnit": "meters", "specificAlternativeExercises": [ "" ] } ] } ], "createdAt": "" }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/training-plans//duplicate' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeId": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/training-plans//duplicate', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeId": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List training plans](https://www.coach-platform.com/docs/api/reference/get-training-plans/index.md): `GET /api/public/training-plans`. List training plans. - [Create a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans/index.md): `POST /api/public/training-plans`. Create a training plan. - [Get a training plan](https://www.coach-platform.com/docs/api/reference/get-training-plans-plan-id/index.md): `GET /api/public/training-plans/{planId}`. Get a training plan by id. - [Update a training plan](https://www.coach-platform.com/docs/api/reference/patch-training-plans-plan-id/index.md): `PATCH /api/public/training-plans/{planId}`. Partially update a training plan. - [Delete a training plan](https://www.coach-platform.com/docs/api/reference/delete-training-plans-plan-id/index.md): `DELETE /api/public/training-plans/{planId}`. Delete a training plan permanently. - [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md): `GET /api/public/trainees/{traineeId}/active-training-plan`. Get a trainee's currently active training plan (resolved via the active coaching period). - Previous: [Get a trainee's active training plan](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-training-plan/index.md): `GET /api/public/trainees/{traineeId}/active-training-plan`. Get a trainee's currently active training plan (resolved via the active coaching period). - Next: [List workout logs](https://www.coach-platform.com/docs/api/reference/get-workout-logs/index.md): `GET /api/public/workout-logs`. List workout logs for a single trainee. --- # List workout logs `GET https://api.coach-platform.com/api/public/workout-logs` List workout logs for a single trainee. traineeId is required. - Resource: Workout Logs - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-workout-logs - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `traineeId` | string | Yes | | | `from` | string | No | ISO date — earliest workoutDate | | `to` | string | No | ISO date — latest workoutDate | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].workout` | string | Id of the workout day this log belongs to. | | `data[].workoutName` | string | | | `data[].completedAt` | string | When the workout was completed. | | `data[].totalVolume` | number | | | `data[].totalSets` | number | | | `data[].duration` | number | | | `data[].exerciseCount` | number | | | `data[].personalRecords` | object[] | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "workout": "", "workoutName": "", "completedAt": "", "totalVolume": 123, "totalSets": 123, "duration": 123, "exerciseCount": 123, "personalRecords": [ {} ] } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/workout-logs?traineeId=' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/workout-logs?traineeId=', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List a trainee's exercise notes](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-exercise-notes/index.md): `GET /api/public/trainees/{traineeId}/exercise-notes`. Per-exercise notes and video replies from a trainee's workout logs. - Previous: [Duplicate a training plan](https://www.coach-platform.com/docs/api/reference/post-training-plans-plan-id-duplicate/index.md): `POST /api/public/training-plans/{planId}/duplicate`. Copy an existing training plan, including every exercise detail (per-set prescriptions, supersets, tempo, intensity, drop sets, alternatives). - Next: [List a trainee's exercise notes](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-exercise-notes/index.md): `GET /api/public/trainees/{traineeId}/exercise-notes`. Per-exercise notes and video replies from a trainee's workout logs. --- # List a trainee's exercise notes `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/exercise-notes` Per-exercise notes and video replies from a trainee's workout logs. - Resource: Workout Logs - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-exercise-notes - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//exercise-notes' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//exercise-notes', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List workout logs](https://www.coach-platform.com/docs/api/reference/get-workout-logs/index.md): `GET /api/public/workout-logs`. List workout logs for a single trainee. - Previous: [List workout logs](https://www.coach-platform.com/docs/api/reference/get-workout-logs/index.md): `GET /api/public/workout-logs`. List workout logs for a single trainee. - Next: [Search the exercise catalog](https://www.coach-platform.com/docs/api/reference/get-exercises/index.md): `GET /api/public/exercises`. Search the exercises catalog (name, muscle group). --- # Search the exercise catalog `GET https://api.coach-platform.com/api/public/exercises` Search the exercises catalog (name, muscle group). - Resource: Exercises - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-exercises - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `search` | string | No | | | `muscleGroup` | string | No | Muscle group filter, matched case-insensitively against either the exercise target ("pectorals") or its body part ("chest"), so either spelling works. Any value is accepted; these are the ones the catalog actually uses. Body parts: back, cardio, chest, lower arms, lower legs, neck, shoulders, upper arms, upper legs, waist. Targets: abdominals, abductors, abs, adductors, biceps, calves, cardiovascular system, delts, forearms, glutes, hamstrings, lats, levator scapulae, pectorals, quads, rear deltoids, serratus anterior, spine, traps, triceps, upper back. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[]._id` | string | | | `data[].name` | string | | | `data[].target` | string | Primary muscle worked. Coach-created exercises may carry a value outside this list. Allowed values: `abdominals`, `abductors`, `abs`, `adductors`, `biceps`, `calves`, `cardiovascular system`, `delts`, `forearms`, `glutes`, `hamstrings`, `lats`, `levator scapulae`, `pectorals`, `quads`, `rear deltoids`, `serratus anterior`, `spine`, `traps`, `triceps`, `upper back`. | | `data[].bodyPart` | string | Body region the exercise trains. Only the global catalog is reliably tagged. Allowed values: `back`, `cardio`, `chest`, `lower arms`, `lower legs`, `neck`, `shoulders`, `upper arms`, `upper legs`, `waist`. | | `data[].equipment` | string | Equipment needed. Every global-catalog exercise is tagged; most coach-created ones are not. Allowed values: `assisted`, `band`, `barbell`, `body weight`, `bosu ball`, `cable`, `cable machine`, `dumbbell`, `elliptical machine`, `ez barbell`, `kettlebell`, `leverage machine`, `medicine ball`, `olympic barbell`, `resistance band`, `roller`, `rope`, `skierg machine`, `sled machine`, `smith machine`, `stability ball`, `stationary bike`, `stepmill machine`, `tire`, `trap bar`, `upper body ergometer`, `weighted`, `wheel roller`. | | `data[].instructions` | string[] | | | `data[].videoUrl` | string | The coach's own demonstration video for this exercise, when they have set one. | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "_id": "", "name": "", "target": "abdominals", "bodyPart": "back", "equipment": "assisted", "instructions": [ "" ], "videoUrl": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/exercises' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/exercises', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - Previous: [List a trainee's exercise notes](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-exercise-notes/index.md): `GET /api/public/trainees/{traineeId}/exercise-notes`. Per-exercise notes and video replies from a trainee's workout logs. - Next: [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. --- # Get a trainee's daily nutrition log `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/nutrition-log` What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. Returns a single day, never a range, so call it once per date to build a range. Distinct from the assigned nutrition menu/plan, which is the target rather than what was eaten. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `date` | string | No | The day to fetch, YYYY-MM-DD. Defaults to today (Israel time). | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//nutrition-log' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//nutrition-log', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [Search the exercise catalog](https://www.coach-platform.com/docs/api/reference/get-exercises/index.md): `GET /api/public/exercises`. Search the exercises catalog (name, muscle group). - Next: [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. --- # List nutrition menus `GET https://api.coach-platform.com/api/public/nutrition-menus` List nutrition menus. Filter by traineeId. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-nutrition-menus - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `traineeId` | string | No | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].coach` | string | | | `data[].escorts` | string[] | | | `data[].title` | string | | | `data[].description` | string | | | `data[].goal` | string | | | `data[].type` | string | | | `data[].totalCalories` | number | | | `data[].totalProtein` | number | | | `data[].totalCarbs` | number | | | `data[].totalFat` | number | | | `data[].meals` | object[] | | | `data[].meals[].id` | string | Meal id. Not stable: saving the menu from the dashboard rewrites every meal with a new id, so re-read this endpoint before each write instead of caching it. Ignored on create; resend it on PATCH to keep the meal and its alternatives instead of replacing it with a new one. | | `data[].meals[].title` | string | Meal name, e.g. "Breakfast". | | `data[].meals[].foodItems` | object[] | | | `data[].meals[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data[].meals[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data[].meals[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data[].meals[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data[].meals[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data[].meals[].foodItems[].caloriesPer100g` | number | | | `data[].meals[].foodItems[].proteinPer100g` | number | | | `data[].meals[].foodItems[].carbsPer100g` | number | | | `data[].meals[].foodItems[].fatPer100g` | number | | | `data[].meals[].calories` | number | Total calories for the meal. | | `data[].meals[].protein` | number | | | `data[].meals[].carbs` | number | | | `data[].meals[].fat` | number | | | `data[].meals[].notes` | string | | | `data[].meals[].alternatives` | object[] | Alternatives the trainee may eat instead of this meal. Manage them one at a time with POST/DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives, or send the whole array here. Maximum items: `20`. | | `data[].meals[].alternatives[].id` | string | Alternative id. Read-only; pass it to DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}. Not stable: saving the menu from the dashboard gives every alternative a new id, so read it fresh rather than caching it. | | `data[].meals[].alternatives[].title` | string | Alternative name, e.g. "Omelette instead". | | `data[].meals[].alternatives[].foodItems` | object[] | | | `data[].meals[].alternatives[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data[].meals[].alternatives[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data[].meals[].alternatives[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data[].meals[].alternatives[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data[].meals[].alternatives[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data[].meals[].alternatives[].foodItems[].caloriesPer100g` | number | | | `data[].meals[].alternatives[].foodItems[].proteinPer100g` | number | | | `data[].meals[].alternatives[].foodItems[].carbsPer100g` | number | | | `data[].meals[].alternatives[].foodItems[].fatPer100g` | number | | | `data[].meals[].alternatives[].calories` | number | Total calories for the alternative. | | `data[].meals[].alternatives[].protein` | number | | | `data[].meals[].alternatives[].carbs` | number | | | `data[].meals[].alternatives[].fat` | number | | | `data[].meals[].alternatives[].notes` | string | | | `data[].createdAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "coach": "", "escorts": [ "" ], "title": "", "description": "", "goal": "", "type": "", "totalCalories": 123, "totalProtein": 123, "totalCarbs": 123, "totalFat": 123, "meals": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "", "alternatives": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "" } ] } ], "createdAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/nutrition-menus' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/nutrition-menus', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - Next: [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. --- # Create a nutrition menu `POST https://api.coach-platform.com/api/public/nutrition-menus` Create a nutrition menu. Provide traineeId (or escortId) to attach it to a coaching period, or omit both to leave it unassigned. Set isTemplate to save it as a reusable template. The daily macro totals (totalCalories/totalProtein/totalCarbs/totalFat) are required. Optionally add a meals breakdown: each meal has a title and a foodItems array, and each food carries per-100g macros so the app can scale by quantity. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-nutrition-menus - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | No | Owning trainee id. Omit both traineeId and escortId to leave the menu unassigned. | | `isTemplate` | boolean | No | Save as a reusable template. A template cannot be assigned, so omit traineeId and escortId. | | `escortId` | string | No | Optional coaching period id | | `name` | string | Yes | | | `description` | string | No | | | `goal` | string | No | Allowed values: `Weight Loss`, `Muscle Gain`, `Weight Maintenance`, `Other`. | | `type` | string | No | Allowed values: `Vegetarian`, `Vegan`, `Keto`, `Paleo`, `Low Carbs`, `Gluten Free`, `Mediterranean`. | | `totalCalories` | number | Yes | Calories/day. Required. | | `totalProtein` | number | Yes | Grams of protein/day. Required. | | `totalCarbs` | number | Yes | Grams of carbs/day. Required. | | `totalFat` | number | Yes | Grams of fat/day. Required. | | `meals` | object[] | No | Daily meals (breakfast/lunch/dinner/snacks). Maximum items: `100`. | | `meals[].id` | string | No | Meal id. Not stable: saving the menu from the dashboard rewrites every meal with a new id, so re-read this endpoint before each write instead of caching it. Ignored on create; resend it on PATCH to keep the meal and its alternatives instead of replacing it with a new one. | | `meals[].title` | string | No | Meal name, e.g. "Breakfast". | | `meals[].foodItems` | object[] | No | | | `meals[].foodItems[].name` | string | No | Food name, e.g. "Chicken breast". | | `meals[].foodItems[].quantity` | number | No | Amount in the given unit, e.g. 150. | | `meals[].foodItems[].unit` | string | No | Unit of the quantity, e.g. "g", "ml", "unit". | | `meals[].foodItems[].unitWeight` | number | No | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `meals[].foodItems[].productCode` | number | No | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `meals[].foodItems[].caloriesPer100g` | number | No | | | `meals[].foodItems[].proteinPer100g` | number | No | | | `meals[].foodItems[].carbsPer100g` | number | No | | | `meals[].foodItems[].fatPer100g` | number | No | | | `meals[].calories` | number | No | Total calories for the meal. | | `meals[].protein` | number | No | | | `meals[].carbs` | number | No | | | `meals[].fat` | number | No | | | `meals[].notes` | string | No | | | `meals[].alternatives` | object[] | No | Alternatives the trainee may eat instead of this meal. Manage them one at a time with POST/DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives, or send the whole array here. Maximum items: `20`. | | `meals[].alternatives[].id` | string | No | Alternative id. Read-only; pass it to DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}. Not stable: saving the menu from the dashboard gives every alternative a new id, so read it fresh rather than caching it. | | `meals[].alternatives[].title` | string | No | Alternative name, e.g. "Omelette instead". | | `meals[].alternatives[].foodItems` | object[] | No | | | `meals[].alternatives[].foodItems[].name` | string | No | Food name, e.g. "Chicken breast". | | `meals[].alternatives[].foodItems[].quantity` | number | No | Amount in the given unit, e.g. 150. | | `meals[].alternatives[].foodItems[].unit` | string | No | Unit of the quantity, e.g. "g", "ml", "unit". | | `meals[].alternatives[].foodItems[].unitWeight` | number | No | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `meals[].alternatives[].foodItems[].productCode` | number | No | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `meals[].alternatives[].foodItems[].caloriesPer100g` | number | No | | | `meals[].alternatives[].foodItems[].proteinPer100g` | number | No | | | `meals[].alternatives[].foodItems[].carbsPer100g` | number | No | | | `meals[].alternatives[].foodItems[].fatPer100g` | number | No | | | `meals[].alternatives[].calories` | number | No | Total calories for the alternative. | | `meals[].alternatives[].protein` | number | No | | | `meals[].alternatives[].carbs` | number | No | | | `meals[].alternatives[].fat` | number | No | | | `meals[].alternatives[].notes` | string | No | | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.description` | string | | | `data.goal` | string | | | `data.type` | string | | | `data.totalCalories` | number | | | `data.totalProtein` | number | | | `data.totalCarbs` | number | | | `data.totalFat` | number | | | `data.meals` | object[] | | | `data.meals[].id` | string | Meal id. Not stable: saving the menu from the dashboard rewrites every meal with a new id, so re-read this endpoint before each write instead of caching it. Ignored on create; resend it on PATCH to keep the meal and its alternatives instead of replacing it with a new one. | | `data.meals[].title` | string | Meal name, e.g. "Breakfast". | | `data.meals[].foodItems` | object[] | | | `data.meals[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.meals[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.meals[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.meals[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.meals[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.meals[].foodItems[].caloriesPer100g` | number | | | `data.meals[].foodItems[].proteinPer100g` | number | | | `data.meals[].foodItems[].carbsPer100g` | number | | | `data.meals[].foodItems[].fatPer100g` | number | | | `data.meals[].calories` | number | Total calories for the meal. | | `data.meals[].protein` | number | | | `data.meals[].carbs` | number | | | `data.meals[].fat` | number | | | `data.meals[].notes` | string | | | `data.meals[].alternatives` | object[] | Alternatives the trainee may eat instead of this meal. Manage them one at a time with POST/DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives, or send the whole array here. Maximum items: `20`. | | `data.meals[].alternatives[].id` | string | Alternative id. Read-only; pass it to DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}. Not stable: saving the menu from the dashboard gives every alternative a new id, so read it fresh rather than caching it. | | `data.meals[].alternatives[].title` | string | Alternative name, e.g. "Omelette instead". | | `data.meals[].alternatives[].foodItems` | object[] | | | `data.meals[].alternatives[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.meals[].alternatives[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.meals[].alternatives[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.meals[].alternatives[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.meals[].alternatives[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.meals[].alternatives[].foodItems[].caloriesPer100g` | number | | | `data.meals[].alternatives[].foodItems[].proteinPer100g` | number | | | `data.meals[].alternatives[].foodItems[].carbsPer100g` | number | | | `data.meals[].alternatives[].foodItems[].fatPer100g` | number | | | `data.meals[].alternatives[].calories` | number | Total calories for the alternative. | | `data.meals[].alternatives[].protein` | number | | | `data.meals[].alternatives[].carbs` | number | | | `data.meals[].alternatives[].fat` | number | | | `data.meals[].alternatives[].notes` | string | | | `data.createdAt` | string | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "description": "", "goal": "", "type": "", "totalCalories": 123, "totalProtein": 123, "totalCarbs": 123, "totalFat": 123, "meals": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "", "alternatives": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "" } ] } ], "createdAt": "" }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/nutrition-menus' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "name": "", "totalCalories": 123, "totalProtein": 123, "totalCarbs": 123, "totalFat": 123 }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/nutrition-menus', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "", "totalCalories": 123, "totalProtein": 123, "totalCarbs": 123, "totalFat": 123 }), }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - Next: [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). --- # Get a nutrition menu `GET https://api.coach-platform.com/api/public/nutrition-menus/{menuId}` Get a nutrition menu by id (with full meals breakdown). - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `menuId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.description` | string | | | `data.goal` | string | | | `data.type` | string | | | `data.totalCalories` | number | | | `data.totalProtein` | number | | | `data.totalCarbs` | number | | | `data.totalFat` | number | | | `data.meals` | object[] | | | `data.meals[].id` | string | Meal id. Not stable: saving the menu from the dashboard rewrites every meal with a new id, so re-read this endpoint before each write instead of caching it. Ignored on create; resend it on PATCH to keep the meal and its alternatives instead of replacing it with a new one. | | `data.meals[].title` | string | Meal name, e.g. "Breakfast". | | `data.meals[].foodItems` | object[] | | | `data.meals[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.meals[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.meals[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.meals[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.meals[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.meals[].foodItems[].caloriesPer100g` | number | | | `data.meals[].foodItems[].proteinPer100g` | number | | | `data.meals[].foodItems[].carbsPer100g` | number | | | `data.meals[].foodItems[].fatPer100g` | number | | | `data.meals[].calories` | number | Total calories for the meal. | | `data.meals[].protein` | number | | | `data.meals[].carbs` | number | | | `data.meals[].fat` | number | | | `data.meals[].notes` | string | | | `data.meals[].alternatives` | object[] | Alternatives the trainee may eat instead of this meal. Manage them one at a time with POST/DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives, or send the whole array here. Maximum items: `20`. | | `data.meals[].alternatives[].id` | string | Alternative id. Read-only; pass it to DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}. Not stable: saving the menu from the dashboard gives every alternative a new id, so read it fresh rather than caching it. | | `data.meals[].alternatives[].title` | string | Alternative name, e.g. "Omelette instead". | | `data.meals[].alternatives[].foodItems` | object[] | | | `data.meals[].alternatives[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.meals[].alternatives[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.meals[].alternatives[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.meals[].alternatives[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.meals[].alternatives[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.meals[].alternatives[].foodItems[].caloriesPer100g` | number | | | `data.meals[].alternatives[].foodItems[].proteinPer100g` | number | | | `data.meals[].alternatives[].foodItems[].carbsPer100g` | number | | | `data.meals[].alternatives[].foodItems[].fatPer100g` | number | | | `data.meals[].alternatives[].calories` | number | Total calories for the alternative. | | `data.meals[].alternatives[].protein` | number | | | `data.meals[].alternatives[].carbs` | number | | | `data.meals[].alternatives[].fat` | number | | | `data.meals[].alternatives[].notes` | string | | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "description": "", "goal": "", "type": "", "totalCalories": 123, "totalProtein": 123, "totalCarbs": 123, "totalFat": 123, "meals": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "", "alternatives": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "" } ] } ], "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/nutrition-menus/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/nutrition-menus/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - Next: [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. --- # Update a nutrition menu `PATCH https://api.coach-platform.com/api/public/nutrition-menus/{menuId}` Partially update a nutrition menu. Does not cascade: copies duplicated from this menu are left untouched, unlike the dashboard which offers to push the edit down to them. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `menuId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | No | | | `description` | string | No | | | `goal` | string | No | Allowed values: `Weight Loss`, `Muscle Gain`, `Weight Maintenance`, `Other`. | | `type` | string | No | Allowed values: `Vegetarian`, `Vegan`, `Keto`, `Paleo`, `Low Carbs`, `Gluten Free`, `Mediterranean`. | | `totalCalories` | number | No | | | `totalProtein` | number | No | | | `totalCarbs` | number | No | | | `totalFat` | number | No | | | `meals` | object[] | No | Maximum items: `100`. | | `meals[].id` | string | No | Meal id. Not stable: saving the menu from the dashboard rewrites every meal with a new id, so re-read this endpoint before each write instead of caching it. Ignored on create; resend it on PATCH to keep the meal and its alternatives instead of replacing it with a new one. | | `meals[].title` | string | No | Meal name, e.g. "Breakfast". | | `meals[].foodItems` | object[] | No | | | `meals[].foodItems[].name` | string | No | Food name, e.g. "Chicken breast". | | `meals[].foodItems[].quantity` | number | No | Amount in the given unit, e.g. 150. | | `meals[].foodItems[].unit` | string | No | Unit of the quantity, e.g. "g", "ml", "unit". | | `meals[].foodItems[].unitWeight` | number | No | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `meals[].foodItems[].productCode` | number | No | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `meals[].foodItems[].caloriesPer100g` | number | No | | | `meals[].foodItems[].proteinPer100g` | number | No | | | `meals[].foodItems[].carbsPer100g` | number | No | | | `meals[].foodItems[].fatPer100g` | number | No | | | `meals[].calories` | number | No | Total calories for the meal. | | `meals[].protein` | number | No | | | `meals[].carbs` | number | No | | | `meals[].fat` | number | No | | | `meals[].notes` | string | No | | | `meals[].alternatives` | object[] | No | Alternatives the trainee may eat instead of this meal. Manage them one at a time with POST/DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives, or send the whole array here. Maximum items: `20`. | | `meals[].alternatives[].id` | string | No | Alternative id. Read-only; pass it to DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}. Not stable: saving the menu from the dashboard gives every alternative a new id, so read it fresh rather than caching it. | | `meals[].alternatives[].title` | string | No | Alternative name, e.g. "Omelette instead". | | `meals[].alternatives[].foodItems` | object[] | No | | | `meals[].alternatives[].foodItems[].name` | string | No | Food name, e.g. "Chicken breast". | | `meals[].alternatives[].foodItems[].quantity` | number | No | Amount in the given unit, e.g. 150. | | `meals[].alternatives[].foodItems[].unit` | string | No | Unit of the quantity, e.g. "g", "ml", "unit". | | `meals[].alternatives[].foodItems[].unitWeight` | number | No | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `meals[].alternatives[].foodItems[].productCode` | number | No | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `meals[].alternatives[].foodItems[].caloriesPer100g` | number | No | | | `meals[].alternatives[].foodItems[].proteinPer100g` | number | No | | | `meals[].alternatives[].foodItems[].carbsPer100g` | number | No | | | `meals[].alternatives[].foodItems[].fatPer100g` | number | No | | | `meals[].alternatives[].calories` | number | No | Total calories for the alternative. | | `meals[].alternatives[].protein` | number | No | | | `meals[].alternatives[].carbs` | number | No | | | `meals[].alternatives[].fat` | number | No | | | `meals[].alternatives[].notes` | string | No | | | `applyToAllSharedTrainees` | boolean | No | Required (true) to edit a menu shared by multiple trainees; the change then applies to all of them. Without it, a shared menu returns 409. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.description` | string | | | `data.goal` | string | | | `data.type` | string | | | `data.totalCalories` | number | | | `data.totalProtein` | number | | | `data.totalCarbs` | number | | | `data.totalFat` | number | | | `data.meals` | object[] | | | `data.meals[].id` | string | Meal id. Not stable: saving the menu from the dashboard rewrites every meal with a new id, so re-read this endpoint before each write instead of caching it. Ignored on create; resend it on PATCH to keep the meal and its alternatives instead of replacing it with a new one. | | `data.meals[].title` | string | Meal name, e.g. "Breakfast". | | `data.meals[].foodItems` | object[] | | | `data.meals[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.meals[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.meals[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.meals[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.meals[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.meals[].foodItems[].caloriesPer100g` | number | | | `data.meals[].foodItems[].proteinPer100g` | number | | | `data.meals[].foodItems[].carbsPer100g` | number | | | `data.meals[].foodItems[].fatPer100g` | number | | | `data.meals[].calories` | number | Total calories for the meal. | | `data.meals[].protein` | number | | | `data.meals[].carbs` | number | | | `data.meals[].fat` | number | | | `data.meals[].notes` | string | | | `data.meals[].alternatives` | object[] | Alternatives the trainee may eat instead of this meal. Manage them one at a time with POST/DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives, or send the whole array here. Maximum items: `20`. | | `data.meals[].alternatives[].id` | string | Alternative id. Read-only; pass it to DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}. Not stable: saving the menu from the dashboard gives every alternative a new id, so read it fresh rather than caching it. | | `data.meals[].alternatives[].title` | string | Alternative name, e.g. "Omelette instead". | | `data.meals[].alternatives[].foodItems` | object[] | | | `data.meals[].alternatives[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.meals[].alternatives[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.meals[].alternatives[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.meals[].alternatives[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.meals[].alternatives[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.meals[].alternatives[].foodItems[].caloriesPer100g` | number | | | `data.meals[].alternatives[].foodItems[].proteinPer100g` | number | | | `data.meals[].alternatives[].foodItems[].carbsPer100g` | number | | | `data.meals[].alternatives[].foodItems[].fatPer100g` | number | | | `data.meals[].alternatives[].calories` | number | Total calories for the alternative. | | `data.meals[].alternatives[].protein` | number | | | `data.meals[].alternatives[].carbs` | number | | | `data.meals[].alternatives[].fat` | number | | | `data.meals[].alternatives[].notes` | string | | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "description": "", "goal": "", "type": "", "totalCalories": 123, "totalProtein": 123, "totalCarbs": 123, "totalFat": 123, "meals": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "", "alternatives": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "" } ] } ], "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request PATCH \ --url 'https://api.coach-platform.com/api/public/nutrition-menus/' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "name": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/nutrition-menus/', { method: 'PATCH', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - Next: [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. --- # Delete a nutrition menu `DELETE https://api.coach-platform.com/api/public/nutrition-menus/{menuId}` Delete a nutrition menu permanently. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `menuId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request DELETE \ --url 'https://api.coach-platform.com/api/public/nutrition-menus/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/nutrition-menus/', { method: 'DELETE', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - Next: [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). --- # Get a trainee's active nutrition menu `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/active-nutrition-menu` Get a trainee's currently active nutrition menu (resolved via the active coaching period). 404 if the trainee has no active menu. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.escorts` | string[] | | | `data.title` | string | | | `data.description` | string | | | `data.goal` | string | | | `data.type` | string | | | `data.totalCalories` | number | | | `data.totalProtein` | number | | | `data.totalCarbs` | number | | | `data.totalFat` | number | | | `data.meals` | object[] | | | `data.meals[].id` | string | Meal id. Not stable: saving the menu from the dashboard rewrites every meal with a new id, so re-read this endpoint before each write instead of caching it. Ignored on create; resend it on PATCH to keep the meal and its alternatives instead of replacing it with a new one. | | `data.meals[].title` | string | Meal name, e.g. "Breakfast". | | `data.meals[].foodItems` | object[] | | | `data.meals[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.meals[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.meals[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.meals[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.meals[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.meals[].foodItems[].caloriesPer100g` | number | | | `data.meals[].foodItems[].proteinPer100g` | number | | | `data.meals[].foodItems[].carbsPer100g` | number | | | `data.meals[].foodItems[].fatPer100g` | number | | | `data.meals[].calories` | number | Total calories for the meal. | | `data.meals[].protein` | number | | | `data.meals[].carbs` | number | | | `data.meals[].fat` | number | | | `data.meals[].notes` | string | | | `data.meals[].alternatives` | object[] | Alternatives the trainee may eat instead of this meal. Manage them one at a time with POST/DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives, or send the whole array here. Maximum items: `20`. | | `data.meals[].alternatives[].id` | string | Alternative id. Read-only; pass it to DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}. Not stable: saving the menu from the dashboard gives every alternative a new id, so read it fresh rather than caching it. | | `data.meals[].alternatives[].title` | string | Alternative name, e.g. "Omelette instead". | | `data.meals[].alternatives[].foodItems` | object[] | | | `data.meals[].alternatives[].foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.meals[].alternatives[].foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.meals[].alternatives[].foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.meals[].alternatives[].foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.meals[].alternatives[].foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.meals[].alternatives[].foodItems[].caloriesPer100g` | number | | | `data.meals[].alternatives[].foodItems[].proteinPer100g` | number | | | `data.meals[].alternatives[].foodItems[].carbsPer100g` | number | | | `data.meals[].alternatives[].foodItems[].fatPer100g` | number | | | `data.meals[].alternatives[].calories` | number | Total calories for the alternative. | | `data.meals[].alternatives[].protein` | number | | | `data.meals[].alternatives[].carbs` | number | | | `data.meals[].alternatives[].fat` | number | | | `data.meals[].alternatives[].notes` | string | | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "escorts": [ "" ], "title": "", "description": "", "goal": "", "type": "", "totalCalories": 123, "totalProtein": 123, "totalCarbs": 123, "totalFat": 123, "meals": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "", "alternatives": [ { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "" } ] } ], "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//active-nutrition-menu' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//active-nutrition-menu', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - Next: [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. --- # Add an alternative meal `POST https://api.coach-platform.com/api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives` Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. Take mealId from the meals array of GET /nutrition-menus/{menuId}. The alternative carries its own foods and macros and does not change the menu totals. Returns the alternative including its id. Does not cascade: copies duplicated from this menu keep their own alternatives — repeat the call against the menuId of each copy to update them. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `menuId` | string | Yes | | | `mealId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `title` | string | Yes | Alternative name, e.g. "Omelette instead". | | `foodItems` | object[] | No | Maximum items: `100`. | | `foodItems[].name` | string | No | Food name, e.g. "Chicken breast". | | `foodItems[].quantity` | number | No | Amount in the given unit, e.g. 150. | | `foodItems[].unit` | string | No | Unit of the quantity, e.g. "g", "ml", "unit". | | `foodItems[].unitWeight` | number | No | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `foodItems[].productCode` | number | No | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `foodItems[].caloriesPer100g` | number | No | | | `foodItems[].proteinPer100g` | number | No | | | `foodItems[].carbsPer100g` | number | No | | | `foodItems[].fatPer100g` | number | No | | | `calories` | number | Yes | Total calories for the alternative. Required. | | `protein` | number | Yes | Grams of protein. Required. | | `carbs` | number | Yes | Grams of carbs. Required. | | `fat` | number | Yes | Grams of fat. Required. | | `notes` | string | No | | | `applyToAllSharedTrainees` | boolean | No | Required (true) to edit a menu shared by multiple trainees; the alternative is then added for all of them. Without it, a shared menu returns 409. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | An alternative the trainee may eat instead of the meal it belongs to. Its macros do not count towards the menu totals. | | `data.id` | string | Alternative id. Read-only; pass it to DELETE /nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}. Not stable: saving the menu from the dashboard gives every alternative a new id, so read it fresh rather than caching it. | | `data.title` | string | Alternative name, e.g. "Omelette instead". | | `data.foodItems` | object[] | | | `data.foodItems[].name` | string | Food name, e.g. "Chicken breast". | | `data.foodItems[].quantity` | number | Amount in the given unit, e.g. 150. | | `data.foodItems[].unit` | string | Unit of the quantity, e.g. "g", "ml", "unit". | | `data.foodItems[].unitWeight` | number | Grams in one unit. The app scales macros as quantity * unitWeight / 100 * the per-100g values, so send it whenever unit is not grams. Take it from the matching entry in the units array of GET /food-items. Defaults to 100. | | `data.foodItems[].productCode` | number | Food database code, from GET /food-items. Send it to link the food to its catalog entry so replacements and portion data behave like they do in the dashboard. | | `data.foodItems[].caloriesPer100g` | number | | | `data.foodItems[].proteinPer100g` | number | | | `data.foodItems[].carbsPer100g` | number | | | `data.foodItems[].fatPer100g` | number | | | `data.calories` | number | Total calories for the alternative. | | `data.protein` | number | | | `data.carbs` | number | | | `data.fat` | number | | | `data.notes` | string | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "title": "", "foodItems": [ { "name": "", "quantity": 123, "unit": "", "unitWeight": 123, "productCode": 123, "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123 } ], "calories": 123, "protein": 123, "carbs": 123, "fat": 123, "notes": "" }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/nutrition-menus//meals//alternatives' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "title": "", "calories": 123, "protein": 123, "carbs": 123, "fat": 123 }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/nutrition-menus//meals//alternatives', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "title": "", "calories": 123, "protein": 123, "carbs": 123, "fat": 123 }), }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - Next: [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. --- # Remove an alternative meal `DELETE https://api.coach-platform.com/api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}` Remove one alternative meal from a meal. Take mealId and alternativeId from GET /nutrition-menus/{menuId}. Does not cascade: copies duplicated from this menu keep their own alternatives. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `menuId` | string | Yes | | | `mealId` | string | Yes | | | `alternativeId` | string | Yes | | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `applyToAllSharedTrainees` | boolean | No | Required (true) to edit a menu shared by multiple trainees; the alternative is then removed for all of them. Without it, a shared menu returns 409. | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request DELETE \ --url 'https://api.coach-platform.com/api/public/nutrition-menus//meals//alternatives/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/nutrition-menus//meals//alternatives/', { method: 'DELETE', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Previous: [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - Next: [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. --- # Search the food database `GET https://api.coach-platform.com/api/public/food-items` Search the food database the dashboard searches: the shared catalog plus the coach's own items. Use it to build meals with real nutrition data — copy productCode, the per-100g macros and a unit/unitWeight pair onto each meal food item. Omit search and barcode to browse the catalog. - Resource: Nutrition Menus - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-food-items - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `search` | string | No | Food name to search for. Matches anywhere in the name, best matches first. | | `barcode` | string | No | Exact barcode lookup. Takes precedence over search. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].productCode` | number | Send this as productCode on a meal food item to link it to this entry. | | `data[].name` | string | | | `data[].manufacturer` | string | | | `data[].barcode` | string | | | `data[].caloriesPer100g` | number | | | `data[].proteinPer100g` | number | | | `data[].carbsPer100g` | number | | | `data[].fatPer100g` | number | | | `data[].isFavorite` | boolean | | | `data[].isCustom` | boolean | True when the coach created this item, false when it comes from the shared database. | | `data[].units` | object[] | Units this food can be measured in. unitWeight is how many grams one unit weighs — copy the pair onto a meal food item as unit + unitWeight. | | `data[].units[].unit` | string | | | `data[].units[].unitWeight` | number | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "productCode": 123, "name": "", "manufacturer": "", "barcode": "", "caloriesPer100g": 123, "proteinPer100g": 123, "carbsPer100g": 123, "fatPer100g": 123, "isFavorite": true, "isCustom": true, "units": [ { "unit": "", "unitWeight": 123 } ] } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/food-items' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/food-items', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get a trainee's daily nutrition log](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-nutrition-log/index.md): `GET /api/public/trainees/{traineeId}/nutrition-log`. What a trainee actually ate on ONE day: the food log for that date, per-meal and per-day calorie/macro totals, and the times of day the food was logged. - [List nutrition menus](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus/index.md): `GET /api/public/nutrition-menus`. List nutrition menus. - [Create a nutrition menu](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus/index.md): `POST /api/public/nutrition-menus`. Create a nutrition menu. - [Get a nutrition menu](https://www.coach-platform.com/docs/api/reference/get-nutrition-menus-menu-id/index.md): `GET /api/public/nutrition-menus/{menuId}`. Get a nutrition menu by id (with full meals breakdown). - [Update a nutrition menu](https://www.coach-platform.com/docs/api/reference/patch-nutrition-menus-menu-id/index.md): `PATCH /api/public/nutrition-menus/{menuId}`. Partially update a nutrition menu. - [Delete a nutrition menu](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}`. Delete a nutrition menu permanently. - [Get a trainee's active nutrition menu](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-active-nutrition-menu/index.md): `GET /api/public/trainees/{traineeId}/active-nutrition-menu`. Get a trainee's currently active nutrition menu (resolved via the active coaching period). - [Add an alternative meal](https://www.coach-platform.com/docs/api/reference/post-nutrition-menus-menu-id-meals-meal-id-alternatives/index.md): `POST /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives`. Add an alternative meal to one meal of a menu — the same "add alternative meal" the dashboard offers. - [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - Previous: [Remove an alternative meal](https://www.coach-platform.com/docs/api/reference/delete-nutrition-menus-menu-id-meals-meal-id-alternatives-alternative-id/index.md): `DELETE /api/public/nutrition-menus/{menuId}/meals/{mealId}/alternatives/{alternativeId}`. Remove one alternative meal from a meal. - Next: [List meetings](https://www.coach-platform.com/docs/api/reference/get-meetings/index.md): `GET /api/public/meetings`. List meetings in a time window. --- # List meetings `GET https://api.coach-platform.com/api/public/meetings` List meetings in a time window. Filter by traineeId. - Resource: Meetings - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-meetings - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `from` | string | No | ISO date — earliest startDate | | `to` | string | No | ISO date — latest startDate | | `traineeId` | string | No | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].coach` | string | | | `data[].title` | string | | | `data[].startDate` | string | | | `data[].endDate` | string | | | `data[].duration` | number | | | `data[].type` | string | Allowed values: `Online`, `In person`. | | `data[].meetingType` | string | Allowed values: `Individual`, `Group`. | | `data[].onlineLink` | string | | | `data[].address` | string | | | `data[].notes` | string | | | `data[].status` | string | | | `data[].capacity` | number | | | `data[].trainees` | object[] | Meeting attendees. email and phoneNumber are returned only when the key also has the trainees:read scope. | | `data[].trainees[].id` | string | | | `data[].trainees[].name` | string | | | `data[].trainees[].email` | string | | | `data[].trainees[].phoneNumber` | string | | | `data[].createdAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "coach": "", "title": "", "startDate": "", "endDate": "", "duration": 123, "type": "Online", "meetingType": "Individual", "onlineLink": "", "address": "", "notes": "", "status": "", "capacity": 123, "trainees": [ { "id": "", "name": "", "email": "", "phoneNumber": "" } ], "createdAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/meetings' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/meetings', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Schedule a meeting](https://www.coach-platform.com/docs/api/reference/post-meetings/index.md): `POST /api/public/meetings`. Schedule a meeting. - [Get a meeting](https://www.coach-platform.com/docs/api/reference/get-meetings-meeting-id/index.md): `GET /api/public/meetings/{meetingId}`. Get a meeting by id. - [Update a meeting](https://www.coach-platform.com/docs/api/reference/patch-meetings-meeting-id/index.md): `PATCH /api/public/meetings/{meetingId}`. Update a meeting (time, title, attendees, notes, status). - [Delete a meeting](https://www.coach-platform.com/docs/api/reference/delete-meetings-meeting-id/index.md): `DELETE /api/public/meetings/{meetingId}`. Delete a meeting permanently. - Previous: [Search the food database](https://www.coach-platform.com/docs/api/reference/get-food-items/index.md): `GET /api/public/food-items`. Search the food database the dashboard searches: the shared catalog plus the coach's own items. - Next: [Schedule a meeting](https://www.coach-platform.com/docs/api/reference/post-meetings/index.md): `POST /api/public/meetings`. Schedule a meeting. --- # Schedule a meeting `POST https://api.coach-platform.com/api/public/meetings` Schedule a meeting. "type" is the location (Online or In person). "meetingType" is the format (Individual or Group). - Resource: Meetings - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-meetings - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `title` | string | Yes | | | `startDate` | string | Yes | ISO date-time | | `endDate` | string | Yes | ISO date-time | | `duration` | number | No | Minutes (optional) | | `type` | string | Yes | Allowed values: `Online`, `In person`. | | `meetingType` | string | No | Allowed values: `Individual`, `Group`. | | `onlineLink` | string | No | Zoom/Meet URL | | `address` | string | No | Physical address | | `notes` | string | No | | | `trainees` | string[] | No | Array of trainee ids Maximum items: `500`. | | `capacity` | number | No | For group meetings | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.title` | string | | | `data.startDate` | string | | | `data.endDate` | string | | | `data.duration` | number | | | `data.type` | string | Allowed values: `Online`, `In person`. | | `data.meetingType` | string | Allowed values: `Individual`, `Group`. | | `data.onlineLink` | string | | | `data.address` | string | | | `data.notes` | string | | | `data.status` | string | | | `data.capacity` | number | | | `data.trainees` | object[] | Meeting attendees. email and phoneNumber are returned only when the key also has the trainees:read scope. | | `data.trainees[].id` | string | | | `data.trainees[].name` | string | | | `data.trainees[].email` | string | | | `data.trainees[].phoneNumber` | string | | | `data.createdAt` | string | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "coach": "", "title": "", "startDate": "", "endDate": "", "duration": 123, "type": "Online", "meetingType": "Individual", "onlineLink": "", "address": "", "notes": "", "status": "", "capacity": 123, "trainees": [ { "id": "", "name": "", "email": "", "phoneNumber": "" } ], "createdAt": "" }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/meetings' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "title": "", "startDate": "", "endDate": "", "type": "Online" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/meetings', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "title": "", "startDate": "", "endDate": "", "type": "Online" }), }); const data = await response.json(); ``` ## Related endpoints - [List meetings](https://www.coach-platform.com/docs/api/reference/get-meetings/index.md): `GET /api/public/meetings`. List meetings in a time window. - [Get a meeting](https://www.coach-platform.com/docs/api/reference/get-meetings-meeting-id/index.md): `GET /api/public/meetings/{meetingId}`. Get a meeting by id. - [Update a meeting](https://www.coach-platform.com/docs/api/reference/patch-meetings-meeting-id/index.md): `PATCH /api/public/meetings/{meetingId}`. Update a meeting (time, title, attendees, notes, status). - [Delete a meeting](https://www.coach-platform.com/docs/api/reference/delete-meetings-meeting-id/index.md): `DELETE /api/public/meetings/{meetingId}`. Delete a meeting permanently. - Previous: [List meetings](https://www.coach-platform.com/docs/api/reference/get-meetings/index.md): `GET /api/public/meetings`. List meetings in a time window. - Next: [Get a meeting](https://www.coach-platform.com/docs/api/reference/get-meetings-meeting-id/index.md): `GET /api/public/meetings/{meetingId}`. Get a meeting by id. --- # Get a meeting `GET https://api.coach-platform.com/api/public/meetings/{meetingId}` Get a meeting by id. - Resource: Meetings - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-meetings-meeting-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `meetingId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.title` | string | | | `data.startDate` | string | | | `data.endDate` | string | | | `data.duration` | number | | | `data.type` | string | Allowed values: `Online`, `In person`. | | `data.meetingType` | string | Allowed values: `Individual`, `Group`. | | `data.onlineLink` | string | | | `data.address` | string | | | `data.notes` | string | | | `data.status` | string | | | `data.capacity` | number | | | `data.trainees` | object[] | Meeting attendees. email and phoneNumber are returned only when the key also has the trainees:read scope. | | `data.trainees[].id` | string | | | `data.trainees[].name` | string | | | `data.trainees[].email` | string | | | `data.trainees[].phoneNumber` | string | | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "title": "", "startDate": "", "endDate": "", "duration": 123, "type": "Online", "meetingType": "Individual", "onlineLink": "", "address": "", "notes": "", "status": "", "capacity": 123, "trainees": [ { "id": "", "name": "", "email": "", "phoneNumber": "" } ], "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/meetings/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/meetings/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List meetings](https://www.coach-platform.com/docs/api/reference/get-meetings/index.md): `GET /api/public/meetings`. List meetings in a time window. - [Schedule a meeting](https://www.coach-platform.com/docs/api/reference/post-meetings/index.md): `POST /api/public/meetings`. Schedule a meeting. - [Update a meeting](https://www.coach-platform.com/docs/api/reference/patch-meetings-meeting-id/index.md): `PATCH /api/public/meetings/{meetingId}`. Update a meeting (time, title, attendees, notes, status). - [Delete a meeting](https://www.coach-platform.com/docs/api/reference/delete-meetings-meeting-id/index.md): `DELETE /api/public/meetings/{meetingId}`. Delete a meeting permanently. - Previous: [Schedule a meeting](https://www.coach-platform.com/docs/api/reference/post-meetings/index.md): `POST /api/public/meetings`. Schedule a meeting. - Next: [Update a meeting](https://www.coach-platform.com/docs/api/reference/patch-meetings-meeting-id/index.md): `PATCH /api/public/meetings/{meetingId}`. Update a meeting (time, title, attendees, notes, status). --- # Update a meeting `PATCH https://api.coach-platform.com/api/public/meetings/{meetingId}` Update a meeting (time, title, attendees, notes, status). Only provided fields change. - Resource: Meetings - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/patch-meetings-meeting-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `meetingId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `title` | string | No | | | `startDate` | string | No | ISO date-time | | `endDate` | string | No | ISO date-time | | `duration` | number | No | Minutes | | `type` | string | No | Allowed values: `Online`, `In person`. | | `meetingType` | string | No | Allowed values: `Individual`, `Group`. | | `onlineLink` | string | No | | | `address` | string | No | | | `notes` | string | No | | | `trainees` | string[] | No | Replaces the attendee list Maximum items: `500`. | | `capacity` | number | No | | | `status` | string | No | Allowed values: `Active`, `Canceled`, `Completed`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coach` | string | | | `data.title` | string | | | `data.startDate` | string | | | `data.endDate` | string | | | `data.duration` | number | | | `data.type` | string | Allowed values: `Online`, `In person`. | | `data.meetingType` | string | Allowed values: `Individual`, `Group`. | | `data.onlineLink` | string | | | `data.address` | string | | | `data.notes` | string | | | `data.status` | string | | | `data.capacity` | number | | | `data.trainees` | object[] | Meeting attendees. email and phoneNumber are returned only when the key also has the trainees:read scope. | | `data.trainees[].id` | string | | | `data.trainees[].name` | string | | | `data.trainees[].email` | string | | | `data.trainees[].phoneNumber` | string | | | `data.createdAt` | string | | Example: ```json { "data": { "id": "", "coach": "", "title": "", "startDate": "", "endDate": "", "duration": 123, "type": "Online", "meetingType": "Individual", "onlineLink": "", "address": "", "notes": "", "status": "", "capacity": 123, "trainees": [ { "id": "", "name": "", "email": "", "phoneNumber": "" } ], "createdAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request PATCH \ --url 'https://api.coach-platform.com/api/public/meetings/' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "title": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/meetings/', { method: 'PATCH', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "title": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List meetings](https://www.coach-platform.com/docs/api/reference/get-meetings/index.md): `GET /api/public/meetings`. List meetings in a time window. - [Schedule a meeting](https://www.coach-platform.com/docs/api/reference/post-meetings/index.md): `POST /api/public/meetings`. Schedule a meeting. - [Get a meeting](https://www.coach-platform.com/docs/api/reference/get-meetings-meeting-id/index.md): `GET /api/public/meetings/{meetingId}`. Get a meeting by id. - [Delete a meeting](https://www.coach-platform.com/docs/api/reference/delete-meetings-meeting-id/index.md): `DELETE /api/public/meetings/{meetingId}`. Delete a meeting permanently. - Previous: [Get a meeting](https://www.coach-platform.com/docs/api/reference/get-meetings-meeting-id/index.md): `GET /api/public/meetings/{meetingId}`. Get a meeting by id. - Next: [Delete a meeting](https://www.coach-platform.com/docs/api/reference/delete-meetings-meeting-id/index.md): `DELETE /api/public/meetings/{meetingId}`. Delete a meeting permanently. --- # Delete a meeting `DELETE https://api.coach-platform.com/api/public/meetings/{meetingId}` Delete a meeting permanently. - Resource: Meetings - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/delete-meetings-meeting-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `meetingId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK The OpenAPI spec does not describe a response body for this status. ## Examples ### cURL ```bash curl --request DELETE \ --url 'https://api.coach-platform.com/api/public/meetings/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/meetings/', { method: 'DELETE', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List meetings](https://www.coach-platform.com/docs/api/reference/get-meetings/index.md): `GET /api/public/meetings`. List meetings in a time window. - [Schedule a meeting](https://www.coach-platform.com/docs/api/reference/post-meetings/index.md): `POST /api/public/meetings`. Schedule a meeting. - [Get a meeting](https://www.coach-platform.com/docs/api/reference/get-meetings-meeting-id/index.md): `GET /api/public/meetings/{meetingId}`. Get a meeting by id. - [Update a meeting](https://www.coach-platform.com/docs/api/reference/patch-meetings-meeting-id/index.md): `PATCH /api/public/meetings/{meetingId}`. Update a meeting (time, title, attendees, notes, status). - Previous: [Update a meeting](https://www.coach-platform.com/docs/api/reference/patch-meetings-meeting-id/index.md): `PATCH /api/public/meetings/{meetingId}`. Update a meeting (time, title, attendees, notes, status). - Next: [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach. --- # List forms `GET https://api.coach-platform.com/api/public/forms` List forms (questionnaires) created by the coach. Returns each form's metadata only; the questions are NOT included here. To read the questions of a form, call GET /forms/{formId}. Use type=registration for the intake questionnaire trainees fill in when they join, and type=update for recurring check-in forms. - Resource: Forms - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-forms - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `type` | string | No | Filter by form kind. "registration" is the join-time intake questionnaire; "update" is a recurring check-in form. Omit for both. Allowed values: `registration`, `update`. | | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].coach` | string | | | `data[].title` | string | | | `data[].description` | string | | | `data[].type` | string | registration = the join-time intake questionnaire. update = a recurring check-in form. Allowed values: `registration`, `update`. | | `data[].isActive` | boolean | | | `data[].registrationOrder` | integer | Order this form is presented in during registration, when several registration forms exist. | | `data[].openAt` | object | When and how often the form opens for trainees. | | `data[].openAt.date` | string | | | `data[].openAt.recurrence` | string | How often the form reopens. Allowed values: `weekly`, `bi-weekly`, `tri-weekly`, `monthly`. | | `data[].openAt.openDays` | integer | How many days the form stays open once it opens. | | `data[].target` | string | Who the form is shown to. byLabels targets trainees carrying at least one of targetLabels. Allowed values: `allTrainees`, `males`, `females`, `byLabels`. | | `data[].targetLabels` | object[] | Labels this form targets. Only present when target is byLabels. | | `data[].targetLabels[].id` | string | | | `data[].targetLabels[].text` | string | | | `data[].targetLabels[].color` | string | | | `data[].createdAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "coach": "", "title": "", "description": "", "type": "registration", "isActive": true, "registrationOrder": 123, "openAt": { "date": "", "recurrence": "weekly", "openDays": 123 }, "target": "allTrainees", "targetLabels": [ { "id": "", "text": "", "color": "" } ], "createdAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/forms' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/forms', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first. - [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first. - [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md): `POST /api/public/updates/{updateId}/respond`. Respond to a submitted check-in. - [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set. - [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers. - [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first. - Previous: [Delete a meeting](https://www.coach-platform.com/docs/api/reference/delete-meetings-meeting-id/index.md): `DELETE /api/public/meetings/{meetingId}`. Delete a meeting permanently. - Next: [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first. --- # List registration form responses `GET https://api.coach-platform.com/api/public/forms/registration` List submitted registration (intake) form responses across every registration form, newest first. This is the questionnaire a trainee fills in when joining. Pass traineeId to read one trainee's intake answers. Each answer carries its question label and field type alongside the value. Trainee personal details and phone number are included only when the key also has trainees:read. - Resource: Forms - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-forms-registration - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | No | Only responses submitted by this trainee. | | `includeAnswers` | boolean | No | Embed each response's answers instead of returning metadata only, so one call gives both the questions and what the trainee replied. Every answer carries its question label, field type and value, and file, photo and signature answers also carry a temporary presignedUrl. Requires traineeId, which keeps the number of answers bounded. | | `status` | string | No | Filter by handling status. Allowed values: `Pending`, `Handled`. | | `search` | string | No | Search the trainee name or the form title. | | `gender` | string | No | Filter by trainee gender. Allowed values: `males`, `females`, `allTrainees`. | | `labels` | string | No | Comma-separated label ids the trainee must carry. | | `dateFrom` | string | No | Only responses submitted on or after this date (YYYY-MM-DD). | | `dateTo` | string | No | Only responses submitted on or before this date (YYYY-MM-DD). | | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].formId` | string | Id of the form that was submitted. | | `data[].formTitle` | string | | | `data[].formType` | string | Allowed values: `registration`, `update`. | | `data[].traineeInfo` | object | The trainee who submitted it. | | `data[].traineeInfo.id` | string | | | `data[].traineeInfo.name` | string | | | `data[].traineeInfo.gender` | string | | | `data[].status` | string | Allowed values: `Pending`, `Handled`. | | `data[].createdAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "formId": "", "formTitle": "", "formType": "registration", "traineeInfo": { "id": "", "name": "", "gender": "" }, "status": "Pending", "createdAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/forms/registration' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/forms/registration', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach. - [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first. - [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md): `POST /api/public/updates/{updateId}/respond`. Respond to a submitted check-in. - [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set. - [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers. - [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first. - Previous: [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach. - Next: [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first. --- # List check-in responses `GET https://api.coach-platform.com/api/public/updates` List submitted update (check-in) form responses across every update form, newest first. Pass traineeId to read one trainee's check-in history. Registration forms are not included here; use GET /forms/registration for those. Trainee personal details and phone number are included only when the key also has trainees:read. - Resource: Forms - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-updates - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | No | Only responses submitted by this trainee. | | `escortId` | string | No | Only responses from this coaching period. | | `status` | string | No | Filter by handling status. Allowed values: `Pending`, `Handled`. | | `search` | string | No | Search the trainee name or the form title. | | `gender` | string | No | Filter by trainee gender. Allowed values: `males`, `females`, `allTrainees`. | | `labels` | string | No | Comma-separated label ids the trainee must carry. | | `formTargetLabels` | string | No | Comma-separated label ids the form targets. | | `type` | string | No | Restrict to a form kind. Allowed values: `update`, `dynamic`. | | `sort` | string | No | Order by submission date. Defaults to desc. Allowed values: `asc`, `desc`. | | `dateFrom` | string | No | Only responses submitted on or after this date (YYYY-MM-DD). | | `dateTo` | string | No | Only responses submitted on or before this date (YYYY-MM-DD). | | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].formId` | string | Id of the form that was submitted. | | `data[].formTitle` | string | | | `data[].formType` | string | Allowed values: `registration`, `update`. | | `data[].traineeInfo` | object | The trainee who submitted it. | | `data[].traineeInfo.id` | string | | | `data[].traineeInfo.name` | string | | | `data[].traineeInfo.gender` | string | | | `data[].status` | string | Allowed values: `Pending`, `Handled`. | | `data[].createdAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "formId": "", "formTitle": "", "formType": "registration", "traineeInfo": { "id": "", "name": "", "gender": "" }, "status": "Pending", "createdAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/updates' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/updates', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach. - [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first. - [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md): `POST /api/public/updates/{updateId}/respond`. Respond to a submitted check-in. - [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set. - [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers. - [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first. - Previous: [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first. - Next: [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md): `POST /api/public/updates/{updateId}/respond`. Respond to a submitted check-in. --- # Respond to a check-in `POST https://api.coach-platform.com/api/public/updates/{updateId}/respond` Respond to a submitted check-in. Accepts any id returned by GET /updates or GET /forms/registration, resolving it to a form response or a legacy update record and applying the same review flow the dashboard uses: the record is marked Handled, coachNotes, feedback and rating are stored, and target changes (trainingDays, cardioDays, cardioTime, dailyStepsTarget, nutritionNotes) update the active coaching period. customTrainingPlan and customNutritionPlan switch the active plan or menu to the given id. Feedback is delivered to the trainee as an in-app notification by default; setting notificationChannel to whatsapp or both, or supplying whatsappMessage, sends WhatsApp and additionally requires the messaging:send scope. - Resource: Forms - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `updateId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `coachNotes` | string | No | Private note, never shown to the trainee. | | `feedback` | string | No | Feedback text delivered to the trainee. | | `rating` | integer | No | Minimum: `1`. Maximum: `5`. | | `trainingDays` | integer | No | Minimum: `0`. Maximum: `7`. | | `cardioDays` | integer | No | Minimum: `0`. Maximum: `7`. | | `cardioTime` | integer | No | Cardio minutes per session. Minimum: `0`. | | `dailyStepsTarget` | integer | No | Minimum: `0`. | | `nutritionNotes` | string | No | | | `customTrainingPlan` | string | No | Training plan id to switch the coaching period to. | | `customNutritionPlan` | string | No | Nutrition menu id to switch the coaching period to. | | `saveFeedbackToTrainee` | boolean | No | | | `notificationChannel` | string | No | How to deliver the feedback. Defaults to notification (in-app). whatsapp and both require the messaging:send scope. Allowed values: `notification`, `whatsapp`, `both`. | | `whatsappMessage` | string | No | WhatsApp text to send instead of the feedback text. Requires the messaging:send scope. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.target` | string | Which kind of record the id resolved to. Allowed values: `formResponse`, `update`. | | `data.whatsappSent` | boolean | | Example: ```json { "data": { "id": "", "target": "formResponse", "whatsappSent": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/updates//respond' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "coachNotes": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/updates//respond', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "coachNotes": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach. - [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first. - [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first. - [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set. - [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers. - [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first. - Previous: [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first. - Next: [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set. --- # Get a form with its questions `GET https://api.coach-platform.com/api/public/forms/{formId}` Get one form including its full question set. Questions are grouped into steps: each entry of steps[] has a title and a fields[] array, and each field carries its label, fieldType, whether it is required, and its options where relevant. This is the endpoint that tells you what a trainee was actually asked; GET /forms only lists metadata. - Resource: Forms - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-forms-form-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `formId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | A single form including its questions. Questions live under steps[].fields[], not at the top level. | | `data.id` | string | | | `data.coach` | string | | | `data.title` | string | | | `data.description` | string | | | `data.type` | string | registration = the join-time intake questionnaire. update = a recurring check-in form. Allowed values: `registration`, `update`. | | `data.isActive` | boolean | | | `data.registrationOrder` | integer | Order this form is presented in during registration, when several registration forms exist. | | `data.openAt` | object | When and how often the form opens for trainees. | | `data.openAt.date` | string | | | `data.openAt.recurrence` | string | How often the form reopens. Allowed values: `weekly`, `bi-weekly`, `tri-weekly`, `monthly`. | | `data.openAt.openDays` | integer | How many days the form stays open once it opens. | | `data.target` | string | Who the form is shown to. byLabels targets trainees carrying at least one of targetLabels. Allowed values: `allTrainees`, `males`, `females`, `byLabels`. | | `data.targetLabels` | object[] | Labels this form targets. Only present when target is byLabels. | | `data.targetLabels[].id` | string | | | `data.targetLabels[].text` | string | | | `data.targetLabels[].color` | string | | | `data.createdAt` | string | | | `data.steps` | object[] | The form’s pages, in order. Each holds the questions asked on that page. | | `data.steps[].fields` | object[] | | | `data.steps[].fields[].id` | string | | | `data.steps[].fields[].label` | string | The question text shown to the trainee. | | `data.steps[].fields[].fieldType` | string | How the question is answered, e.g. text, textarea, number, date, dropdown, checkbox, rating, slider, file, signature, weight, height, measurements, bodyFat, gender, dateOfBirth, activityLevel. contentBlock is not a question but static copy shown to the trainee. | | `data.steps[].fields[].isRequired` | boolean | | | `data.steps[].fields[].placeholder` | string | | | `data.steps[].fields[].options` | string[] | Selectable values, for dropdown and similar field types. | | `data.steps[].fields[].multiple` | boolean | | Example: ```json { "data": { "id": "", "coach": "", "title": "", "description": "", "type": "registration", "isActive": true, "registrationOrder": 123, "openAt": { "date": "", "recurrence": "weekly", "openDays": 123 }, "target": "allTrainees", "targetLabels": [ { "id": "", "text": "", "color": "" } ], "createdAt": "", "steps": [ { "fields": [ { "id": "", "label": "", "fieldType": "", "isRequired": true, "placeholder": "", "options": [ "" ], "multiple": true } ] } ] } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/forms/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/forms/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach. - [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first. - [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first. - [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md): `POST /api/public/updates/{updateId}/respond`. Respond to a submitted check-in. - [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers. - [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first. - Previous: [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md): `POST /api/public/updates/{updateId}/respond`. Respond to a submitted check-in. - Next: [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers. --- # Get a form response `GET https://api.coach-platform.com/api/public/forms/{formId}/response/{responseId}` Get a single submitted form response with its answers. Each answer carries the question label and field type alongside the value, so this alone shows what was asked and what was replied; questions the trainee skipped are absent, so compare with GET /forms/{formId} to see what went unanswered. Trainee personal details and phone number are included only when the key also has trainees:read. - Resource: Forms - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `formId` | string | Yes | | | `responseId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | A submitted form response. Trainee personal details and phone number are included only when the key also has trainees:read; coach private notes are never returned. | | `data.id` | string | | | `data.form` | object | The form this response belongs to. | | `data.form.id` | string | | | `data.form.title` | string | | | `data.form.type` | string | | | `data.trainee` | object | The trainee who submitted the response. | | `data.trainee.id` | string | | | `data.trainee.fullName` | string | | | `data.responses` | object[] | The submitted answers, one entry per form field. | | `data.responses[].field` | string | Field id from the form definition. | | `data.responses[].label` | string | Field label shown to the trainee. | | `data.responses[].fieldType` | string | Field type, e.g. text, number, file. | | `data.status` | string | Whether the coach has handled this response. Allowed values: `Pending`, `Handled`. | | `data.type` | string | Whether this is a periodic update or a registration submission. Allowed values: `update`, `registration`. | | `data.createdAt` | string | | | `data.updatedAt` | string | | Example: ```json { "data": { "id": "", "form": { "id": "", "title": "", "type": "" }, "trainee": { "id": "", "fullName": "" }, "responses": [ { "field": "", "label": "", "fieldType": "" } ], "status": "Pending", "type": "update", "createdAt": "", "updatedAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/forms//response/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/forms//response/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach. - [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first. - [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first. - [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md): `POST /api/public/updates/{updateId}/respond`. Respond to a submitted check-in. - [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set. - [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first. - Previous: [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set. - Next: [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first. --- # List responses to a form `GET https://api.coach-platform.com/api/public/forms/{formId}/responses` List submitted responses for a form, newest first. Trainee personal details and phone number are included only when the key also has trainees:read; coach private notes are never returned. - Resource: Forms - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `formId` | string | Yes | | ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | No | Only responses submitted by this trainee. Use it to read one trainee's answers directly instead of searching by name. | | `status` | string | No | Filter by handling status. Allowed values: `Pending`, `Handled`. | | `search` | string | No | Search the trainee name. | | `dateFrom` | string | No | Only responses submitted on or after this date (YYYY-MM-DD). | | `dateTo` | string | No | Only responses submitted on or before this date (YYYY-MM-DD). | | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].form` | object | The form this response belongs to. | | `data[].form.id` | string | | | `data[].form.title` | string | | | `data[].form.type` | string | | | `data[].trainee` | object | The trainee who submitted the response. | | `data[].trainee.id` | string | | | `data[].trainee.fullName` | string | | | `data[].responses` | object[] | The submitted answers, one entry per form field. | | `data[].responses[].field` | string | Field id from the form definition. | | `data[].responses[].label` | string | Field label shown to the trainee. | | `data[].responses[].fieldType` | string | Field type, e.g. text, number, file. | | `data[].status` | string | Whether the coach has handled this response. Allowed values: `Pending`, `Handled`. | | `data[].type` | string | Whether this is a periodic update or a registration submission. Allowed values: `update`, `registration`. | | `data[].createdAt` | string | | | `data[].updatedAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "form": { "id": "", "title": "", "type": "" }, "trainee": { "id": "", "fullName": "" }, "responses": [ { "field": "", "label": "", "fieldType": "" } ], "status": "Pending", "type": "update", "createdAt": "", "updatedAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/forms//responses' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/forms//responses', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach. - [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first. - [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first. - [Respond to a check-in](https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond/index.md): `POST /api/public/updates/{updateId}/respond`. Respond to a submitted check-in. - [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set. - [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers. - Previous: [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers. - Next: [Send a notification](https://www.coach-platform.com/docs/api/reference/post-notifications/index.md): `POST /api/public/notifications`. Send an in-app notification to one trainee, immediately or on a schedule. --- # Send a notification `POST https://api.coach-platform.com/api/public/notifications` Send an in-app notification to one trainee, immediately or on a schedule. Requires the notifications:send scope, which is separate from messaging:send (WhatsApp). Each trainee accepts at most 10 API-sent notifications per day; over that the endpoint returns 429. High-risk — anyone with the key can deliver push notifications to your trainees. - Resource: Notifications - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-notifications - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | | `title` | string | Yes | Short notification title | | `message` | string | Yes | Body text | | `type` | string | No | Delivery style. "push" (default) is a standard push notification, "popup" shows an in-app popup card, "both" sends a push and shows the popup. Never sends WhatsApp. Allowed values: `push`, `popup`, `both`. | | `popupData` | object | No | Content of the in-app popup card. Only used when type is "popup" or "both". | | `popupData.title` | string | No | | | `popupData.description` | string | No | | | `popupData.videoLink` | string | No | | | `popupData.actionLink` | string | No | URL opened when the call-to-action button is pressed | | `popupData.buttonText` | string | No | Call-to-action button label | | `popupData.imageUrl` | string | No | | | `popupData.dismissible` | boolean | No | Whether the trainee can dismiss the popup. Defaults to true. | | `scheduledAt` | string | No | Shorthand for a single future delivery: an ISO date-time. Use schedule instead for recurring sends. Cannot be combined with schedule. | | `schedule` | object | No | Deliver later, optionally repeating. Omit both schedule and scheduledAt to send immediately. Cannot be combined with scheduledAt. | | `schedule.startDate` | string | Yes | First send date, ISO-8601. Either a date ("2026-06-15") or a full date-time. | | `schedule.timeOfDay` | string | Yes | Local time of day in 24h "HH:mm" format, e.g. "09:30" Pattern: `^([01]?[0-9]\|2[0-3]):[0-5][0-9]$`. | | `schedule.frequency` | string | No | Defaults to "once" (a single future send). Any other value repeats until endDate. Allowed values: `once`, `daily`, `weekly`, `biweekly`, `triweekly`, `monthly`. | | `schedule.weeklyDays` | number[] | No | 0=Sunday..6=Saturday. Required for weekly, biweekly and triweekly. | | `schedule.monthlyMode` | string | No | For monthly: byDate uses monthlyDays, byWeekday uses monthlyWeekday plus monthlyWeekOfMonth. Defaults to byDate. Allowed values: `byDate`, `byWeekday`. | | `schedule.monthlyDays` | number[] | No | Days of the month for monthly byDate | | `schedule.monthlyWeekday` | number | No | 0=Sunday..6=Saturday for monthly byWeekday Minimum: `0`. Maximum: `6`. | | `schedule.monthlyWeekOfMonth` | number | No | 1-4, or -1 for the last week of the month Allowed values: `1`, `2`, `3`, `4`, `-1`. | | `schedule.endDate` | string | No | Optional ISO date that stops a recurring schedule | | `schedule.timezone` | string | No | IANA timezone. Defaults to Asia/Jerusalem. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string \| null | | | `data.type` | string | Allowed values: `push`, `popup`, `both`. | | `data.status` | string | Allowed values: `sent`, `scheduled`. | | `data.recipients` | number | How many trainees the notification was delivered to | | `data.scheduledFor` | string \| null | ISO date-time of the first delivery when scheduled | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "type": "push", "status": "sent", "recipients": 123, "scheduledFor": "" }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/notifications' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeId": "", "title": "", "message": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/notifications', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeId": "", "title": "", "message": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Send a bulk notification](https://www.coach-platform.com/docs/api/reference/post-notifications-bulk/index.md): `POST /api/public/notifications/bulk`. Send the same in-app notification to up to 100 trainees, immediately or on a schedule. - Previous: [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first. - Next: [Send a bulk notification](https://www.coach-platform.com/docs/api/reference/post-notifications-bulk/index.md): `POST /api/public/notifications/bulk`. Send the same in-app notification to up to 100 trainees, immediately or on a schedule. --- # Send a bulk notification `POST https://api.coach-platform.com/api/public/notifications/bulk` Send the same in-app notification to up to 100 trainees, immediately or on a schedule. Requires the notifications:send scope, which is separate from messaging:send (WhatsApp). Trainees this key may not reach are returned in skipped, and trainees over the 10-per-day cap in rateLimited; both are excluded from the send, and a 429 is returned only when no recipient remains. Trainees who opted out of broadcast notifications are returned in optedOut and excluded too; a 400 is returned when every reachable trainee opted out. High-risk — send an Idempotency-Key so a retry cannot double-notify. - Resource: Notifications - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-notifications-bulk - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeIds` | string[] | Yes | Between 1 and 100 trainee ids Minimum items: `1`. Maximum items: `100`. | | `title` | string | Yes | Short notification title | | `message` | string | Yes | Body text | | `type` | string | No | Delivery style. "push" (default) is a standard push notification, "popup" shows an in-app popup card, "both" sends a push and shows the popup. Never sends WhatsApp. Allowed values: `push`, `popup`, `both`. | | `popupData` | object | No | Content of the in-app popup card. Only used when type is "popup" or "both". | | `popupData.title` | string | No | | | `popupData.description` | string | No | | | `popupData.videoLink` | string | No | | | `popupData.actionLink` | string | No | URL opened when the call-to-action button is pressed | | `popupData.buttonText` | string | No | Call-to-action button label | | `popupData.imageUrl` | string | No | | | `popupData.dismissible` | boolean | No | Whether the trainee can dismiss the popup. Defaults to true. | | `scheduledAt` | string | No | Shorthand for a single future delivery: an ISO date-time. Use schedule instead for recurring sends. Cannot be combined with schedule. | | `schedule` | object | No | Deliver later, optionally repeating. Omit both schedule and scheduledAt to send immediately. Cannot be combined with scheduledAt. | | `schedule.startDate` | string | Yes | First send date, ISO-8601. Either a date ("2026-06-15") or a full date-time. | | `schedule.timeOfDay` | string | Yes | Local time of day in 24h "HH:mm" format, e.g. "09:30" Pattern: `^([01]?[0-9]\|2[0-3]):[0-5][0-9]$`. | | `schedule.frequency` | string | No | Defaults to "once" (a single future send). Any other value repeats until endDate. Allowed values: `once`, `daily`, `weekly`, `biweekly`, `triweekly`, `monthly`. | | `schedule.weeklyDays` | number[] | No | 0=Sunday..6=Saturday. Required for weekly, biweekly and triweekly. | | `schedule.monthlyMode` | string | No | For monthly: byDate uses monthlyDays, byWeekday uses monthlyWeekday plus monthlyWeekOfMonth. Defaults to byDate. Allowed values: `byDate`, `byWeekday`. | | `schedule.monthlyDays` | number[] | No | Days of the month for monthly byDate | | `schedule.monthlyWeekday` | number | No | 0=Sunday..6=Saturday for monthly byWeekday Minimum: `0`. Maximum: `6`. | | `schedule.monthlyWeekOfMonth` | number | No | 1-4, or -1 for the last week of the month Allowed values: `1`, `2`, `3`, `4`, `-1`. | | `schedule.endDate` | string | No | Optional ISO date that stops a recurring schedule | | `schedule.timezone` | string | No | IANA timezone. Defaults to Asia/Jerusalem. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string \| null | | | `data.type` | string | Allowed values: `push`, `popup`, `both`. | | `data.status` | string | Allowed values: `sent`, `scheduled`. | | `data.recipients` | number | How many trainees the notification was delivered to | | `data.scheduledFor` | string \| null | ISO date-time of the first delivery when scheduled | | `data.skipped` | string[] | Trainee ids the key may not reach. They were left out of the send. | | `data.skippedCount` | number | | | `data.optedOut` | string[] | Trainee ids that opted out of broadcast notifications. They were left out of the send. | | `data.optedOutCount` | number | | | `data.rateLimited` | string[] | Trainee ids that already hit their daily notification cap. They were left out of the send. | | `data.rateLimitedCount` | number | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "type": "push", "status": "sent", "recipients": 123, "scheduledFor": "", "skipped": [ "" ], "skippedCount": 123, "optedOut": [ "" ], "optedOutCount": 123, "rateLimited": [ "" ], "rateLimitedCount": 123 }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/notifications/bulk' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeIds": [ "" ], "title": "", "message": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/notifications/bulk', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeIds": [ "" ], "title": "", "message": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Send a notification](https://www.coach-platform.com/docs/api/reference/post-notifications/index.md): `POST /api/public/notifications`. Send an in-app notification to one trainee, immediately or on a schedule. - Previous: [Send a notification](https://www.coach-platform.com/docs/api/reference/post-notifications/index.md): `POST /api/public/notifications`. Send an in-app notification to one trainee, immediately or on a schedule. - Next: [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. --- # Get the monitoring overview `GET https://api.coach-platform.com/api/public/monitoring/overview` Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-overview - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `trainingDays` | string | No | Days without training before a trainee counts as inactive (default 3) | | `nutritionDays` | string | No | Days without nutrition logging before inactive (default 3) | | `waterDays` | string | No | Days without water logging before inactive (default 3) | | `weightDays` | string | No | Days without a weight entry before inactive (default 7) | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/overview' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/overview', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Send a bulk notification](https://www.coach-platform.com/docs/api/reference/post-notifications-bulk/index.md): `POST /api/public/notifications/bulk`. Send the same in-app notification to up to 100 trainees, immediately or on a schedule. - Next: [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. --- # List trainees with no recent training `GET https://api.coach-platform.com/api/public/monitoring/training` Trainees who have not logged training within the inactivity window. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-training - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `trainingDays` | string | No | Days without training before a trainee counts as inactive (default 3) | | `nutritionDays` | string | No | Days without nutrition logging before inactive (default 3) | | `waterDays` | string | No | Days without water logging before inactive (default 3) | | `weightDays` | string | No | Days without a weight entry before inactive (default 7) | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/training' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/training', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - Next: [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). --- # List trainees below their step target `GET https://api.coach-platform.com/api/public/monitoring/steps` Trainees who logged fewer steps than their daily step target on the target day (default today). Paginated. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-steps - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `date` | string | No | Target day in YYYY-MM-DD (Israel time). Defaults to today when omitted. | | `page` | string | No | Page number, 1-based (default 1) | | `limit` | string | No | Results per page, max 100 (default 20) | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/steps' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/steps', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - Next: [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. --- # List trainees with no recent nutrition logging `GET https://api.coach-platform.com/api/public/monitoring/nutrition` Trainees who have not logged nutrition within the inactivity window. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `trainingDays` | string | No | Days without training before a trainee counts as inactive (default 3) | | `nutritionDays` | string | No | Days without nutrition logging before inactive (default 3) | | `waterDays` | string | No | Days without water logging before inactive (default 3) | | `weightDays` | string | No | Days without a weight entry before inactive (default 7) | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/nutrition' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/nutrition', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - Next: [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. --- # List trainees who logged nutrition `GET https://api.coach-platform.com/api/public/monitoring/nutrition/logged-today` Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. Rows include hasMealPhoto (boolean; the row carries no photo URL) and the response includes per-bucket counts. Paginated. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `date` | string | No | Target day in YYYY-MM-DD (Israel time). Defaults to today when omitted. | | `page` | string | No | Page number, 1-based (default 1) | | `limit` | string | No | Results per page, max 100 (default 20) | | `bucket` | string | No | Filter to a target-attainment bucket (protein/calorie hit, under, or over). Omit for all. Allowed values: `proteinHit`, `proteinUnder`, `calorieHit`, `calorieUnder`, `calorieOver`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/nutrition/logged-today' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/nutrition/logged-today', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - Next: [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). --- # List trainees who did not log nutrition `GET https://api.coach-platform.com/api/public/monitoring/nutrition/not-logged` Trainees who did NOT log nutrition on the target day (default today). Use daysThreshold to require a longer gap (e.g. 3 = no logging for 3+ days). Paginated. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `date` | string | No | Target day in YYYY-MM-DD (Israel time). Defaults to today when omitted. | | `page` | string | No | Page number, 1-based (default 1) | | `limit` | string | No | Results per page, max 100 (default 20) | | `daysThreshold` | string | No | Minimum days without a nutrition log to include a trainee (default 1 = did not log on the target day) | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/nutrition/not-logged' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/nutrition/not-logged', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - Next: [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). --- # Get weight monitoring `GET https://api.coach-platform.com/api/public/monitoring/weight` Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-weight - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `trainingDays` | string | No | Days without training before a trainee counts as inactive (default 3) | | `nutritionDays` | string | No | Days without nutrition logging before inactive (default 3) | | `waterDays` | string | No | Days without water logging before inactive (default 3) | | `weightDays` | string | No | Days without a weight entry before inactive (default 7) | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/weight' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/weight', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - Next: [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. --- # List trainees with no recent water logging `GET https://api.coach-platform.com/api/public/monitoring/water` Trainees who have not logged water within the inactivity window. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-water - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `trainingDays` | string | No | Days without training before a trainee counts as inactive (default 3) | | `nutritionDays` | string | No | Days without nutrition logging before inactive (default 3) | | `waterDays` | string | No | Days without water logging before inactive (default 3) | | `weightDays` | string | No | Days without a weight entry before inactive (default 7) | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/water' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/water', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - Next: [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. --- # List weekly check-ins for monitoring `GET https://api.coach-platform.com/api/public/monitoring/updates` Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-updates - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `form` | string | No | Filter by form id | | `page` | string | No | Page number (1-based) Pattern: `^[1-9][0-9]{0,5}$`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/updates' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/updates', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - Next: [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. --- # List incomplete check-ins `GET https://api.coach-platform.com/api/public/monitoring/incomplete-updates` Updates submitted with missing measurements or photos. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/incomplete-updates' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/incomplete-updates', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - Next: [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). --- # List stalled exercises `GET https://api.coach-platform.com/api/public/monitoring/stalled-exercises` Exercises where trainees stopped progressing (no improvement over the configured window). - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `gender` | string | No | Filter trainees by gender Allowed values: `males`, `females`. | | `labels` | string[] | No | Filter to trainees that have all of these label ids Maximum items: `100`. | | `progressionMetric` | string | No | Metric used to judge progression (default volume) Allowed values: `maxWeight`, `avgWeight`, `volume`. | | `minWorkouts` | string | No | Minimum workouts to consider (default 4) | | `stalledDays` | string | No | Days of no progress to count as stalled (default 30) | | `showDismissed` | string | No | Include dismissed exercises Allowed values: `true`, `false`. | | `minStalledDays` | string | No | Only exercises stalled at least this many days | | `minStalledExercises` | string | No | Only trainees with at least this many stalled exercises | | `minRecentWorkouts` | string | No | Only exercises with at least this many recent workouts | | `minTraineesPerExercise` | string | No | Only exercises stalled for at least this many trainees | | `minDropPercent` | string | No | Only exercises whose metric dropped at least this percent | | `page` | string | No | Page number (1-based, default 1) Pattern: `^[1-9][0-9]{0,5}$`. | | `limit` | string | No | Items per page (1-999, default 50) Pattern: `^[1-9][0-9]{0,2}$`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/monitoring/stalled-exercises' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/stalled-exercises', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - Next: [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. --- # Mark incomplete check-ins as read `PATCH https://api.coach-platform.com/api/public/monitoring/incomplete-updates/read` Mark a set of incomplete updates as read. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `updates` | object[] | Yes | Maximum items: `500`. | | `updates[]._id` | string | Yes | | | `updates[].type` | string | Yes | Allowed values: `update`, `formResponse`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.success` | boolean | | Example: ```json { "data": { "success": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request PATCH \ --url 'https://api.coach-platform.com/api/public/monitoring/incomplete-updates/read' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "updates": [ { "_id": "", "type": "update" } ] }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/incomplete-updates/read', { method: 'PATCH', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "updates": [ { "_id": "", "type": "update" } ] }), }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - Next: [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. --- # Dismiss a stalled exercise `POST https://api.coach-platform.com/api/public/monitoring/stalled-exercises/dismiss` Dismiss a single stalled exercise for a trainee. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | Trainee id | | `exerciseId` | string | Yes | Exercise (catalog) id | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.success` | boolean | | Example: ```json { "data": { "success": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/monitoring/stalled-exercises/dismiss' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeId": "", "exerciseId": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/stalled-exercises/dismiss', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeId": "", "exerciseId": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - Next: [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. --- # Dismiss stalled exercises in bulk `POST https://api.coach-platform.com/api/public/monitoring/stalled-exercises/dismiss-all` Dismiss many stalled exercises at once. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `pairs` | object[] | Yes | Up to 500 { traineeId, exerciseId } pairs Maximum items: `500`. | | `pairs[].traineeId` | string | Yes | Trainee id | | `pairs[].exerciseId` | string | Yes | Exercise (catalog) id | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.success` | boolean | | Example: ```json { "data": { "success": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/monitoring/stalled-exercises/dismiss-all' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "pairs": [ { "traineeId": "", "exerciseId": "" } ] }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/stalled-exercises/dismiss-all', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "pairs": [ { "traineeId": "", "exerciseId": "" } ] }), }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - Next: [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. --- # Undismiss a stalled exercise `POST https://api.coach-platform.com/api/public/monitoring/stalled-exercises/undismiss` Undismiss a single stalled exercise for a trainee. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | Trainee id | | `exerciseId` | string | Yes | Exercise (catalog) id | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.success` | boolean | | Example: ```json { "data": { "success": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/monitoring/stalled-exercises/undismiss' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeId": "", "exerciseId": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/stalled-exercises/undismiss', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeId": "", "exerciseId": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - Next: [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. --- # Undismiss stalled exercises in bulk `POST https://api.coach-platform.com/api/public/monitoring/stalled-exercises/undismiss-all` Undismiss many stalled exercises at once. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `pairs` | object[] | Yes | Up to 500 { traineeId, exerciseId } pairs Maximum items: `500`. | | `pairs[].traineeId` | string | Yes | Trainee id | | `pairs[].exerciseId` | string | Yes | Exercise (catalog) id | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.success` | boolean | | Example: ```json { "data": { "success": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/monitoring/stalled-exercises/undismiss-all' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "pairs": [ { "traineeId": "", "exerciseId": "" } ] }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/stalled-exercises/undismiss-all', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "pairs": [ { "traineeId": "", "exerciseId": "" } ] }), }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - Next: [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. --- # Mark a stalled exercise as handled `POST https://api.coach-platform.com/api/public/monitoring/stalled-exercises/handle` Mark a single stalled exercise as handled. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | Trainee id | | `exerciseId` | string | Yes | Exercise (catalog) id | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.success` | boolean | | Example: ```json { "data": { "success": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/monitoring/stalled-exercises/handle' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeId": "", "exerciseId": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/stalled-exercises/handle', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeId": "", "exerciseId": "" }), }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - Next: [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. --- # Mark stalled exercises as handled in bulk `POST https://api.coach-platform.com/api/public/monitoring/stalled-exercises/handle-all` Mark many stalled exercises as handled at once. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `pairs` | object[] | Yes | Up to 500 { traineeId, exerciseId } pairs Maximum items: `500`. | | `pairs[].traineeId` | string | Yes | Trainee id | | `pairs[].exerciseId` | string | Yes | Exercise (catalog) id | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.success` | boolean | | Example: ```json { "data": { "success": true } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/monitoring/stalled-exercises/handle-all' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "pairs": [ { "traineeId": "", "exerciseId": "" } ] }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/monitoring/stalled-exercises/handle-all', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "pairs": [ { "traineeId": "", "exerciseId": "" } ] }), }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Previous: [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - Next: [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. --- # List quick wins `GET https://api.coach-platform.com/api/public/quick-wins` List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. Uses cursor pagination: pass the returned nextCursor to fetch the next page. - Resource: Monitoring - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-quick-wins - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `cursor` | string | No | Cursor from the previous response (nextCursor). | | `limit` | integer | No | Items per page. Defaults to 15. Minimum: `1`. Maximum: `100`. | | `filter` | string | No | Return wins still awaiting action, or ones already handled. Defaults to active. Allowed values: `active`, `handled`. | | `search` | string | No | Search the trainee name. | ## Responses | Status | Description | |---|---| | `200` OK | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].trainee` | object | | | `data[].trainee.id` | string | | | `data[].trainee.fullName` | string | | | `data[].category` | string | Win category, e.g. personalRecord, streak, measurement. | | `data[].title` | string | Short human-readable summary of the win. | | `data[].description` | string | | | `data[].status` | string | active or handled. | | `data[].createdAt` | string | | | `nextCursor` | string \| null | Pass as cursor to fetch the next page. Null when there are no more results. | Example: ```json { "data": [ { "id": "", "trainee": { "id": "", "fullName": "" }, "category": "", "title": "", "description": "", "status": "", "createdAt": "" } ], "nextCursor": "" } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/quick-wins' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/quick-wins', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get the monitoring overview](https://www.coach-platform.com/docs/api/reference/get-monitoring-overview/index.md): `GET /api/public/monitoring/overview`. Monitoring overview: counts of trainees inactive in training, nutrition, water and weight, plus adherence graph data. - [List trainees with no recent training](https://www.coach-platform.com/docs/api/reference/get-monitoring-training/index.md): `GET /api/public/monitoring/training`. Trainees who have not logged training within the inactivity window. - [List trainees below their step target](https://www.coach-platform.com/docs/api/reference/get-monitoring-steps/index.md): `GET /api/public/monitoring/steps`. Trainees who logged fewer steps than their daily step target on the target day (default today). - [List trainees with no recent nutrition logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition/index.md): `GET /api/public/monitoring/nutrition`. Trainees who have not logged nutrition within the inactivity window. - [List trainees who logged nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-logged-today/index.md): `GET /api/public/monitoring/nutrition/logged-today`. Trainees who logged nutrition on the target day (default today), with logged calories and protein against target. - [List trainees who did not log nutrition](https://www.coach-platform.com/docs/api/reference/get-monitoring-nutrition-not-logged/index.md): `GET /api/public/monitoring/nutrition/not-logged`. Trainees who did NOT log nutrition on the target day (default today). - [Get weight monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-weight/index.md): `GET /api/public/monitoring/weight`. Weight monitoring: weight-inactive trainees, significant weight changes vs an aged baseline (with daysBetweenWeights), trend vs goal, plateaus, and broken weekly weigh-in streaks (streakBroken). - [List trainees with no recent water logging](https://www.coach-platform.com/docs/api/reference/get-monitoring-water/index.md): `GET /api/public/monitoring/water`. Trainees who have not logged water within the inactivity window. - [List weekly check-ins for monitoring](https://www.coach-platform.com/docs/api/reference/get-monitoring-updates/index.md): `GET /api/public/monitoring/updates`. Weekly trainee updates (check-ins) for monitoring, filterable by form/label/gender. - [List incomplete check-ins](https://www.coach-platform.com/docs/api/reference/get-monitoring-incomplete-updates/index.md): `GET /api/public/monitoring/incomplete-updates`. Updates submitted with missing measurements or photos. - [List stalled exercises](https://www.coach-platform.com/docs/api/reference/get-monitoring-stalled-exercises/index.md): `GET /api/public/monitoring/stalled-exercises`. Exercises where trainees stopped progressing (no improvement over the configured window). - [Mark incomplete check-ins as read](https://www.coach-platform.com/docs/api/reference/patch-monitoring-incomplete-updates-read/index.md): `PATCH /api/public/monitoring/incomplete-updates/read`. Mark a set of incomplete updates as read. - [Dismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss`. Dismiss a single stalled exercise for a trainee. - [Dismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-dismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/dismiss-all`. Dismiss many stalled exercises at once. - [Undismiss a stalled exercise](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss`. Undismiss a single stalled exercise for a trainee. - [Undismiss stalled exercises in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-undismiss-all/index.md): `POST /api/public/monitoring/stalled-exercises/undismiss-all`. Undismiss many stalled exercises at once. - [Mark a stalled exercise as handled](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle/index.md): `POST /api/public/monitoring/stalled-exercises/handle`. Mark a single stalled exercise as handled. - [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - Previous: [Mark stalled exercises as handled in bulk](https://www.coach-platform.com/docs/api/reference/post-monitoring-stalled-exercises-handle-all/index.md): `POST /api/public/monitoring/stalled-exercises/handle-all`. Mark many stalled exercises as handled at once. - Next: [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. --- # List journeys `GET https://api.coach-platform.com/api/public/journeys` List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - Resource: Journeys - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-journeys - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `isActive` | string | No | Filter by active status. Allowed values: `true`, `false`. | | `search` | string | No | Search journey title and description (min 2 chars). | | `page` | integer | No | Minimum: `1`. | | `limit` | integer | No | Minimum: `1`. Maximum: `100`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/journeys' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/journeys', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. - [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. - [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. - [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. - [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Previous: [List quick wins](https://www.coach-platform.com/docs/api/reference/get-quick-wins/index.md): `GET /api/public/quick-wins`. List automatically detected positive moments for your trainees (new personal record, consistency streak, measurement progress, coaching milestone), newest first. - Next: [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. --- # Create a journey `POST https://api.coach-platform.com/api/public/journeys` Create a customer journey, optionally with its ordered steps. Trainees are only enrolled once the journey is active. - Resource: Journeys - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-journeys - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `title` | string | Yes | Journey name shown to the coach. | | `description` | string | No | | | `autoAssign` | boolean | No | Automatically enroll trainees that match the filters below. | | `autoAssignPriority` | integer | No | Lower runs first when several journeys match. | | `anchorType` | string | No | Whether day counting starts from the escort start date or from the moment the trainee is enrolled. Allowed values: `escort_start`, `enrollment`. | | `filterLabels` | string[] | No | Only auto-enroll trainees with these label ids. Maximum items: `100`. | | `filterEscortTypes` | string[] | No | Maximum items: `100`. | | `filterGender` | string[] | No | Maximum items: `100`. | | `durationWeeks` | integer | No | Minimum: `1`. | | `matchByDuration` | boolean | No | | | `steps` | object[] | No | The ordered steps of the journey. Omit to create an empty journey and add its steps later. Maximum items: `50`. | | `steps[].id` | string | No | Id of an existing step, as returned by GET /journeys/:journeyId. Send it back to update that step in place; omit it to add a new one. | | `steps[].order` | integer | Yes | Position of the step within the journey, starting at 1. Minimum: `1`. | | `steps[].title` | string | Yes | Maximum length: `200`. | | `steps[].triggerType` | string | Yes | Whether the step fires on a day, on a week, or on an event. Allowed values: `day`, `week`, `event`. | | `steps[].triggerValue` | integer | Yes | Day number for triggerType "day", week number for "week". Counted from the journey anchor, starting at 1. Minimum: `1`. | | `steps[].timeOfDay` | string | No | Local send time as HH:mm, e.g. "09:00". | | `steps[].eventType` | string | No | Required when triggerType is "event". Allowed values: `weight_stall`, `trainee_inactive`, `form_submitted`, `task_completed`. | | `steps[].eventThreshold` | integer | No | Minimum: `1`. | | `steps[].condition` | object | No | Optional gate: the step only fires for trainees who match it. | | `steps[].condition.type` | string | No | Allowed values: `workouts_completed_in_last_days`, `nutrition_logs_in_last_days`, `forms_submitted_since_enrollment`, `has_label`, `no_label`. | | `steps[].condition.operator` | string | No | Allowed values: `gte`, `lte`, `eq`. | | `steps[].condition.value` | number | No | | | `steps[].condition.timeframeDays` | integer | No | Minimum: `1`. | | `steps[].condition.labelId` | string | No | | | `steps[].actions` | object[] | No | Maximum items: `50`. | | `steps[].actions[].id` | string | No | Id of an existing action on this step. Send it back to keep the action, omit it to create a new one. | | `steps[].actions[].type` | string | Yes | What this action does when the step fires. Allowed values: `notification`, `guide`, `training_plan`, `nutrition_menu`, `task`, `whatsapp`, `add_label`, `remove_label`, `send_form`. | | `steps[].actions[].notificationData` | object | No | For type "notification": { title, message, type: "push" \| "popup" \| "both", popupData? }. | | `steps[].actions[].guideId` | string | No | For type "guide": the guide to reveal. | | `steps[].actions[].trainingPlanId` | string | No | For type "training_plan": the plan to assign. | | `steps[].actions[].nutritionMenuId` | string | No | For type "nutrition_menu": the menu to assign. | | `steps[].actions[].taskData` | object | No | For type "task": { title, type, priority: "low" \| "medium" \| "high", visibleToTrainee, dueDateOffsetDays? }. | | `steps[].actions[].whatsappData` | object | No | For type "whatsapp": { message, mediaUrl?, mediaType?, caption? }. | | `steps[].actions[].labelId` | string | No | For types "add_label" and "remove_label": the label to apply or clear. | | `steps[].actions[].replacePreviousLabels` | boolean | No | | | `steps[].actions[].formData` | object | No | For type "send_form": { formId, expiresAfterDays? }. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": {}, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/journeys' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "title": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/journeys', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "title": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. - [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. - [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. - [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Previous: [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - Next: [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. --- # List journey enrollments `GET https://api.coach-platform.com/api/public/journeys/enrollments` List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - Resource: Journeys - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `journeyId` | string | No | | | `escortId` | string | No | | | `status` | string | No | Allowed values: `active`, `paused`, `completed`, `cancelled`. | | `page` | integer | No | Minimum: `1`. | | `limit` | integer | No | Minimum: `1`. Maximum: `100`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/journeys/enrollments' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/journeys/enrollments', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. - [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. - [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. - [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. - [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Previous: [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. - Next: [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. --- # Get a journey `GET https://api.coach-platform.com/api/public/journeys/{journeyId}` Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - Resource: Journeys - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `journeyId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/journeys/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/journeys/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. - [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. - [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. - [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. - [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Previous: [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - Next: [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. --- # Update a journey `PATCH https://api.coach-platform.com/api/public/journeys/{journeyId}` Update a customer journey's settings and steps. Sending "steps" replaces the whole list, so read the journey first and send every step you want to keep: steps you send back with their id are updated in place, steps you leave out are removed, and steps without an id are added. Editing steps reschedules pending sends for trainees already enrolled. - Resource: Journeys - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `journeyId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `title` | string | No | | | `description` | string | No | | | `isActive` | boolean | No | Activate or pause the journey. | | `autoAssign` | boolean | No | | | `autoAssignPriority` | integer | No | | | `anchorType` | string | No | Allowed values: `escort_start`, `enrollment`. | | `filterLabels` | string[] | No | Maximum items: `100`. | | `filterEscortTypes` | string[] | No | Maximum items: `100`. | | `filterGender` | string[] | No | Maximum items: `100`. | | `durationWeeks` | integer | No | Minimum: `1`. | | `matchByDuration` | boolean | No | | | `steps` | object[] | No | The complete ordered list of steps the journey should have after the update. Maximum items: `50`. | | `steps[].id` | string | No | Id of an existing step, as returned by GET /journeys/:journeyId. Send it back to update that step in place; omit it to add a new one. | | `steps[].order` | integer | Yes | Position of the step within the journey, starting at 1. Minimum: `1`. | | `steps[].title` | string | Yes | Maximum length: `200`. | | `steps[].triggerType` | string | Yes | Whether the step fires on a day, on a week, or on an event. Allowed values: `day`, `week`, `event`. | | `steps[].triggerValue` | integer | Yes | Day number for triggerType "day", week number for "week". Counted from the journey anchor, starting at 1. Minimum: `1`. | | `steps[].timeOfDay` | string | No | Local send time as HH:mm, e.g. "09:00". | | `steps[].eventType` | string | No | Required when triggerType is "event". Allowed values: `weight_stall`, `trainee_inactive`, `form_submitted`, `task_completed`. | | `steps[].eventThreshold` | integer | No | Minimum: `1`. | | `steps[].condition` | object | No | Optional gate: the step only fires for trainees who match it. | | `steps[].condition.type` | string | No | Allowed values: `workouts_completed_in_last_days`, `nutrition_logs_in_last_days`, `forms_submitted_since_enrollment`, `has_label`, `no_label`. | | `steps[].condition.operator` | string | No | Allowed values: `gte`, `lte`, `eq`. | | `steps[].condition.value` | number | No | | | `steps[].condition.timeframeDays` | integer | No | Minimum: `1`. | | `steps[].condition.labelId` | string | No | | | `steps[].actions` | object[] | No | Maximum items: `50`. | | `steps[].actions[].id` | string | No | Id of an existing action on this step. Send it back to keep the action, omit it to create a new one. | | `steps[].actions[].type` | string | Yes | What this action does when the step fires. Allowed values: `notification`, `guide`, `training_plan`, `nutrition_menu`, `task`, `whatsapp`, `add_label`, `remove_label`, `send_form`. | | `steps[].actions[].notificationData` | object | No | For type "notification": { title, message, type: "push" \| "popup" \| "both", popupData? }. | | `steps[].actions[].guideId` | string | No | For type "guide": the guide to reveal. | | `steps[].actions[].trainingPlanId` | string | No | For type "training_plan": the plan to assign. | | `steps[].actions[].nutritionMenuId` | string | No | For type "nutrition_menu": the menu to assign. | | `steps[].actions[].taskData` | object | No | For type "task": { title, type, priority: "low" \| "medium" \| "high", visibleToTrainee, dueDateOffsetDays? }. | | `steps[].actions[].whatsappData` | object | No | For type "whatsapp": { message, mediaUrl?, mediaType?, caption? }. | | `steps[].actions[].labelId` | string | No | For types "add_label" and "remove_label": the label to apply or clear. | | `steps[].actions[].replacePreviousLabels` | boolean | No | | | `steps[].actions[].formData` | object | No | For type "send_form": { formId, expiresAfterDays? }. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request PATCH \ --url 'https://api.coach-platform.com/api/public/journeys/' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "title": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/journeys/', { method: 'PATCH', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "title": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. - [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. - [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. - [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Previous: [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - Next: [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. --- # Get journey analytics `GET https://api.coach-platform.com/api/public/journeys/{journeyId}/analytics` Enrollment and completion statistics for a single customer journey. - Resource: Journeys - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `journeyId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/journeys//analytics' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/journeys//analytics', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. - [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. - [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. - [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Previous: [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. - Next: [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. --- # Enroll a trainee in a journey `POST https://api.coach-platform.com/api/public/journeys/{journeyId}/enroll` Enroll one trainee into an active journey. Identify them with traineeId (their active coaching period is used) or with escortId to pick a specific coaching period. A trainee already enrolled in another journey returns 409 unless replaceExisting is true. Enrollments are limited to one per second per coach, so space out loops that enroll many trainees. - Resource: Journeys - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `journeyId` | string | Yes | | ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | No | The trainee to enroll, resolved to their active coaching period. Send this or escortId. | | `escortId` | string | No | The coaching period to enroll. Send this or traineeId when you need a specific one. | | `startDateShiftDays` | integer | No | Shift the journey start by this many days. Negative values start it in the past, so earlier steps fire immediately. | | `startAtStepId` | string | No | Begin at this step instead of the first one. | | `replaceExisting` | boolean | No | Cancel the trainee's current enrollment in another journey instead of returning 409. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": {}, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/journeys//enroll' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeId": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/journeys//enroll', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeId": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. - [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. - [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. - [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Previous: [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. - Next: [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. --- # Get a trainee's journey progress `GET https://api.coach-platform.com/api/public/trainees/{traineeId}/journey-progress` Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Resource: Journeys - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | Example: ```json { "data": {} } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/trainees//journey-progress' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/trainees//journey-progress', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List journeys](https://www.coach-platform.com/docs/api/reference/get-journeys/index.md): `GET /api/public/journeys`. List customer journeys (automation templates) with search and pagination, including how many trainees are actively enrolled in each. - [Create a journey](https://www.coach-platform.com/docs/api/reference/post-journeys/index.md): `POST /api/public/journeys`. Create a customer journey, optionally with its ordered steps. - [List journey enrollments](https://www.coach-platform.com/docs/api/reference/get-journeys-enrollments/index.md): `GET /api/public/journeys/enrollments`. List trainee enrollments across journeys, filterable by journey, escort and status, with trainee, escort and journey resolved. - [Get a journey](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id/index.md): `GET /api/public/journeys/{journeyId}`. Get a single customer journey with its full step structure: triggers, timing and the actions each step runs. - [Update a journey](https://www.coach-platform.com/docs/api/reference/patch-journeys-journey-id/index.md): `PATCH /api/public/journeys/{journeyId}`. Update a customer journey's settings and steps. - [Get journey analytics](https://www.coach-platform.com/docs/api/reference/get-journeys-journey-id-analytics/index.md): `GET /api/public/journeys/{journeyId}/analytics`. Enrollment and completion statistics for a single customer journey. - [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. - Previous: [Enroll a trainee in a journey](https://www.coach-platform.com/docs/api/reference/post-journeys-journey-id-enroll/index.md): `POST /api/public/journeys/{journeyId}/enroll`. Enroll one trainee into an active journey. - Next: [List employees](https://www.coach-platform.com/docs/api/reference/get-employees/index.md): `GET /api/public/employees`. List the coach's team members (employees), including name, phone, email, and role. --- # List employees `GET https://api.coach-platform.com/api/public/employees` List the coach's team members (employees), including name, phone, email, and role. Keys restricted to specific employees only see those. - Resource: Employees - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-employees - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `status` | string | No | Filter by employee status (default: active) Allowed values: `active`, `inactive`, `all`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].name` | string | | | `data[].email` | string | | | `data[].phoneNumber` | string | | | `data[].profileImageUrl` | string | | | `data[].role` | string | Allowed values: `viewer`, `editor`, `manager`. | | `data[].status` | string | Allowed values: `active`, `inactive`. | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "name": "", "email": "", "phoneNumber": "", "profileImageUrl": "", "role": "viewer", "status": "active" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/employees' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/employees', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - Previous: [Get a trainee's journey progress](https://www.coach-platform.com/docs/api/reference/get-trainees-trainee-id-journey-progress/index.md): `GET /api/public/trainees/{traineeId}/journey-progress`. Where a trainee stands in their customer journey(s): current effective day and week, completed versus upcoming steps, and each journey's status. - Next: [List products](https://www.coach-platform.com/docs/api/reference/get-products/index.md): `GET /api/public/products`. List the current key's coach products. --- # List products `GET https://api.coach-platform.com/api/public/products` List the current key's coach products. Filter by productType, isActive or name. - Resource: Products - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-products - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `productType` | string | No | Allowed values: `SINGLE`, `PUNCH_CARD`, `MEMBERSHIP`. | | `isActive` | boolean | No | | | `name` | string | No | Case-insensitive name filter | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].coachId` | string | | | `data[].name` | string | | | `data[].description` | string | | | `data[].price` | number | | | `data[].currency` | string | Allowed values: `ILS`, `USD`, `EUR`, `GBP`. | | `data[].productType` | string | Allowed values: `SINGLE`, `PUNCH_CARD`, `MEMBERSHIP`. | | `data[].productCategory` | string | | | `data[].credits` | number \| null | | | `data[].isActive` | boolean | | | `data[].hidePriceInApp` | boolean | | | `data[].membershipDetails` | object \| null | | | `data[].membershipDetails.duration` | object | | | `data[].membershipDetails.duration.value` | number | | | `data[].membershipDetails.duration.unit` | string | Allowed values: `DAY`, `WEEK`, `MONTH`, `YEAR`. | | `data[].membershipDetails.recurrence` | string | Allowed values: `DAILY`, `WEEKLY`, `MONTHLY`, `YEARLY`, `ONE_TIME`. | | `data[].membershipDetails.limitations` | object | | | `data[].membershipDetails.limitations.isUnlimited` | boolean | | | `data[].membershipDetails.limitations.periodicalUsage` | object | | | `data[].membershipDetails.limitations.periodicalUsage.usagesPerPeriod` | number | | | `data[].membershipDetails.limitations.periodicalUsage.periodType` | string | | | `data[].membershipDetails.limitations.allowedHours` | object | | | `data[].membershipDetails.limitations.allowedHours.from` | string | | | `data[].membershipDetails.limitations.allowedHours.to` | string | | | `data[].membershipDetails.limitations.allowedDays` | string[] | | | `data[].createdAt` | string | | | `data[].updatedAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "coachId": "", "name": "", "description": "", "price": 123, "currency": "ILS", "productType": "SINGLE", "productCategory": "", "credits": 123, "isActive": true, "hidePriceInApp": true, "membershipDetails": { "duration": { "value": 123, "unit": "DAY" }, "recurrence": "DAILY", "limitations": { "isUnlimited": true, "periodicalUsage": { "usagesPerPeriod": 123, "periodType": "" }, "allowedHours": { "from": "", "to": "" }, "allowedDays": [ "" ] } }, "createdAt": "", "updatedAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/products' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/products', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Get a product](https://www.coach-platform.com/docs/api/reference/get-products-product-id/index.md): `GET /api/public/products/{productId}`. Get a product by id. - Previous: [List employees](https://www.coach-platform.com/docs/api/reference/get-employees/index.md): `GET /api/public/employees`. List the coach's team members (employees), including name, phone, email, and role. - Next: [Get a product](https://www.coach-platform.com/docs/api/reference/get-products-product-id/index.md): `GET /api/public/products/{productId}`. Get a product by id. --- # Get a product `GET https://api.coach-platform.com/api/public/products/{productId}` Get a product by id. - Resource: Products - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-products-product-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `productId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coachId` | string | | | `data.name` | string | | | `data.description` | string | | | `data.price` | number | | | `data.currency` | string | Allowed values: `ILS`, `USD`, `EUR`, `GBP`. | | `data.productType` | string | Allowed values: `SINGLE`, `PUNCH_CARD`, `MEMBERSHIP`. | | `data.productCategory` | string | | | `data.credits` | number \| null | | | `data.isActive` | boolean | | | `data.hidePriceInApp` | boolean | | | `data.membershipDetails` | object \| null | | | `data.membershipDetails.duration` | object | | | `data.membershipDetails.duration.value` | number | | | `data.membershipDetails.duration.unit` | string | Allowed values: `DAY`, `WEEK`, `MONTH`, `YEAR`. | | `data.membershipDetails.recurrence` | string | Allowed values: `DAILY`, `WEEKLY`, `MONTHLY`, `YEARLY`, `ONE_TIME`. | | `data.membershipDetails.limitations` | object | | | `data.membershipDetails.limitations.isUnlimited` | boolean | | | `data.membershipDetails.limitations.periodicalUsage` | object | | | `data.membershipDetails.limitations.periodicalUsage.usagesPerPeriod` | number | | | `data.membershipDetails.limitations.periodicalUsage.periodType` | string | | | `data.membershipDetails.limitations.allowedHours` | object | | | `data.membershipDetails.limitations.allowedHours.from` | string | | | `data.membershipDetails.limitations.allowedHours.to` | string | | | `data.membershipDetails.limitations.allowedDays` | string[] | | | `data.createdAt` | string | | | `data.updatedAt` | string | | Example: ```json { "data": { "id": "", "coachId": "", "name": "", "description": "", "price": 123, "currency": "ILS", "productType": "SINGLE", "productCategory": "", "credits": 123, "isActive": true, "hidePriceInApp": true, "membershipDetails": { "duration": { "value": 123, "unit": "DAY" }, "recurrence": "DAILY", "limitations": { "isUnlimited": true, "periodicalUsage": { "usagesPerPeriod": 123, "periodType": "" }, "allowedHours": { "from": "", "to": "" }, "allowedDays": [ "" ] } }, "createdAt": "", "updatedAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/products/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/products/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List products](https://www.coach-platform.com/docs/api/reference/get-products/index.md): `GET /api/public/products`. List the current key's coach products. - Previous: [List products](https://www.coach-platform.com/docs/api/reference/get-products/index.md): `GET /api/public/products`. List the current key's coach products. - Next: [List purchases](https://www.coach-platform.com/docs/api/reference/get-purchases/index.md): `GET /api/public/purchases`. List customer purchases. --- # List purchases `GET https://api.coach-platform.com/api/public/purchases` List customer purchases. Filter by status, traineeId or productId. - Resource: Purchases - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-purchases - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | | `status` | string | No | Allowed values: `ACTIVE`, `EXPIRED`, `CANCELLED`, `PENDING`, `WAITING_FOR_PAYMENT`. | | `traineeId` | string | No | | | `productId` | string | No | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].coachId` | string | | | `data[].traineeId` | string | | | `data[].productId` | string | | | `data[].purchaseDate` | string | | | `data[].expirationDate` | string | | | `data[].purchaseAmount` | number | | | `data[].currency` | string | Allowed values: `ILS`, `USD`, `EUR`, `GBP`. | | `data[].status` | string | Allowed values: `ACTIVE`, `EXPIRED`, `CANCELLED`, `PENDING`, `WAITING_FOR_PAYMENT`. | | `data[].initialCredits` | number | | | `data[].remainingCredits` | number | | | `data[].membershipStartDate` | string | | | `data[].membershipEndDate` | string | | | `data[].currentPeriodUsages` | number | | | `data[].periodResetDate` | string | | | `data[].createdAt` | string | | | `data[].updatedAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "coachId": "", "traineeId": "", "productId": "", "purchaseDate": "", "expirationDate": "", "purchaseAmount": 123, "currency": "ILS", "status": "ACTIVE", "initialCredits": 123, "remainingCredits": 123, "membershipStartDate": "", "membershipEndDate": "", "currentPeriodUsages": 123, "periodResetDate": "", "createdAt": "", "updatedAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/purchases' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/purchases', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [Record a purchase](https://www.coach-platform.com/docs/api/reference/post-purchases/index.md): `POST /api/public/purchases`. Record a product purchase for a trainee. - [Get a purchase](https://www.coach-platform.com/docs/api/reference/get-purchases-purchase-id/index.md): `GET /api/public/purchases/{purchaseId}`. Get a customer purchase by id. - Previous: [Get a product](https://www.coach-platform.com/docs/api/reference/get-products-product-id/index.md): `GET /api/public/products/{productId}`. Get a product by id. - Next: [Record a purchase](https://www.coach-platform.com/docs/api/reference/post-purchases/index.md): `POST /api/public/purchases`. Record a product purchase for a trainee. --- # Record a purchase `POST https://api.coach-platform.com/api/public/purchases` Record a product purchase for a trainee. Credits, expiration and membership dates are derived from the product when omitted: a punch card opens with the product credits and a one-year expiration, a membership starts immediately for the product duration. - Resource: Purchases - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/post-purchases - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Header parameters | Name | Type | Required | Description | |---|---|---|---| | `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. | ## Request body Content type: `application/json`. Required. | Field | Type | Required | Description | |---|---|---|---| | `traineeId` | string | Yes | Trainee buying the product | | `productId` | string | Yes | Product to purchase. Must be active. | | `purchaseAmount` | number | No | Amount actually charged. Defaults to the product price. Minimum: `0`. | | `currency` | string | No | Defaults to ILS Allowed values: `ILS`, `USD`, `EUR`, `GBP`. | | `status` | string | No | Defaults to ACTIVE. Use WAITING_FOR_PAYMENT to record a purchase before payment clears. Allowed values: `ACTIVE`, `EXPIRED`, `CANCELLED`, `PENDING`, `WAITING_FOR_PAYMENT`. | | `purchaseDate` | string | No | Purchase date as YYYY-MM-DD or a full ISO-8601 date-time. Defaults to now. Use it to backdate an imported purchase. | | `expirationDate` | string | No | Expiration as YYYY-MM-DD or a full ISO-8601 date-time, and never before purchaseDate. Defaults to one year from now for punch cards. A date in the past is accepted for history imports; the purchase flips to EXPIRED the first time its credits are used. | | `initialCredits` | number | No | Punch card credits granted. PUNCH_CARD products only. Defaults to the product credits. Minimum: `0`. | | `remainingCredits` | number | No | Credits still available, and never more than initialCredits. PUNCH_CARD products only. Defaults to initialCredits; set it lower to import a partly used card. Minimum: `0`. | ## Responses | Status | Description | |---|---| | `201` Created | | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 201 Created Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coachId` | string | | | `data.traineeId` | string | | | `data.productId` | string | | | `data.purchaseDate` | string | | | `data.expirationDate` | string | | | `data.purchaseAmount` | number | | | `data.currency` | string | Allowed values: `ILS`, `USD`, `EUR`, `GBP`. | | `data.status` | string | Allowed values: `ACTIVE`, `EXPIRED`, `CANCELLED`, `PENDING`, `WAITING_FOR_PAYMENT`. | | `data.initialCredits` | number | | | `data.remainingCredits` | number | | | `data.membershipStartDate` | string | | | `data.membershipEndDate` | string | | | `data.currentPeriodUsages` | number | | | `data.periodResetDate` | string | | | `data.createdAt` | string | | | `data.updatedAt` | string | | | `warnings` | object[] | Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied. | | `warnings[].field` | string | | | `warnings[].message` | string | | Example: ```json { "data": { "id": "", "coachId": "", "traineeId": "", "productId": "", "purchaseDate": "", "expirationDate": "", "purchaseAmount": 123, "currency": "ILS", "status": "ACTIVE", "initialCredits": 123, "remainingCredits": 123, "membershipStartDate": "", "membershipEndDate": "", "currentPeriodUsages": 123, "periodResetDate": "", "createdAt": "", "updatedAt": "" }, "warnings": [ { "field": "", "message": "" } ] } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request POST \ --url 'https://api.coach-platform.com/api/public/purchases' \ --header 'Authorization: Bearer cp_live_...' \ --header 'Content-Type: application/json' \ --data '{ "traineeId": "", "productId": "" }' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/purchases', { method: 'POST', headers: { Authorization: 'Bearer cp_live_...', 'Content-Type': 'application/json', }, body: JSON.stringify({ "traineeId": "", "productId": "" }), }); const data = await response.json(); ``` ## Related endpoints - [List purchases](https://www.coach-platform.com/docs/api/reference/get-purchases/index.md): `GET /api/public/purchases`. List customer purchases. - [Get a purchase](https://www.coach-platform.com/docs/api/reference/get-purchases-purchase-id/index.md): `GET /api/public/purchases/{purchaseId}`. Get a customer purchase by id. - Previous: [List purchases](https://www.coach-platform.com/docs/api/reference/get-purchases/index.md): `GET /api/public/purchases`. List customer purchases. - Next: [Get a purchase](https://www.coach-platform.com/docs/api/reference/get-purchases-purchase-id/index.md): `GET /api/public/purchases/{purchaseId}`. Get a customer purchase by id. --- # Get a purchase `GET https://api.coach-platform.com/api/public/purchases/{purchaseId}` Get a customer purchase by id. - Resource: Purchases - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-purchases-purchase-id - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Path parameters | Name | Type | Required | Description | |---|---|---|---| | `purchaseId` | string | Yes | | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `404` Not Found | | | `409` Conflict | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object | | | `data.id` | string | | | `data.coachId` | string | | | `data.traineeId` | string | | | `data.productId` | string | | | `data.purchaseDate` | string | | | `data.expirationDate` | string | | | `data.purchaseAmount` | number | | | `data.currency` | string | Allowed values: `ILS`, `USD`, `EUR`, `GBP`. | | `data.status` | string | Allowed values: `ACTIVE`, `EXPIRED`, `CANCELLED`, `PENDING`, `WAITING_FOR_PAYMENT`. | | `data.initialCredits` | number | | | `data.remainingCredits` | number | | | `data.membershipStartDate` | string | | | `data.membershipEndDate` | string | | | `data.currentPeriodUsages` | number | | | `data.periodResetDate` | string | | | `data.createdAt` | string | | | `data.updatedAt` | string | | Example: ```json { "data": { "id": "", "coachId": "", "traineeId": "", "productId": "", "purchaseDate": "", "expirationDate": "", "purchaseAmount": 123, "currency": "ILS", "status": "ACTIVE", "initialCredits": 123, "remainingCredits": 123, "membershipStartDate": "", "membershipEndDate": "", "currentPeriodUsages": 123, "periodResetDate": "", "createdAt": "", "updatedAt": "" } } ``` ### Error responses 400, 401, 403, 404, 409, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/purchases/' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/purchases/', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - [List purchases](https://www.coach-platform.com/docs/api/reference/get-purchases/index.md): `GET /api/public/purchases`. List customer purchases. - [Record a purchase](https://www.coach-platform.com/docs/api/reference/post-purchases/index.md): `POST /api/public/purchases`. Record a product purchase for a trainee. - Previous: [Record a purchase](https://www.coach-platform.com/docs/api/reference/post-purchases/index.md): `POST /api/public/purchases`. Record a product purchase for a trainee. - Next: [List webhook subscriptions](https://www.coach-platform.com/docs/api/reference/get-webhooks/index.md): `GET /api/public/webhooks`. List webhook subscriptions for the current key's coach --- # List webhook subscriptions `GET https://api.coach-platform.com/api/public/webhooks` List webhook subscriptions for the current key's coach - Resource: Webhooks - Authentication: API key in the `Authorization: Bearer cp_live_...` header - HTML version: https://www.coach-platform.com/docs/api/reference/get-webhooks - OpenAPI spec: https://www.coach-platform.com/openapi.json ## Query parameters | Name | Type | Required | Description | |---|---|---|---| | `page` | integer | No | Page number (1-based, default 1) Minimum: `1`. | | `limit` | integer | No | Number of items to return (default 25, max 500) Minimum: `1`. Maximum: `500`. | ## Responses | Status | Description | |---|---| | `200` OK | Successful response | | `400` Bad Request | | | `401` Unauthorized | | | `403` Forbidden | | | `429` Too Many Requests | | | `500` Internal Server Error | | ### 200 OK Content type: `application/json` | Field | Type | Description | |---|---|---| | `data` | object[] | | | `data[].id` | string | | | `data[].name` | string | | | `data[].url` | string | | | `data[].events` | string[] | | | `data[].active` | boolean | | | `data[].includeCoachLoggedWorkouts` | boolean | | | `data[].description` | string | | | `data[].failureCount` | number | | | `data[].createdAt` | string | | | `pagination` | object | | | `pagination.page` | number | | | `pagination.limit` | number | | | `pagination.total` | number \| null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. | | `pagination.hasMore` | boolean | | | `pagination.truncated` | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. | Example: ```json { "data": [ { "id": "", "name": "", "url": "", "events": [ "" ], "active": true, "includeCoachLoggedWorkouts": true, "description": "", "failureCount": 123, "createdAt": "" } ], "pagination": { "page": 123, "limit": 123, "total": 123, "hasMore": true, "truncated": true } } ``` ### Error responses 400, 401, 403, 429, 500 Content type: `application/json` | Field | Type | Description | |---|---|---| | `error` | object | | | `error.code` | string | | | `error.message` | string | | | `error.fix` | string \| null | | | `error.details` | object \| null | | | `error.retryAfterMs` | number \| null | | Example: ```json { "error": { "code": "", "message": "", "fix": "", "details": {}, "retryAfterMs": 123 } } ``` ## Examples ### cURL ```bash curl --request GET \ --url 'https://api.coach-platform.com/api/public/webhooks' \ --header 'Authorization: Bearer cp_live_...' ``` ### JavaScript (fetch) ```js const response = await fetch('https://api.coach-platform.com/api/public/webhooks', { method: 'GET', headers: { Authorization: 'Bearer cp_live_...', }, }); const data = await response.json(); ``` ## Related endpoints - Previous: [Get a purchase](https://www.coach-platform.com/docs/api/reference/get-purchases-purchase-id/index.md): `GET /api/public/purchases/{purchaseId}`. Get a customer purchase by id.