---
title: "Update violation"
method: PATCH
path: "/violations/{id}"
tags: ["Violations"]
---

# Update violation

`PATCH /violations/{id}`

## Request

- Base URL: `https://app.codethreat.com/api/v1`
- URL: `https://app.codethreat.com/api/v1/violations/{id}`
- Auth: API key in header `X-API-Key`

Update violation status or add comments

## Path parameters

- `id` string, required

## Request body

- UpdateViolationRequest
  - `status` 'open' | 'fixed' | 'ignored' | 'false_positive'
  - `comment` string
  - `suppressionReason` string

## Response `200`

Violation updated

- ViolationResponse
  - `success` boolean
  - `data` object
    - `id` string
    - `scanId` string
    - `repositoryId` string
    - `ruleId` string
    - `severity` 'critical' | 'high' | 'medium' | 'low' | 'info'
    - `status` 'open' | 'fixed' | 'ignored' | 'false_positive'
    - `title` string
    - `description` string
    - `file` string
    - `line` integer
    - `column` integer
    - `codeSnippet` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
  - `pagination` Pagination
    - `page` integer
    - `limit` integer
    - `total` integer
    - `totalPages` integer
    - `hasNext` boolean
    - `hasPrev` boolean
  - `meta` ResponseMeta
    - `timestamp` string, date-time
    - `version` string
    - `requestId` string
    - `organizationId` string

---

[API](https://skmtc.dev/codethreat/apis/codethreat-api.md) - [All operations](https://skmtc.dev/codethreat/apis/codethreat-api/llms.txt) - [OpenAPI document](https://skmtc.dev/codethreat/apis/codethreat-api/revisions/18f11fecbb30?raw)
