---
title: "Apply a schematic template (destructive legend rebuild)"
method: POST
path: "/api/v0/components/{component_id}/schematic/template-applications"
tags: ["Components"]
---

# Apply a schematic template (destructive legend rebuild)

`POST /api/v0/components/{component_id}/schematic/template-applications`

Enqueues a Hyrex task that VLM-classifies every detected symbol against the template's class hierarchy, dedups by classified leaf, and rewrites the legend from the highest-confidence representative of each group.

This is destructive: the existing legend is dropped except for entries with ``cfihos_source="user_pinned"``. The ``confirm`` flag in the request body must be ``true`` — the endpoint refuses to enqueue without it as a server-side guard against accidental destructive applies.

Returns a ``job_status_id`` to poll via ``/api/v0/job-statuses/{id}``.

## Path parameters

- `component_id` string, required

## Query parameters

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

## Request body

- TemplateApplicationRequest — Body for ``POST .../template-applications``. ``confirm`` must be ``true`` — the endpoint enforces it as a server-side guard against accidental destructive applies. The UI sets it after the in-modal confirmation dialog.
  - `template_id` string, required
  - `confirm` boolean

## Response `200`

Successful Response

- ComponentPostResponse
  - `job_status_id` string, uuid, required — The ID of the job status
  - `status` string, required — The status of the job
  - `error_message` string, nullable, required — The error message if the job failed
  - `component_id` string, uuid, required — The ID of the component

## 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)
