Skip to content
Skip to Content
Docs
Studio

Discard Custom Ingredient Pending Changes

Discard a custom ingredient's open pending changes. The ingredient and every recipe using it are not changed. The discarded versions stay readable in the ingredient's history. Send the pending changes' newest version_id (tip_version_id) as If-Match, so nothing the caller has not seen is thrown away. Allowed while the ingredient is active or archived. An AI agent can discard only pending changes it started, for the same member, that no one else edited. A machine client cannot discard pending changes.

DELETE
/studio/custom-ingredients/{custom_ingredient_id}/pending-changes

Path Parameters

custom_ingredient_id*Custom Ingredient Id

Header Parameters

If-Match*string

The custom ingredient's current version_id: the one the last change to this custom ingredient returned, or the one reading it returns (get_custom_ingredient). A stale value is refused with the current version_id; read the custom ingredient again and retry.

Response Body

Successful Response

application/json
  1. response

The pending changes after they were discarded.

The ingredient's current version is not changed. The discarded versions stay readable in the ingredient's history.

meta*

Response metadata.

pending_changes*

The open pending changes of a custom ingredient, without their content.

Pending changes are proposed edits kept beside the ingredient. Recipes, search and the ingredient list keep using the ingredient's current version until a person confirms them. Read their content with getCustomIngredientPendingChanges.

Example Request
curl -X DELETE 'https://api.bettermenu.live/studio/custom-ingredients/string/pending-changes' \  -H 'If-Match: string'
Example Response
{  "meta": {    "version": "string",    "request_id": "string",    "timestamp": "string"  },  "pending_changes": {    "id": "string",    "state": "open",    "base_version_id": "string",    "tip_version_id": "string",    "origin": "member",    "created_at": "2019-08-24T14:15:22Z",    "created_by": "string",    "last_commit_at": "2019-08-24T14:15:22Z"  }}

Recipe in, FDA-format Nutrition Facts out, with every version kept.

Start freeNo card needed.