---
title: "Update component"
method: PUT
path: "/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/components/{componentIdOrName}"
tags: ["Components"]
---

# Update component

`PUT /gh/{ownerKeyOrId}/projects/{projectKeyOrId}/components/{componentIdOrName}`

Replace a Component's definition. Takes the same fields as create and fully replaces the existing definition; the Component's id and creator are preserved. Requires admin access to the Project, and the Project must have Components enabled.

## Path parameters

- `ownerKeyOrId` string, required — Repository owner name (login) or workspace ID
- `projectKeyOrId` string, required — Repository name or project ID
- `componentIdOrName` string, required — Component ID or name

## Request body

- ComponentInput
  - `name` string, required
  - `description` string, nullable
  - `pathGlobs` string[], required — Glob patterns matching the Component's file paths, one glob per array element. `*` matches any characters, including `/`.

## Response `200`

The updated component

- ComponentDefinition — A Component as defined for a Project, without computed fields such as fileCount
  - `id` string, required
  - `name` string, required
  - `description` string, nullable, required
  - `pathGlobs` string[], required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `429` — Rate Limit Exceeded
- `500` — Internal Server Error

## Changes

- **2026-07-31** `b61e0586adfe` — 3 breaking, 1 info
  - the `pathGlobs` request property's minItems was increased to `1`
  - the `pathGlobs` request property type/format changed from `string`/`` to `array`/``
  - the `pathGlobs` response's property type/format changed from `string`/`` to `array`/`` for status `200`
  - the `pathGlobs` request property's minLength was decreased from `1` to `0`
- **2026-07-26** `264ba73f15f4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/qlty/apis/qlty-api/changes/gh/:ownerKeyOrId/projects/:projectKeyOrId/components/:componentIdOrName/put.md)

---

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