# Change a finding's resolution status

PATCH

/projects/{projectId}/findings/{findingId}/resolution

```js
const url = 'https://zkao.io/api/v1/projects/example/findings/example/resolution';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"resolutionStatus":"NOT_STARTED","note":{"content":"example","existingNoteId":"example"},"reason":"fixed_in_code"}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request PATCH \
  --url https://zkao.io/api/v1/projects/example/findings/example/resolution \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "resolutionStatus": "NOT_STARTED", "note": { "content": "example", "existingNoteId": "example" }, "reason": "fixed_in_code" }'
```

* Production`zkao.io/api/v1/projects/{projectId}/findings/{findingId}/resolution`
* Staging`staging.zkao.io/api/v1/projects/{projectId}/findings/{findingId}/resolution`

Requires scope: `findings:write`.

On a finding triage dismissed (`triageStatus` `FALSE_POSITIVE`), any status other than `FALSE_POSITIVE` or `DUPLICATE` reopens it: its `triageStatus` becomes `CONFIRMED` and the override fields record who did it. `NOT_STARTED` reopens it even when that is already its resolution. Setting `FALSE_POSITIVE` on a reopened finding undoes the reopen: the triage verdict comes back, the override is cleared, and the resolution returns to `NOT_STARTED`. The response carries the stored statuses.

## Authorizations

* **[bearerAuth](https://docs.staging.zkao.io/api/#bearerauth)**

## Parameters

### Path Parameters

* **projectId**

  required

  string

* **findingId**

  required

  string

  The finding id, or the `ZK-` label shown on the finding page (the id’s last eight characters, prefix optional). A label that matches more than one finding in the project is refused with `409 conflict`; use the full id.

## Request Bodyrequired

application/json

object

* **resolutionStatus**

  required

  string

  Allowed values: NOT_STARTED IN_PROGRESS RESOLVED WONT_FIX MITIGATED FALSE_POSITIVE DUPLICATE

* **note**

  Optionally attach or reuse a note alongside a resolution change.

  object

  * **content**

    Create a new note with this body.

    string

  * **existingNoteId**

    Reuse an existing note by id.

    string

* **reason**

  Short code for why a finding is being closed, chosen from the set offered for the `resolutionStatus` it is sent with; a code belonging to a different status is rejected with 400. Ignored for the open statuses (`NOT_STARTED`, `IN_PROGRESS`) and when `note` is also given. It is not stored as a field: it is recorded as a comment on the finding stating what was chosen, which is returned by the notes endpoints.

  Codes per status. `RESOLVED`: fixed_in_code, fixed_upstream, code_removed. `MITIGATED`: compensating_control, limited_exposure, monitored. `FALSE_POSITIVE`: not_reachable, guarded_elsewhere, intended_behavior, misread_code, bad_assumption. `WONT_FIX`: risk_accepted, out_of_scope, not_worth_fixing, code_being_removed. `DUPLICATE`: duplicate_of_finding, same_root_cause.

  string

  Allowed values: fixed_in_code fixed_upstream code_removed compensating_control limited_exposure monitored not_reachable guarded_elsewhere intended_behavior misread_code bad_assumption risk_accepted out_of_scope not_worth_fixing code_being_removed duplicate_of_finding same_root_cause

  ##### Example

  ```plaintext
  not_reachable
  ```

## Responses

### 200

OK

application/json

object

* **findingId**

  required

  string

* **resolutionStatus**

  required

  string

  Allowed values: NOT_STARTED IN_PROGRESS RESOLVED WONT_FIX MITIGATED FALSE_POSITIVE DUPLICATE

* **triageStatus**

  required

  The triage status after the change. It moves when the change reopens a finding triage dismissed, or undoes that reopen.

  string

  Allowed values: PENDING NEW DUPLICATE RECURRING CONFIRMED FALSE_POSITIVE INCONCLUSIVE

##### Example

```json
{
  "resolutionStatus": "NOT_STARTED",
  "triageStatus": "PENDING"
}
```

### 400

Invalid request

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```

### 401

Missing, malformed, expired, or revoked token

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```

### 403

The token lacks the required scope

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```

### 404

Resource not in this token’s project or repo allowlist

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```

### 409

A compare-and-set (`expectedContent`) missed: the guidance changed since it was read. Re-read the current guidance and retry.

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```
