---
title: "Create component"
method: POST
path: "/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/components"
tags: ["Components"]
---

# Create component

`POST /gh/{ownerKeyOrId}/projects/{projectKeyOrId}/components`

Create a Component for a Project. 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

## 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 `201`

The created 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 `201`
  - 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/post.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)
