Triggers an asynchronous deployment gate evaluation for the given service and environment.
Returns an evaluation ID that can be used to poll for the result via the
GET /api/v2/deployments/gates/evaluation/{id} endpoint.
When the configuration attribute is provided, rules are evaluated inline from that configuration
and no pre-configured gate is required. When configuration is omitted, rules are resolved from the
gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
This endpoint requires the deployment_gates_evaluate permission.
Attributes for a deployment gate evaluation request.
When configuration is provided, rules are evaluated inline from that configuration.
When omitted, rules are resolved from the preconfigured gate for the given service and environment.
configuration
object
Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated
directly from this configuration instead of using the preconfigured gate rules.
At least one rule is required.
dry_run
boolean
Gate-level dry run. When enabled, the rules are evaluated normally but the gate always returns pass. The real result is visible in the Datadog UI.
rules [required]
[ <oneOf>]
The list of rules to evaluate. At least one rule is required.
Option 1
object
A monitor rule to evaluate as part of a deployment gate evaluation.
dry_run
boolean
Rule-level dry run. When enabled, the rule is evaluated normally but always returns pass. The real result is visible in the Datadog UI.
name [required]
string
Human-readable name for this rule.
options
object
Options for a monitor rule.
duration
int64
Evaluation window in seconds. Maximum 7200 (2 hours).
query [required]
string
Monitor search query.
type [required]
enum
The type identifier for a monitor rule.
Allowed enum values: monitor
Option 2
object
A faulty deployment detection rule to evaluate as part of a deployment gate evaluation.
dry_run
boolean
Rule-level dry run. When enabled, the rule is evaluated normally but it always returns pass. The real result is visible in the Datadog UI.
name [required]
string
Human-readable name for this rule.
options
object
Options for a faulty_deployment_detection rule.
duration
int64
Evaluation window in seconds. Maximum 7200 (2 hours).
excluded_resources
[string]
APM resource names to exclude from analysis.
type [required]
enum
The type identifier for a faulty deployment detection rule.
Allowed enum values: faulty_deployment_detection
env [required]
string
The environment of the deployment.
identifier
string
The identifier of the deployment gate. Defaults to "default".
default: default
primary_tag
string
A primary tag to scope APM Faulty Deployment Detection rules.
service [required]
string
The service being deployed.
version
string
The version of the deployment. Required for APM Faulty Deployment Detection rules.
type [required]
enum
JSON:API type for a deployment gate evaluation request.
Allowed enum values: deployment_gates_evaluation_request
// Trigger a deployment gates evaluation returns "Accepted" 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(){// there is a valid "deployment_gate" in the systemDeploymentGateDataAttributesIdentifier:=os.Getenv("DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER")body:=datadogV2.DeploymentGatesEvaluationRequest{Data:datadogV2.DeploymentGatesEvaluationRequestData{Attributes:datadogV2.DeploymentGatesEvaluationRequestAttributes{Env:"production",Identifier:datadog.PtrString(DeploymentGateDataAttributesIdentifier),Service:"my-service",},Type:datadogV2.DEPLOYMENTGATESEVALUATIONREQUESTDATATYPE_DEPLOYMENT_GATES_EVALUATION_REQUEST,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.TriggerDeploymentGatesEvaluation",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDeploymentGatesApi(apiClient)resp,r,err:=api.TriggerDeploymentGatesEvaluation(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DeploymentGatesApi.TriggerDeploymentGatesEvaluation`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DeploymentGatesApi.TriggerDeploymentGatesEvaluation`:\n%s\n",responseContent)}
// Trigger a deployment gates evaluation returns "Accepted" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DeploymentGatesApi;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationRequest;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestAttributes;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestData;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestDataType;importcom.datadog.api.client.v2.model.DeploymentGatesEvaluationResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.triggerDeploymentGatesEvaluation",true);DeploymentGatesApiapiInstance=newDeploymentGatesApi(defaultClient);// there is a valid "deployment_gate" in the systemStringDEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER=System.getenv("DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER");DeploymentGatesEvaluationRequestbody=newDeploymentGatesEvaluationRequest().data(newDeploymentGatesEvaluationRequestData().attributes(newDeploymentGatesEvaluationRequestAttributes().env("production").identifier(DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER).service("my-service")).type(DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST));try{DeploymentGatesEvaluationResponseresult=apiInstance.triggerDeploymentGatesEvaluation(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DeploymentGatesApi#triggerDeploymentGatesEvaluation");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Trigger a deployment gates evaluation returns "Accepted" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.deployment_gates_apiimportDeploymentGatesApifromdatadog_api_client.v2.model.deployment_gates_evaluation_requestimportDeploymentGatesEvaluationRequestfromdatadog_api_client.v2.model.deployment_gates_evaluation_request_attributesimport(DeploymentGatesEvaluationRequestAttributes,)fromdatadog_api_client.v2.model.deployment_gates_evaluation_request_dataimportDeploymentGatesEvaluationRequestDatafromdatadog_api_client.v2.model.deployment_gates_evaluation_request_data_typeimport(DeploymentGatesEvaluationRequestDataType,)# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER=environ["DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER"]body=DeploymentGatesEvaluationRequest(data=DeploymentGatesEvaluationRequestData(attributes=DeploymentGatesEvaluationRequestAttributes(env="production",identifier=DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER,service="my-service",),type=DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST,),)configuration=Configuration()configuration.unstable_operations["trigger_deployment_gates_evaluation"]=TruewithApiClient(configuration)asapi_client:api_instance=DeploymentGatesApi(api_client)response=api_instance.trigger_deployment_gates_evaluation(body=body)print(response)
# Trigger a deployment gates evaluation returns "Accepted" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.trigger_deployment_gates_evaluation".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DeploymentGatesAPI.new# there is a valid "deployment_gate" in the systemDEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER=ENV["DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER"]body=DatadogAPIClient::V2::DeploymentGatesEvaluationRequest.new({data:DatadogAPIClient::V2::DeploymentGatesEvaluationRequestData.new({attributes:DatadogAPIClient::V2::DeploymentGatesEvaluationRequestAttributes.new({env:"production",identifier:DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER,service:"my-service",}),type:DatadogAPIClient::V2::DeploymentGatesEvaluationRequestDataType::DEPLOYMENT_GATES_EVALUATION_REQUEST,}),})papi_instance.trigger_deployment_gates_evaluation(body)
// Trigger a deployment gates evaluation returns "Accepted" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_deployment_gates::DeploymentGatesAPI;usedatadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequest;usedatadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestAttributes;usedatadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestData;usedatadog_api_client::datadogV2::model::DeploymentGatesEvaluationRequestDataType;#[tokio::main]asyncfnmain(){// there is a valid "deployment_gate" in the system
letdeployment_gate_data_attributes_identifier=std::env::var("DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER").unwrap();letbody=DeploymentGatesEvaluationRequest::new(DeploymentGatesEvaluationRequestData::new(DeploymentGatesEvaluationRequestAttributes::new("production".to_string(),"my-service".to_string(),).identifier(deployment_gate_data_attributes_identifier.clone()),DeploymentGatesEvaluationRequestDataType::DEPLOYMENT_GATES_EVALUATION_REQUEST,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.TriggerDeploymentGatesEvaluation",true);letapi=DeploymentGatesAPI::with_config(configuration);letresp=api.trigger_deployment_gates_evaluation(body).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
/**
* Trigger a deployment gates evaluation returns "Accepted" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.triggerDeploymentGatesEvaluation"]=true;constapiInstance=newv2.DeploymentGatesApi(configuration);// there is a valid "deployment_gate" in the system
constDEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER=process.env.DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIERasstring;constparams: v2.DeploymentGatesApiTriggerDeploymentGatesEvaluationRequest={body:{data:{attributes:{env:"production",identifier: DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER,service:"my-service",},type:"deployment_gates_evaluation_request",},},};apiInstance.triggerDeploymentGatesEvaluation(params).then((data: v2.DeploymentGatesEvaluationResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));