Restore Recipe to Version
Roll back a live recipe to the content state it had at a prior version.
This is a full point-in-time restore — every sub-entity of the recipe
(ingredients, servings, nutrition, label configuration, summary, metadata)
snaps back to exactly the state recorded in target_version_id. Any
sub-entities added or modified after that version — including servings added
later — are removed in the restored commit. This matches the semantics of
git checkout <tag>: the entire tree reverts, not just the fields that
changed between the target and the current HEAD.
This is a version rollback, not an un-delete. The recipe must be
ACTIVE or ARCHIVED — a deleted recipe returns 404 (recipe_not_found),
the same as any other read. To check whether a recipe is deleted, call
getRecipe first; deleted recipes are fully hidden from all endpoints.
Creates a new commit whose content matches target_version_id; the existing
history is never rewritten. The new version_id is returned in the response
body and ETag header — pass it as If-Match on subsequent mutations.
Returns 404 if the recipe does not exist (or is deleted), or if the target
version does not exist; 412 on If-Match mismatch.
Path Parameters
Header Parameters
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 stale token (header present but HEAD has moved) surfaces HTTP 409 with the current version_id in the response body. An absent token on a versioned recipe surfaces HTTP 412. Only consumed on API versions that declare the recipe_versioning capability — older versions ignore the header.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.bettermenu.live/studio/recipes/string/restore" \ -H "If-Match: string" \ -H "Content-Type: application/json" \ -d '{ "target_version_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV" }'{
"data": {
"id": "string",
"name": "string",
"country": "US",
"regulatory_authority": "US_FDA",
"demographic": "adults_and_children_over_4",
"status": "active",
"created_at": "string",
"updated_at": "string"
},
"meta": {
"version": "string",
"request_id": "string",
"timestamp": "string"
},
"version_id": "string"
}{
"type": "https://api.bettermenu.com/errors/recipe_not_found",
"title": "Recipe Not Found",
"status": 400,
"detail": "Recipe rcpe_abc123 does not exist",
"code": "recipe_not_found",
"retryable": true,
"instance": "/api/v1/recipes/rcpe_abc123",
"trace_id": "req_xyz789",
"errors": [
{}
],
"invalid_ids": [
"f_abc123",
"f_xyz789"
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}{
"type": "https://api.bettermenu.com/errors/recipe_not_found",
"title": "Recipe Not Found",
"status": 400,
"detail": "Recipe rcpe_abc123 does not exist",
"code": "recipe_not_found",
"retryable": true,
"instance": "/api/v1/recipes/rcpe_abc123",
"trace_id": "req_xyz789",
"errors": [
{}
],
"invalid_ids": [
"f_abc123",
"f_xyz789"
]
}