Retrieve the detections produced by the governance control with the given detection type.
Results can be filtered by state and free-text query, sorted, and paginated.
This endpoint requires the governance_console_read permission.
Arguments
Path Parameters
Name
Type
Description
detection_type [required]
string
The detection type that identifies the control; for example, unused_api_keys.
Query Strings
Name
Type
Description
filter[state]
string
Restrict the results to detections in the given state.
filter[query]
string
Restrict the results to detections matching the given free-text query.
sort
string
A comma-separated list of attributes to sort detections by. Prefix an attribute with
- for descending order.
The attributes available for sorting are id, created_at, assigned_to,
detection_type, display_name, exception_at, mitigate_after, mitigated_at,
priority, resource_id, and state. Defaults to created_at,-id.
page[number]
integer
The zero-based index of the page to return; the first page is 0.
An array of governance control detection resources.
attributes [required]
object
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 [required]
enum
How the detection's current assignment was determined. Possible values are auto_resolved, manual, reassigned, and cleared.
Allowed enum values: auto_resolved,manual,reassigned,cleared
control_id [required]
string
DEPRECATED: DEPRECATED: mirrors detection_type for backward compatibility; use detection_type
instead.
created_at [required]
date-time
The date and time when the detection was created.
detection_type [required]
string
The type of detection, which determines what condition was detected.
display_name [required]
string
The human-readable name of the detected resource.
exception_at
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
Free-form metadata associated with the detection.
mitigate_after
date-time
The date and time after which the detection is scheduled to be mitigated, if applicable.
mitigated_at
date-time
The date and time when the detection was mitigated, if applicable.
priority [required]
int64
The priority of the detection, if set.
resource_id [required]
string
The identifier of the resource the detection applies to.
resource_type [required]
string
The type of resource the detection applies to, for example api_key or dashboard.
state [required]
enum
The current state of the detection. Possible values are active, exception, mitigated, inactive, obsolete, resolved_externally, and mitigation_in_progress.
Allowed enum values: active,exception,mitigated,inactive,obsolete,resolved_externally,mitigation_in_progress
id [required]
string
The unique identifier of the detection.
type [required]
enum
Governance control detection resource type.
Allowed enum values: governance_control_detection
"""
List control detections returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.governance_console_apiimportGovernanceConsoleApiconfiguration=Configuration()configuration.unstable_operations["list_governance_control_detections"]=TruewithApiClient(configuration)asapi_client:api_instance=GovernanceConsoleApi(api_client)response=api_instance.list_governance_control_detections(detection_type="detection_type",)print(response)
# List control detections returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_governance_control_detections".to_sym]=trueendapi_instance=DatadogAPIClient::V2::GovernanceConsoleAPI.newpapi_instance.list_governance_control_detections("detection_type")
// List control detections returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListGovernanceControlDetections",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewGovernanceConsoleApi(apiClient)resp,r,err:=api.ListGovernanceControlDetections(ctx,"detection_type",*datadogV2.NewListGovernanceControlDetectionsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GovernanceConsoleApi.ListGovernanceControlDetections`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GovernanceConsoleApi.ListGovernanceControlDetections`:\n%s\n",responseContent)}
// List control detections returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.GovernanceConsoleApi;importcom.datadog.api.client.v2.model.GovernanceControlDetectionsResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listGovernanceControlDetections",true);GovernanceConsoleApiapiInstance=newGovernanceConsoleApi(defaultClient);try{GovernanceControlDetectionsResponseresult=apiInstance.listGovernanceControlDetections("unused_api_keys");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GovernanceConsoleApi#listGovernanceControlDetections");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// List control detections returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_governance_console::GovernanceConsoleAPI;usedatadog_api_client::datadogV2::api_governance_console::ListGovernanceControlDetectionsOptionalParams;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListGovernanceControlDetections",true);letapi=GovernanceConsoleAPI::with_config(configuration);letresp=api.list_governance_control_detections("detection_type".to_string(),ListGovernanceControlDetectionsOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* List control detections returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listGovernanceControlDetections"]=true;constapiInstance=newv2.GovernanceConsoleApi(configuration);constparams: v2.GovernanceConsoleApiListGovernanceControlDetectionsRequest={detectionType:"detection_type",};apiInstance.listGovernanceControlDetections(params).then((data: v2.GovernanceControlDetectionsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));