---
title: "Replace a complete canvas graph"
method: PATCH
path: "/v1/collections/{id}/canvases/{canvasId}"
tags: ["Canvases"]
deprecated: true
---

# Replace a complete canvas graph

`PATCH /v1/collections/{id}/canvases/{canvasId}`

## Request

- Base URL: `https://api.masko.ai`
- URL: `https://api.masko.ai/v1/collections/{id}/canvases/{canvasId}`
- Auth: HTTP bearer

> **Deprecated.**

Replaces the complete authored graph. Read the canvas first and send its graph_content_hash as expected_graph_hash. If another editor changes the graph first, the write returns 409 instead of overwriting it. Generated asset fields on unchanged nodes and edges are preserved. No credit cost; generation is triggered separately.

## Path parameters

- `id` string, uuid, required
- `canvasId` string, uuid, required

## Request body

- UpdateCanvasBody
  - `graph` object, required: Full canvas graph to replace the current one. Nodes, edges, and inputs are overwritten.
  - `expected_graph_hash` string: Graph content hash returned by the latest GET. When provided, the update is rejected with 409 if the canvas changed before this full-graph save.

## Response `200`

Canvas updated

- CanvasResponse
  - `data` Canvas, required
    - `object` 'canvas': Resource type. Always "canvas".
    - `id` string, uuid, required
    - `name` string, required
    - `graph` object, required
    - `graph_content_hash` string, required: Revision token for the full authored graph. Send this as expected_graph_hash when replacing the graph.
    - `status` object
      - `nodes` object, required
        - `total` number, required
        - `completed` number, required
        - `pending` number, required: Incomplete node count. Includes failed nodes for backward compatibility; inspect failed for the terminal subset.
        - `failed` number, required
      - `edges` object, required
        - `total` number, required
        - `completed` number, required
        - `pending` number, required
        - `failed` number, required
      - `ready` boolean, required
      - `generated_ready` boolean
      - `preview_ready` boolean
      - `media` object
        - `generation` object, required
          - `ready` boolean, required
          - `nodes` object, required
            - `total` number, required
            - `completed` number, required
            - `pending` number, required: Incomplete node count. Includes failed nodes for backward compatibility; inspect failed for the terminal subset.
            - `failed` number, required
          - `edges` object, required
            - `total` number, required
            - `completed` number, required
            - `pending` number, required
            - `failed` number, required
        - `preview` object, required
          - `ready` boolean, required
          - `repairable` boolean, required
          - `repairable_edges` number, required
          - `waiting_edges` number, required
          - `missing_edges` number, required
          - `missing_formats` string[], required
        - `variants` object, required
          - `sizes` string[], required
          - `missing` object[], required
            - `edge_id` string, required
            - `size` string, required
            - `formats` string[], required
      - `failed_nodes` object[], required
        - `node_id` string, required
        - `job_id` string, uuid, nullable, required
        - `error` string, required
      - `failed_edges` object[], required
        - `edge_id` string, required
        - `job_id` string, uuid, nullable, required
        - `error` string, required
      - `edge_media` object[]
        - `edge_id` string, required
        - `source` string, required
        - `target` string, required
        - `video_asset_id` string, uuid, nullable, required
        - `base` object, required
          - `video_ready` boolean, required
          - `webm_ready` boolean, required
          - `hevc_ready` boolean, required
          - `preview_ready` boolean, required
          - `derivatives_in_flight` boolean, required
          - `source_job_id` string, uuid
          - `source_job_status` string
          - `missing` string[], required
        - `variants` object, required
    - `created_at` string
    - `updated_at` string

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict

---

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