---
title: "Update defect"
method: PATCH
path: "/defect/{code}/{id}"
tags: ["defects"]
---

# Update defect

`PATCH /defect/{code}/{id}`

This method updates a defect.

## Path parameters

- `code` string, required
- `id` integer, required

## Request body

- DefectUpdate
  - `title` string
  - `actual_result` string
  - `severity` integer
  - `milestone_id` integer, nullable
  - `attachments` string[]
  - `custom_field` object — Custom field values keyed by the field's project-scoped `internal_id` (see `GET /custom_field`). Values are always **scalar strings**; arrays, objects or non-scalars are rejected. | Field type | Value format | Example | |----------------------|-------------------------------------------|-------------------------| | `string`, `text` | Plain string | `"hello"` | | `number` | Numeric string | `"42"` | | `url` | Valid URL | `"https://qase.io"` | | `datetime` | Absolute date (ISO 8601 recommended) | `"2026-04-29T15:00:00Z"`| | `selectbox`, `radio` | Option `id` as string | `"1"` | | `multiselect` | Comma-separated option `id`s (no spaces) | `"1,2,3"` | | `checkbox` | `"1"` to check, `""` to uncheck | `"1"` | | `user` | Team member `internal_id` as string | `"42"` | Partial update: only fields present in the payload are validated; required fields not included are not enforced. Send `""` to clear a value. Unknown `internal_id`s are rejected; option-based values must reference an existing option. Note: a `required` checkbox without a default cannot be unchecked via the API — set a default or clear `required` in workspace settings.
  - `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)
