---
title: "Generate meal plan content using AI"
method: POST
path: "/patients/{patient_id}/meal-plans/{meal_plan_id}/generate"
tags: ["meal-plan"]
---

# Generate meal plan content using AI

`POST /patients/{patient_id}/meal-plans/{meal_plan_id}/generate`

## Request

- Base URL: `https://api.rxfoodapp.com/api`
- URL: `https://api.rxfoodapp.com/api/patients/{patient_id}/meal-plans/{meal_plan_id}/generate`
- Auth: HTTP bearer

## Path parameters

- `patient_id` integer, required
- `meal_plan_id` integer, required

## Response `202`

Generation started

- TaskResultResponse
  - `link` string
  - `result_http_body_json` object, nullable
  - `result_http_status` number, nullable
  - `task_error_name` string, nullable
  - `task_id` string
  - `task_is_error` boolean
  - `task_is_pending` boolean
  - `task_is_success` boolean
  - `task_status` 'pending' | 'success' | 'error'

## Other responses

- `400`: meal plan is not in draft status
- `404`: meal plan not found

---

[API](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server.md) - [All operations](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/llms.txt) - [OpenAPI document](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/revisions/c3d8e22b22e8?raw)
