---
title: "Update a detection"
method: PATCH
path: "/api/v2/governance/detections/{detection_id}"
tags: ["Governance Console"]
---

# Update a detection

`PATCH /api/v2/governance/detections/{detection_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/governance/detections/{detection_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/governance/detections/:detection_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update a governance detection by its unique identifier. Only the attributes present in the
request are modified, allowing a detection to be acknowledged as an exception, reopened,
reassigned, or deferred for mitigation.

## Path parameters

- `detection_id` string, required

## Request body

- GovernanceControlDetectionUpdateRequest: A request to update a governance control detection.
  - `data` GovernanceControlDetectionUpdateData, required: The data of a governance control detection update request.
    - `attributes` GovernanceControlDetectionUpdateAttributes: The attributes of a governance control detection that can be updated. Only the attributes present in the request are modified.
      - `assigned_team` string: The handle of the team the detection is assigned to. Set to an empty string to clear the assignment.
      - `assigned_to` string: The UUID of the user the detection is assigned to. Set to an empty string to clear the assignment.
      - `mitigate_after` string, date-time: The timestamp after which the detection becomes eligible for mitigation. Used to defer mitigation to a later time.
      - `state` 'exception' | 'active': The new state to set for the detection. Set to `exception` to acknowledge the detection and exclude it from active counts, or `active` to reopen it.
    - `type` 'governance_control_detection', required: Governance control detection resource type.

## Response `200`

OK

- GovernanceControlDetectionResponse: A single governance control detection.
  - `data` GovernanceControlDetectionData, required: A governance control detection resource.
    - `attributes` GovernanceControlDetectionAttributes, required: The attributes of a governance control detection.
      - `assigned_team` string: The identifier of the team the detection is assigned to, if any.
      - `assigned_to` string: The identifier of the user the detection is assigned to, if any.
      - `assignment_source` 'auto_resolved' | 'manual' | 'reassigned' | 'cleared', required: How the detection's current assignment was determined. Possible values are `auto_resolved`, `manual`, `reassigned`, and `cleared`.
      - `control_id` string, required: DEPRECATED: mirrors `detection_type` for backward compatibility; use `detection_type` instead.
      - `created_at` string, date-time, required: The date and time when the detection was created.
      - `detection_type` string, required: The type of detection, which determines what condition was detected.
      - `display_name` string, required: The human-readable name of the detected resource.
      - `exception_at` string, date-time: The date and time when the detection was marked as an exception, if applicable.
      - `exception_by` string: The identifier of the user who marked the detection as an exception, if applicable.
      - `metadata` unknown
      - `mitigate_after` string, date-time: The date and time after which the detection is scheduled to be mitigated, if applicable.
      - `mitigated_at` string, date-time: The date and time when the detection was mitigated, if applicable.
      - `priority` integer, required: The priority of the detection, if set.
      - `resource_id` string, required: The identifier of the resource the detection applies to.
      - `resource_type` string, required: The type of resource the detection applies to, for example `api_key` or `dashboard`.
      - `state` 'active' | 'exception' | 'mitigated' | 'inactive' | 'obsolete' | 'resolved_externally' | 'mitigation_in_progress', required: The current state of the detection. Possible values are `active`, `exception`, `mitigated`, `inactive`, `obsolete`, `resolved_externally`, and `mitigation_in_progress`.
    - `id` string, required: The unique identifier of the detection.
    - `type` 'governance_control_detection', required: Governance control detection resource type.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
