---
title: "Replace a recipe (its version goes up: documents of the new version get new ids)"
method: PUT
path: "/api/v1/recipes/{id}"
tags: ["Automation"]
---

# Replace a recipe (its version goes up: documents of the new version get new ids)

`PUT /api/v1/recipes/{id}`

## Request

- Base URL: `https://philforms.com`
- URL: `https://philforms.com/api/v1/recipes/{id}`
- Auth: HTTP bearer

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string
  - `form_id` string, required
  - `row_mode` 'each' | 'total': each = one form per row (default); total = one form for the whole sheet
  - `total_parameter` string[]: With row_mode total: parameters summed over the rows
  - `source` object: { type: "url", url, header? } (JSON or CSV) | { type: "csv", text } | { type: "static", row: [...] } — optional: a run may send its own rows
  - `mapping` object[]: column → parameter; left out: your saved mapping for the header row, else exact parameter names, else a proposal
    - `header` string
    - `parameter` string
  - `join` object[]
    - `parameter` string
    - `header` string[]
    - `separator` string
  - `constant` object: Values on every document (a blank cell never overrides one)
  - `transform` object[]
    - `parameter` string
    - `step` string[]: trim, upper, lower, collapse_space, digit, number, date, date:<format> (e.g. date:DD/MM/YYYY), zip, default:<value>, prefix:<text>, slice:<start>,<end>
  - `file_name_field` string
  - `deliver` object
    - `webhook_url` string
  - `as_of` string: The documents' date (YYYY-MM-DD = midnight Asia/Manila); default: the run's day

## Response `200`

{ recipe }

## Other responses

- `400`: Bad recipe
- `404`: No such recipe

---

[API](https://skmtc.dev/philforms/apis/philforms-api.md) · [All operations](https://skmtc.dev/philforms/apis/philforms-api/llms.txt) · [OpenAPI document](https://skmtc.dev/philforms/apis/philforms-api/revisions/a43bf313729c?raw)
