---
title: "Create a new defect"
method: POST
path: "/defect/{code}"
tags: ["defects"]
---

# Create a new defect

`POST /defect/{code}`

This method allows to create a defect in selected project.

## Path parameters

- `code` string, required

## Request body

- DefectCreate
  - `title` string, required
  - `actual_result` string, required
  - `severity` integer, required
  - `milestone_id` integer, nullable
  - `attachments` string[]
  - `custom_field` CustomField — unresolved $ref
  - `tags` string[]

## Response `200`

A result.

- IdResponse
  - `status` boolean
  - `result` object
    - `id` integer

## Other responses

- `400` — Bad Request.
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Not Found.
- `422` — Unprocessable Entity.
- `429` — Too Many Requests.

---

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