---
title: "Replace the per-document legend"
method: PUT
path: "/api/v0/components/{component_id}/schematic/legend"
tags: ["Components"]
---

# Replace the per-document legend

`PUT /api/v0/components/{component_id}/schematic/legend`

Overwrites `grounding.graph.legend` wholesale. The rest of the graph (network, annotations, arrows, subgraphs) is preserved by loading the current graph, swapping the legend field, and re-saving. Each entry's `source_crop_url` is validated against the document's storage scope — only data URLs (≤32 KB) and storage URLs anchored at this document's `legend_crops/` prefix are accepted.

## Path parameters

- `component_id` string, required

## Query parameters

- `vc_id` string, required — Public ID of the target visual component

## Request body

- ReplaceLegendRequest
  - `legend` LegendEntry[], required
    - `id` string, required
    - `name` string, required
    - `class` string, required
    - `subtype` string, nullable
    - `source_bbox` BoundingBox
      - `x0` integer, required
      - `y0` integer, required
      - `x1` integer, required
      - `y1` integer, required
      - `dpi` integer
      - `class_name` string, nullable
      - `text` string, nullable
      - `confidence` number, nullable
    - `source_node_id` string, nullable
    - `source_crop_url` string, nullable
    - `confidence` number
    - `cfihos_tag_class_code` string, nullable
    - `cfihos_equipment_class_code` string, nullable
    - `cfihos_version` string, nullable
    - `cfihos_source` 'deterministic_map' | 'name_match' | 'isa_letter_code' | 'llm' | 'template_applied' | 'user_pinned', nullable
    - `cfihos_confidence` number, nullable

## Response `204`

Successful Response

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/outerport/apis/outerport-api.md) · [All operations](https://skmtc.dev/outerport/apis/outerport-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/outerport/outerport-api/revisions/f565b46daaea/schema)
