Send a meal plan to the patient
Finishes the plan, like “Finish” in the dashboard: it appears in the patient’s Almendra app and the patient gets a notification. Sending an already sent plan changes nothing.
Requires the meal_plans:write permission.
/meal-plans/{meal_plan_id}/sendAuthorizationToken Bearer (API Key) · headerobligatorioAlmendra API key, bound to one professional account. Send it as Authorization: Bearer YOUR_API_KEY.
meal_plans:writemeal_plan_idstringobligatorioMeal plan ID
Meal plan sent
_idstringobligatorionamestringobligatoriopatientstringobligatorioPatient ID
typestringobligatoriodaily: a menu per day; flexible: the same options every day; exchange: portions per exchange group; text: meals written as free text (meals[].text); pdf: an uploaded PDF (pdfUrl).
dailyflexibleexchangetextpdfstartDatestring<date-time>endDatestring<date-time>sentbooleanobligatorioFinished and visible to the patient in the Almendra app
objectivestringpdfUrlstringcreatedAtstring<date-time>obligatorioupdatedAtstring<date-time>obligatorioSend it back as expectedUpdatedAt when editing to avoid overwriting newer changes
indicationsstring[]obligatorioRecommendations shown to the patient with the plan
daysMealPlanDay[]obligatorioMostrar propiedadesOcultar propiedades
MealPlanDaynamestringobligatorioisFreeDaybooleanobligatoriocaloriesKcalnumberproteinGnumbercarbsGnumberfatGnumbermealsMealPlanMeal[]obligatorioMostrar propiedadesOcultar propiedades
MealPlanMealnamestringobligatoriotimestringcommentstringtextstringtext plans: the meal written as free text by the professional
caloriesPercentagenumberShare of the day's calories this meal targets (0–100)
proteinTargetGnumbercarbsTargetGnumberfatTargetGnumberoptionsMealPlanOption[]obligatorioAlternatives the patient can choose from for this meal
Mostrar propiedadesOcultar propiedades
MealPlanOptionnamestringfoodsMealPlanFood[]obligatorioMostrar propiedadesOcultar propiedades
MealPlanFoodfoodstringobligatorioFood or recipe ID
foodNamestringobligatorioquantitynumberobligatoriounitstringobligatorioexchangesMealPlanExchange[]obligatorioExchange portions (exchange meal plans)
Mostrar propiedadesOcultar propiedades
MealPlanExchangegroupstringobligatorioExchange group: the id of a stored group (GET /exchange-groups) or a built-in group code
quantitynumberobligatorioexcludedFoodsstring[]obligatorioFood IDs of the group the patient should not pick
Invalid path parameter, query parameter or request body
successbooleanobligatoriofalsemessagestringobligatorioSame as error.message.
errorobjectobligatorioMostrar propiedadesOcultar propiedades
statusintegerobligatorioHTTP status code of the response.
codestringobligatorioMachine-readable error code, stable across versions; branch on this rather than on message.
bad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictpayload_too_largeunsupported_media_typeunprocessable_entityrate_limitedinternal_errornot_implementedbad_gatewayservice_unavailablegateway_timeoutmessagestringobligatorioHuman-readable explanation of what went wrong.
Missing or invalid API key
successbooleanobligatoriofalsemessagestringobligatorioSame as error.message.
errorobjectobligatorioMostrar propiedadesOcultar propiedades
statusintegerobligatorioHTTP status code of the response.
codestringobligatorioMachine-readable error code, stable across versions; branch on this rather than on message.
bad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictpayload_too_largeunsupported_media_typeunprocessable_entityrate_limitedinternal_errornot_implementedbad_gatewayservice_unavailablegateway_timeoutmessagestringobligatorioHuman-readable explanation of what went wrong.
The account behind the API key has no active paid plan, or the key lacks the permission this operation needs
successbooleanobligatoriofalsemessagestringobligatorioSame as error.message.
errorobjectobligatorioMostrar propiedadesOcultar propiedades
statusintegerobligatorioHTTP status code of the response.
codestringobligatorioMachine-readable error code, stable across versions; branch on this rather than on message.
bad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictpayload_too_largeunsupported_media_typeunprocessable_entityrate_limitedinternal_errornot_implementedbad_gatewayservice_unavailablegateway_timeoutmessagestringobligatorioHuman-readable explanation of what went wrong.
Meal plan not found
successbooleanobligatoriofalsemessagestringobligatorioSame as error.message.
errorobjectobligatorioMostrar propiedadesOcultar propiedades
statusintegerobligatorioHTTP status code of the response.
codestringobligatorioMachine-readable error code, stable across versions; branch on this rather than on message.
bad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictpayload_too_largeunsupported_media_typeunprocessable_entityrate_limitedinternal_errornot_implementedbad_gatewayservice_unavailablegateway_timeoutmessagestringobligatorioHuman-readable explanation of what went wrong.
The plan has nothing to send yet
successbooleanobligatoriofalsemessagestringobligatorioSame as error.message.
errorobjectobligatorioMostrar propiedadesOcultar propiedades
statusintegerobligatorioHTTP status code of the response.
codestringobligatorioMachine-readable error code, stable across versions; branch on this rather than on message.
bad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictpayload_too_largeunsupported_media_typeunprocessable_entityrate_limitedinternal_errornot_implementedbad_gatewayservice_unavailablegateway_timeoutmessagestringobligatorioHuman-readable explanation of what went wrong.
Rate limit exceeded (600 requests per 60 seconds); retry after Retry-After seconds
successbooleanobligatoriofalsemessagestringobligatorioSame as error.message.
errorobjectobligatorioMostrar propiedadesOcultar propiedades
statusintegerobligatorioHTTP status code of the response.
codestringobligatorioMachine-readable error code, stable across versions; branch on this rather than on message.
bad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictpayload_too_largeunsupported_media_typeunprocessable_entityrate_limitedinternal_errornot_implementedbad_gatewayservice_unavailablegateway_timeoutmessagestringobligatorioHuman-readable explanation of what went wrong.
Unexpected server error
successbooleanobligatoriofalsemessagestringobligatorioSame as error.message.
errorobjectobligatorioMostrar propiedadesOcultar propiedades
statusintegerobligatorioHTTP status code of the response.
codestringobligatorioMachine-readable error code, stable across versions; branch on this rather than on message.
bad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictpayload_too_largeunsupported_media_typeunprocessable_entityrate_limitedinternal_errornot_implementedbad_gatewayservice_unavailablegateway_timeoutmessagestringobligatorioHuman-readable explanation of what went wrong.