Cookbook

Save a recipe to cookbook

post/api/cookbook/recipes

Request

  • Base URL
    https://api.rewritelifestyle.ai (the document declares no server; this is the origin it was published from)
  • URL
    https://api.rewritelifestyle.ai/api/cookbook/recipes
  • Auth
    HTTP bearer

Request body

titlestring required
descriptionstring
mealTypestring
caloriesnumber
proteinnumber
carbsnumber
fatnumber
fibernumber
ingredientsobject
instructionsobject
journeyStagestring
customizationNotesstring
userTimezonestring
localTimestampstring
servingsnumber
prepTimestring
cookTimestring
sourcestring
idobject

Recipe ID (ignored on create, used for re-saves)

userIdnumber

User ID (ignored, extracted from JWT)

macrosobject

Nested macros object from AI-generated recipes

tagsobject

Recipe tags

createdAtstring

Creation timestamp from client

original_recipe_idobject

Original recipe ID if customized

creator_namestring

Creator name for community recipes

imagestring
meal_typestring
prep_timestring
surgeryStagestring
dietaryRestrictionsstring[]
isCommunityboolean

Share recipe in the community feed. Defaults to true.

ai_notestring

Personalized AI coaching note (not shown in community feed)

nutritionstring[]

Full nutrition breakdown. Merged into macros so all entries are preserved.

Example request

{
  "title": "Protein-Packed Chicken Bowl",
  "description": "A healthy post-surgery meal",
  "mealType": "dinner",
  "calories": 350,
  "protein": 35,
  "carbs": 40,
  "fat": 12,
  "fiber": 5,
  "journeyStage": "early-post-op",
  "userTimezone": "Asia/Calcutta",
  "localTimestamp": "2026-02-18T11:23:34.331Z",
  "servings": 2,
  "prepTime": "15 min",
  "cookTime": "30 min",
  "source": "ai-generated",
  "isCommunity": true,
  "nutrition": [
    {
      "name": "Sugar",
      "value": 1,
      "unit": "g"
    },
    {
      "name": "Sodium",
      "value": 150,
      "unit": "mg"
    }
  ]
}

Response

unknown required

Example response

{
  "success": true,
  "recipe": {
    "id": 1,
    "user_id": 5,
    "title": "High-Protein Chicken Bowl",
    "meal_type": "lunch",
    "calories": 420,
    "protein": 48,
    "carbs": 30,
    "fat": 12,
    "imageUrl": "https://cdn.example.com/signed-url",
    "created_at": "2026-02-01T00:00:00.000Z"
  }
}

Changes

No recorded changes to this operation across all 34 revisions of this API.