---
search:
  tags:
    - Meal Plans
    - POST
seo:
  description: >-
    Creates a complete meal plan for a patient: daily (a menu per weekday),
    flexible (model days… Reference for the POST /meal-plans endpoint in the
    Almendra API.
sidebar:
  label: Create a meal plan
  badge: POST
title: Create a meal plan
type: openapi-operation
---
Creates a complete meal plan for a patient: `daily` (a menu per weekday), `flexible` (model days of options) or `exchange` (model days of portions per exchange group). Foods and recipes come from `GET /foods` and `GET /recipes`; quantities are in grams unless `unit` names one of the food's measures. The plan is a draft the professional can review in the dashboard; set `send: true` to send it to the patient right away.

Requires the `meal_plans:write` permission.

`POST /meal-plans`

**Request body** (`application/json`)

- `patient_id` (string, required) — Patient the plan is for
- `name` (string, required)
- `type` (string, required) — \`daily\`: a menu for each day of the week; \`flexible\`: 1 to 7 model days of options the patient chooses from; \`exchange\`: 1 to 7 model days of portions per exchange group.
- `startDate` (string<date>) — First day, in the account's time zone. Defaults to the day after the patient's last plan ends, or tomorrow.
- `endDate` (string<date>) — Last day (defaults to 6 days after \`startDate\`). \`daily\` and \`text\` plans last whole weeks. When editing, a new \`startDate\` alone keeps the plan's length.
- `objective` (string)
- `indications` (string[]) — Recommendations shown with the plan (defaults to the patient's previous plan's)
- `days` (MealPlanDayInput[], required)
- `send` (boolean) — Finish it and send it to the patient right away (same as \`POST /meal-plans/{meal\_plan\_id}/send\`). Otherwise it stays a draft in the dashboard.

Request body example:

```json
{
  "patient_id": "507f1f77bcf86cd799439011",
  "name": "Plan semana 1",
  "type": "daily",
  "startDate": "2026-11-02",
  "endDate": "2026-11-02",
  "objective": "string",
  "indications": [
    "string"
  ],
  "days": [
    {
      "weekday": "monday",
      "name": "string",
      "isFreeDay": true,
      "targets": {
        "caloriesKcal": 1800,
        "proteinG": 110,
        "carbsG": 200,
        "fatG": 60
      },
      "meals": []
    }
  ],
  "send": false
}
```

**Responses**

- `201` — Meal plan created
- `400` — Invalid path parameter, query parameter or request body
- `401` — Missing or invalid API key
- `403` — The account behind the API key has no active paid plan, or the key lacks the permission this operation needs
- `404` — Patient, food or exchange group not found
- `415` — Request body sent without \`Content-Type: application/json\`
- `429` — Rate limit exceeded (600 requests per 60 seconds); retry after \`Retry-After\` seconds
- `500` — Unexpected server error

Response example, 201:

```json
{
  "_id": "string",
  "name": "Plan semana 1",
  "patient": "string",
  "type": "daily",
  "startDate": "2019-08-24T14:15:22Z",
  "endDate": "2019-08-24T14:15:22Z",
  "sent": true,
  "objective": "string",
  "pdfUrl": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "indications": [
    "string"
  ],
  "days": [
    {
      "name": "Lunes",
      "isFreeDay": true,
      "caloriesKcal": 0,
      "proteinG": 0,
      "carbsG": 0,
      "fatG": 0,
      "meals": [
        {
          "name": "Desayuno",
          "time": "08:00",
          "comment": "string",
          "text": "string",
          "caloriesPercentage": 0,
          "proteinTargetG": 0,
          "carbsTargetG": 0,
          "fatTargetG": 0,
          "options": [
            {
              "name": "Opción 1",
              "foods": [
                {
                  "food": "string",
                  "foodName": "Avena en hojuelas",
                  "quantity": 40,
                  "unit": "g"
                }
              ]
            }
          ],
          "exchanges": [
            {
              "group": "string",
              "quantity": 2,
              "excludedFoods": [
                "string"
              ]
            }
          ]
        }
      ]
    }
  ]
}
```
