---
title: "Update a custom component."
method: PUT
path: "/custom-components/{customComponentId}"
tags: ["Custom components"]
---

# Update a custom component.

`PUT /custom-components/{customComponentId}`

Update a custom component. The template is sanitized server-side; unsafe markup is rejected with 400.

## Path parameters

- `customComponentId` string, required

## Headers

- `project` string, required

## Request body

- CustomComponentDTO
  - `name` string, required — Unique kebab-case identifier within the project (`^[a-z][a-z0-9-]{1,49}$`, 2-50 chars).
  - `description` string — Short description shown to the AI, max 120 characters.
  - `whenToUse` string — Guidance for the AI on when to render this component, max 500 characters.
  - `schema` unknown, required
  - `template` string, required — HTML template, max 20000 characters. Sanitized server-side; unsafe markup is rejected with 400. The sanitized result is returned as the read-only `sanitizedTemplate` field.
  - `exampleData` unknown
  - `isPublished` boolean

## Response `200`

Ok

- CustomComponentDocument
  - `updatedAt` string, required
  - `createdAt` string, required
  - `createdBy` string
  - `isPublished` boolean, required
  - `exampleData` unknown, required
  - `sanitizedTemplate` string, required
  - `template` string, required
  - `whenToUse` string, required
  - `project` object, required
    - `isValid` object
    - `createFromHexString` object
    - `createFromTime` object
    - `generate` object
    - `cacheHexString` unknown
    - `prototype` string
  - `description` string, required
  - `name` string, required
  - `schema` unknown, required

---

[API](https://skmtc.net/gleap/apis/gleap-server.md) · [All operations](https://skmtc.net/gleap/apis/gleap-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gleap/gleap-server/versions/6f02af3a6c47/schema)
