---
title: "Update pipeline"
method: POST
path: "/api/v1/tools/update_pipeline"
---

# Update pipeline

`POST /api/v1/tools/update_pipeline`

## Request

- Base URL: `https://www.trezalabs.com`
- URL: `https://www.trezalabs.com/api/v1/tools/update_pipeline`
- Auth: HTTP bearer

Update a pipeline: rename it, change its description, or replace its node graph. For a graph change, read the current one with get_pipeline includeGraph and send the whole graph back, nodes and edges together, every edge naming the two nodes it joins and a port on each, e.g. {"source":"music","sourceHandle":"audio","target":"sequence","targetHandle":"shots"}. A graph with error-level issues is refused with every issue listed, and nothing is saved; settings you change are checked against get_node_type and the live model catalog the same way create_pipeline checks them. To add music, narration or captions to a video a run already made, pass its url from get_run outputs to assemble_video or edit_asset instead: a changed pipeline renders every node again when it runs, the video included, and charges for it.

## Request body

- object
  - `pipelineId` string, required
  - `name` string
  - `description` string
  - `nodes` object[]: The complete new node list. Pass together with edges; the graph is replaced whole.
    - `id` string, required: Unique id. Edges, and run_pipeline inputs, refer to the node by it.
    - `type` string, required: A node type from list_node_types, e.g. "file", "music-gen", "sequence", "output".
    - `label` string: Name shown on the canvas.
    - `position` object: Canvas position. Laid out automatically when omitted.
      - `x` number, required
      - `y` number, required
    - `config` object: Settings, as get_node_type's configSchema describes them. A node this call adds starts from its type's defaults, and what you pass overrides them.
  - `edges` object[]: The complete new wire list, e.g. {"source":"music","sourceHandle":"audio","target":"sequence","targetHandle":"shots"}. Pass together with nodes; [] for none.
    - `id` string: Unique id for this wire. Assigned when omitted.
    - `source` string, required: Id of the node the wire leaves, as given in `nodes`.
    - `sourceHandle` string, required: Output port on the source node: an `outputs` id from get_node_type, e.g. "audio" on music-gen or "video" on sequence. "out" is the generic output the canvas draws; name the port instead on a node with more than one output besides "result" (update_pipeline refuses a new generic wire there).
    - `target` string, required: Id of the node the wire enters, as given in `nodes`.
    - `targetHandle` string, required: Input port on the target node: an `inputs` id from get_node_type, e.g. "shots" on sequence or "prompt" on music-gen. "in" is the generic input the canvas draws, which guesses a port by media type at run time; name the port instead on a node with more than one input (update_pipeline refuses a new generic wire there).

## Response `200`

The tool's result.

- object

## Other responses

- `400`: The arguments were refused. `error` says why.
- `401`: No API key, or one that is not valid.
- `402`: The credit balance does not cover this run.
- `403`: The API key lacks a permission this tool needs.
- `404`: No such tool, or the pipeline, run or asset is not on this account.
- `429`: Too many runs started or in progress. Wait, then try again.

---

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