Remove an alternative meal

DELETE/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.

Authentication

Requires an API key, sent as Authorization: Bearer cp_live_....

API keys carry scopes. Get the catalog of scopes and webhook events lists every scope.

Path parameters

Path parameters
NameTypeDescription
menuIdrequiredstring
mealIdrequiredstring
alternativeIdrequiredstring

Query parameters

Query parameters
NameTypeDescription
applyToAllSharedTraineesboolean

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

Header parameters
NameTypeDescription
Idempotency-Keystring

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 examples

cURL
curl --request DELETE \
  --url 'https://api.coach-platform.com/api/public/nutrition-menus/<menuId>/meals/<mealId>/alternatives/<alternativeId>' \
  --header 'Authorization: Bearer cp_live_...'
JavaScript (fetch)
const response = await fetch('https://api.coach-platform.com/api/public/nutrition-menus/<menuId>/meals/<mealId>/alternatives/<alternativeId>', {
  method: 'DELETE',
  headers: {
    Authorization: 'Bearer cp_live_...',
  },
});

const data = await response.json();

Responses

200 OK

The OpenAPI spec does not describe a response body here.

This page is also available as Markdown. Browse it in the interactive explorer or download the OpenAPI spec.