BETTERMENU
Studio

Compute Recipe Nutrition

Compute and save total recipe nutrition (batch-level, all ingredients summed).

Use this endpoint to manually trigger a nutrition recompute — typically after an external update to ingredient nutrient data. The recipe must be in ACTIVE state with at least one confirmed ingredient. The response version_id should be passed back as If-Match on the next mutation.

POST
/studio/recipes/{recipe_id}/nutrition/compute

Path Parameters

recipe_id*Recipe Id

Header Parameters

If-Match?|

Optimistic-concurrency token. Pass the version_id returned by the previous mutation (or by GET /recipes/{id}/versions) so the server can reject the request when another writer has advanced the recipe in the meantime. A mismatch surfaces HTTP 412 with the current version_id in the response body so the client can decide whether to retry, merge, or surface the conflict to the user. Only consumed on API versions that declare the recipe_versioning capability — older versions ignore the header.

Response Body

application/json

application/json

curl -X POST "https://loading/studio/recipes/string/nutrition/compute"
{
  "data": {
    "recipe_id": "string",
    "nutrition": {
      "calculated_at": "string",
      "nutrients": [
        {
          "id": 0,
          "bmid": "string",
          "name": "string",
          "total_amount": 0,
          "unit": "string"
        }
      ],
      "reference_weight_grams": 0
    }
  },
  "meta": {
    "version": "string",
    "request_id": "string",
    "timestamp": "string"
  },
  "version_id": "string"
}
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}