---
title: "Update a recipe"
method: PUT
path: "/recipes/{recipe_id}"
tags: ["Private"]
---

# Update a recipe

`PUT /recipes/{recipe_id}`

## Request

- The document declares no server URL.
- Auth: API key in header `service-token`

Update a recipe by getting the specific recipe by id and update in mongo

## Path parameters

- `recipe_id` string, required

## Request body

- UpdateRecipe: An object returned for a recipe
  - `id` string: A unique id for the recipe
  - `alias` string: An alias for the recipe
  - `format` 'v4' | 'cantabular_blob' | 'cantabular_table': The recipe format
  - `files` InputFile[]
    - `description` string, required: The description of the input file
  - `output_instances` Instance[]: A list of all instances created using this recipe
    - `dataset_id` string: A unique id for a dataset
    - `editions` string[]: Types of editions within the dataset
    - `title` string: The title for the dataset
    - `code_lists` CodeList[]: A list of all code lists within this instance
      - `id` string: A unique id for a single code list
      - `name` string: The name of the codelist
      - `href` string: A URL to the code list
      - `is_hierarchy` boolean: A bool to inform if there is hierarchy for codelist
  - `cantabular_blob` string: A Cantabular-specific collection of data

## Response `200`

Specific recipe updated successfully with given recipe updates

## Other responses

- `400`: An incomplete/invalid recipe entered in request to be updated to mongo
- `401`: Unauthorisation request as invalid auth token given
- `404`: Recipe not found
- `500`: Failed to process the request due to an internal error

---

[API](https://skmtc.dev/office-of-national-statistics/apis/recipe-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/recipe-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/recipe-api/revisions/51dcd3258b3d?raw)
