Modifier un test Browser
https://api.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/browser/{public_id}https://api.ap1.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.ap2.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.uk1.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/browser/{public_id}https://api.us2.ddog-gov.com/api/v1/synthetics/tests/browser/{public_id}Présentation
Modifiez la configuration d'un test Browser Synthetic.
OAuth apps require the synthetics_write authorization scope to access this endpoint.
Arguments
Paramètres du chemin
public_id [required]The public ID of the test to edit.
Requête
Body Data (required)
Nouveaux détails du test à enregistrer.
config [required]Objet contenant les détails de votre test Browser Synthetic.
assertions [required]Array of assertions used for the test.
Object 1An assertion which uses a simple target.
operator [required]Assertion operator to apply.
contains, doesNotContain, is, isNot, lessThan, lessThanOrEqual, moreThan, moreThanOrEqual, matches, doesNotMatchShow 5 more
validates, isInMoreThan, isInLessThan, doesNotExist, isUndefinedpropertyThe associated assertion property.
target [required]Value used by the operator.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
timingsScopeTimings scope for response time assertions.
all, withoutDNStype [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 2An assertion which targets body hash.
operator [required]Assertion operator to apply.
md5, sha1, sha256target [required]Value used by the operator.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
type [required]Type of the assertion.
bodyHashObject 3An assertion for the validatesJSONPath operator.
operator [required]Assertion operator to apply.
validatesJSONPathpropertyThe associated assertion property.
targetComposed target for validatesJSONPath operator.
elementsOperatorThe element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.
jsonPathThe JSON path to assert.
operatorThe specific operator to use on the path.
targetValueThe path target value to compare to.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 4An assertion for the validatesJSONSchema operator.
operator [required]Assertion operator to apply.
validatesJSONSchematargetComposed target for validatesJSONSchema operator.
jsonSchemaThe JSON Schema to assert.
metaSchemaThe JSON Schema meta-schema version used in the assertion.
draft-07, draft-06type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 5An assertion for the validatesXPath operator.
operator [required]Assertion operator to apply.
validatesXPathpropertyThe associated assertion property.
targetComposed target for validatesXPath operator.
operatorThe specific operator to use on the path.
targetValueThe path target value to compare to.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
xPathThe X path to assert.
type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 6A JavaScript assertion.
code [required]The JavaScript code that performs the assertions.
type [required]Type of the assertion.
javascriptObject 7An assertion that checks that an MCP server advertises the expected capabilities.
operator [required]Assertion operator to apply.
contains, doesNotContain, is, isNot, lessThan, lessThanOrEqual, moreThan, moreThanOrEqual, matches, doesNotMatchShow 5 more
validates, isInMoreThan, isInLessThan, doesNotExist, isUndefinedtarget [required]List of MCP server capabilities to assert against.
type [required]Type of the assertion.
mcpServerCapabilitiesObject 8An assertion that verifies the MCP server response respects the MCP specification.
type [required]Type of the assertion.
mcpRespectsSpecificationconfigVariablesArray of variables used for the test.
exampleExample for the variable.
idID of the variable for global variables.
name [required]Name of the variable.
patternPattern of the variable.
secureWhether the value of this variable will be obfuscated in test results. Only for config variables of type text.
type [required]Type of the configuration variable.
global, text, emailrequest [required]Object describing the Synthetic test request.
allow_insecureAllows loading insecure content for an HTTP request in a multistep test step.
basicAuthObject to handle basic authentication when performing the test.
<type=web>Object to handle basic authentication when performing the test.
passwordPassword to use for the basic authentication.
typeThe type of basic authentication to use when performing the test.
webwebusernameUsername to use for the basic authentication.
<type=sigv4>Object to handle SIGV4 authentication when performing the test.
accessKey [required]Access key for the SIGV4 authentication.
regionRegion for the SIGV4 authentication.
secretKey [required]Secret key for the SIGV4 authentication.
serviceNameService name for the SIGV4 authentication.
sessionTokenSession token for the SIGV4 authentication.
type [required]The type of authentication to use when performing the test.
sigv4sigv4<type=ntlm>Object to handle NTLM authentication when performing the test.
domainDomain for the authentication to use when performing the test.
passwordPassword for the authentication to use when performing the test.
type [required]The type of authentication to use when performing the test.
ntlmntlmusernameUsername for the authentication to use when performing the test.
workstationWorkstation for the authentication to use when performing the test.
<type=digest>Object to handle digest authentication when performing the test.
password [required]Password to use for the digest authentication.
type [required]The type of basic authentication to use when performing the test.
digestdigestusername [required]Username to use for the digest authentication.
<type=oauth-client>Object to handle oauth client authentication when performing the test.
accessTokenUrl [required]Access token URL to use when performing the authentication.
audienceAudience to use when performing the authentication.
clientId [required]Client ID to use when performing the authentication.
clientSecret [required]Client secret to use when performing the authentication.
resourceResource to use when performing the authentication.
scopeScope to use when performing the authentication.
tokenApiAuthentication [required]Type of token to use when performing the authentication.
header, bodytype [required]The type of basic authentication to use when performing the test.
oauth-clientoauth-client<type=oauth-rop>Object to handle oauth rop authentication when performing the test.
accessTokenUrl [required]Access token URL to use when performing the authentication.
audienceAudience to use when performing the authentication.
clientIdClient ID to use when performing the authentication.
clientSecretClient secret to use when performing the authentication.
password [required]Password to use when performing the authentication.
resourceResource to use when performing the authentication.
scopeScope to use when performing the authentication.
tokenApiAuthentication [required]Type of token to use when performing the authentication.
header, bodytype [required]The type of basic authentication to use when performing the test.
oauth-ropoauth-ropusername [required]Username to use when performing the authentication.
<type=jwt>Object to handle JWT authentication when performing the test.
addClaimsStandard JWT claims to automatically inject.
expWhether to inject the exp (expiration) claim.
iatWhether to inject the iat (issued at) claim.
algorithm [required]Algorithm to use for the JWT authentication.
HS256, RS256, ES256expiresInToken time-to-live in seconds.
headerCustom JWT header as a JSON string.
payload [required]JWT claims as a JSON string.
secret [required]Signing key for the JWT authentication. Use the shared secret for HS256
or the private key (PEM format) for RS256 and ES256.
tokenPrefixPrefix added before the token in the Authorization header. Defaults to Bearer.
type [required]The type of authentication to use when performing the test.
jwtjwtbodyBody to include in the test.
bodyTypeType of the request body.
text/plain, application/json, text/xml, text/html, application/x-www-form-urlencoded, graphql, application/octet-stream, multipart/form-datacallTypeThe type of call to perform. Used by gRPC steps (healthcheck, unary)
and MCP steps (init, tool_list, tool_call). Valid values depend on
the parent step's subtype.
healthcheck, unary, init, tool_list, tool_callcertificateClient certificate to use when performing the test request.
certDefine a request certificate.
contentContent of the certificate or key.
filenameFile name for the certificate or key.
updatedAtDate of update of the certificate or key, ISO format.
keyDefine a request certificate.
contentContent of the certificate or key.
filenameFile name for the certificate or key.
updatedAtDate of update of the certificate or key, ISO format.
certificateDomainsBy default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.
checkCertificateRevocationCheck for certificate revocation.
compressedJsonDescriptorA protobuf JSON descriptor that needs to be gzipped first then base64 encoded.
compressedProtoFileA protobuf file that needs to be gzipped first then base64 encoded.
disableAiaIntermediateFetchingDisable fetching intermediate certificates from AIA.
dnsServerDNS server to use for DNS tests.
dnsServerPortDNS server port to use for DNS tests.
Object 1Integer DNS server port number to use when performing the test.
Object 2String DNS server port number to use when performing the test. Supports templated variables.
filesFiles to be used as part of the request in the test. Only valid if bodyType is multipart/form-data.
bucketKeyBucket key of the file.
contentContent of the file.
encodingEncoding of the file content. The only supported value is base64, indicating the content field contains base64-encoded data.
nameName of the file.
originalFileNameOriginal name of the file.
sizeSize of the file.
typeType of the file.
follow_redirectsSpecifies whether or not the request follows redirects.
formForm to be used as part of the request in the test. Only valid if bodyType is multipart/form-data.
<any-key>A single form entry.
headersHeaders to include when performing the test.
<any-key>A single Header.
hostHost name to perform the test with.
httpVersionHTTP version to use for a Synthetic test.
http1, http2, anyignore_certificate_validationFor SSL tests, whether the test should ignore certificate validation.
isMessageBase64EncodedWhether the message is base64 encoded.
mcpProtocolVersionThe MCP protocol version used by the step. See https://modelcontextprotocol.io/specification.
2025-06-18messageMessage to send for UDP or WebSocket tests.
metadataMetadata to include when performing the gRPC test.
<any-key>A single metadatum.
methodEither the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.
noSavingResponseBodyDetermines whether or not to save the response body.
numberOfPacketsNumber of pings to use per test.
persistCookiesPersist cookies across redirects.
portPort to use when performing the test.
Object 1Integer Port number to use when performing the test.
Object 2String Port number to use when performing the test. Supports templated variables.
proxyThe proxy to perform the test.
headersHeaders to include when performing the test.
<any-key>A single Header.
url [required]URL of the proxy to perform the test.
queryQuery to use for the test.
servernameFor SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.
serviceThe gRPC service on which you want to perform the gRPC call.
shouldTrackHopsTurns on a traceroute probe to discover all gateways along the path to the host destination.
timeoutTimeout in seconds for the test.
toolArgsArguments to pass to the MCP tool. Free-form object whose shape depends on the tool. Used when callType is tool_call.
toolNameThe name of the MCP tool to call. Required when callType is tool_call.
urlURL to perform the test with.
variablesArray of variables used for the test steps.
exampleExample for the variable.
idID for the variable. Global variables require an ID.
name [required]Name of the variable.
patternPattern of the variable.
secureDetermines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.
type [required]Type of browser test variable.
element, email, global, textlocations [required]Array of locations used to run the test.
message [required]Notification message associated with the test. Message can either be text or an empty string.
name [required]Name of the test.
options [required]Object describing the extra options for a Synthetic test.
accept_self_signedFor SSL tests, whether or not the test should allow self signed certificates.
allow_insecureAllows loading insecure content for an HTTP request in an API test.
bits_ai_auto_investigateWhether Bits AI automatically investigates alerts from the test monitor.
blockedRequestPatternsArray of URL patterns to block.
captureNetworkPayloadsCapture HTTP request/response headers and bodies for Fetch/XHR calls made during browser tests.
checkCertificateRevocationFor SSL tests, whether or not the test should fail on revoked certificate in stapled OCSP.
ciCI/CD options for a Synthetic test.
executionRule [required]Execution rule for a Synthetic test.
blocking, non_blocking, skippeddevice_idsFor browser test, array with the different device IDs used to run the test.
disableAiaIntermediateFetchingFor SSL tests, whether or not the test should disable fetching intermediate certificates from AIA.
disableCorsWhether or not to disable CORS mechanism.
disableCspDisable Content Security Policy for browser tests.
enableProfilingEnable profiling for browser tests.
enableSecurityTestingDEPRECATED Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.
follow_redirectsFor API HTTP test, whether or not the test should follow redirects.
httpVersionHTTP version to use for a Synthetic test.
http1, http2, anyignoreServerCertificateErrorIgnore server certificate error for browser tests.
ignore_certificate_validationFor SSL tests, whether the test should ignore certificate validation.
initialNavigationTimeoutTimeout before declaring the initial step as failed (in seconds) for browser tests.
min_failure_durationMinimum amount of time in failure required to trigger an alert.
min_location_failedMinimum number of locations in failure required to trigger an alert.
monitor_nameThe monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.
monitor_optionsObject containing the options for a Synthetic test as a monitor (for example, renotification).
escalation_messageMessage to include in the escalation notification.
notification_preset_nameThe name of the preset for the notification for the monitor.
show_all, hide_all, hide_query, hide_handles, hide_query_and_handles, show_only_snapshot, hide_handles_and_footerrenotify_intervalTime interval before renotifying if the test is still failing (in minutes).
renotify_occurrencesThe number of times to renotify if the test is still failing.
monitor_priorityInteger from 1 (high) to 5 (low) indicating alert severity.
noScreenshotPrevents saving screenshots of the steps.
restricted_rolesDEPRECATED A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions.
retryObject describing the retry strategy to apply to a Synthetic test.
countNumber of times a test needs to be retried before marking a location as failed. Defaults to 0.
intervalTime interval between retries (in milliseconds). Defaults to 300ms.
rumSettingsThe RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:
{ isEnabled: false }
RUM data is not collected.
{ isEnabled: true }
RUM data is collected from the Synthetic test's default application.
{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 }
RUM data is collected using the specified application.
applicationIdRUM application ID used to collect RUM data for the browser test.
clientTokenIdRUM application API key ID used to collect RUM data for the browser test.
isEnabled [required]Determines whether RUM data is collected during test runs.
schedulingObject containing timeframes and timezone used for advanced scheduling.
timeframes [required]Array containing objects describing the scheduling pattern to apply to each day.
day [required]Number representing the day of the week.
from [required]The hour of the day on which scheduling starts.
to [required]The hour of the day on which scheduling ends.
timezone [required]Timezone in which the timeframe is based.
tick_everyThe frequency at which to run the Synthetic test (in seconds).
statusDefine whether you want to start (live) or pause (paused) a
Synthetic test.
live, pausedstepsArray of steps for the test.
allowFailureA boolean set to allow this step to fail.
alwaysExecuteA boolean set to always execute this step even if the previous step failed or was skipped.
exitIfSucceedA boolean set to exit the test if the step succeeds.
isCriticalA boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.
nameThe name of the step.
noScreenshotA boolean set to skip taking a screenshot for the step.
paramsThe parameters of the step.
public_idThe public ID of the step.
timeoutThe time before declaring a step failed.
typeStep type used in your Synthetic test.
assertCurrentUrl, assertElementAttribute, assertElementContent, assertElementPresent, assertEmail, assertFileDownload, assertFromJavascript, assertPageContains, assertPageLacks, assertRequestsShow 19 more
click, drag, drop, extractFromJavascript, extractFromEmailBody, extractVariable, goToEmailLink, goToUrl, goToUrlAndMeasureTti, hover, playSubTest, pressKey, refresh, runApiTest, scroll, selectOption, typeText, uploadFiles, waittagsArray of tags attached to the test.
type [required]Type of the Synthetic test, browser.
browserbrowser{
"config": {
"assertions": [
{
"operator": "contains",
"property": "string",
"target": 0,
"timingsScope": "string",
"type": "statusCode"
}
],
"configVariables": [
{
"example": "string",
"id": "string",
"name": "VARIABLE_NAME",
"pattern": "string",
"secure": false,
"type": "text"
}
],
"request": {
"allow_insecure": false,
"basicAuth": {
"password": "PaSSw0RD!",
"type": "web",
"username": "my_username"
},
"body": "string",
"bodyType": "text/plain",
"callType": "unary",
"certificate": {
"cert": {
"content": "string",
"filename": "string",
"updatedAt": "string"
},
"key": {
"content": "string",
"filename": "string",
"updatedAt": "string"
}
},
"certificateDomains": [],
"checkCertificateRevocation": false,
"compressedJsonDescriptor": "string",
"compressedProtoFile": "string",
"disableAiaIntermediateFetching": false,
"dnsServer": "string",
"dnsServerPort": {
"description": "undefined",
"format": "undefined",
"type": "undefined"
},
"files": [
{
"bucketKey": "string",
"content": "string",
"encoding": "string",
"name": "string",
"originalFileName": "string",
"size": "integer",
"type": "string"
}
],
"follow_redirects": false,
"form": {
"<any-key>": "string"
},
"headers": {
"<any-key>": "string"
},
"host": "string",
"httpVersion": "string",
"ignore_certificate_validation": false,
"isMessageBase64Encoded": false,
"mcpProtocolVersion": "2025-06-18",
"message": "string",
"metadata": {
"<any-key>": "string"
},
"method": "string",
"noSavingResponseBody": false,
"numberOfPackets": "integer",
"persistCookies": false,
"port": {
"description": "undefined",
"format": "undefined",
"type": "undefined"
},
"proxy": {
"headers": {
"<any-key>": "string"
},
"url": "https://example.com"
},
"query": {},
"servername": "string",
"service": "Greeter",
"shouldTrackHops": false,
"timeout": "number",
"toolArgs": {},
"toolName": "search",
"url": "https://example.com"
},
"setCookie": "string",
"variables": [
{
"example": "string",
"id": "string",
"name": "VARIABLE_NAME",
"pattern": "string",
"secure": false,
"type": "text"
}
]
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example test name",
"options": {
"accept_self_signed": false,
"allow_insecure": false,
"bits_ai_auto_investigate": false,
"blockedRequestPatterns": [],
"captureNetworkPayloads": false,
"checkCertificateRevocation": false,
"ci": {
"executionRule": "blocking"
},
"device_ids": [
"chrome.laptop_large"
],
"disableAiaIntermediateFetching": false,
"disableCors": false,
"disableCsp": false,
"enableProfiling": false,
"enableSecurityTesting": false,
"follow_redirects": false,
"httpVersion": "string",
"ignoreServerCertificateError": false,
"ignore_certificate_validation": false,
"initialNavigationTimeout": "integer",
"min_failure_duration": "integer",
"min_location_failed": "integer",
"monitor_name": "string",
"monitor_options": {
"escalation_message": "string",
"notification_preset_name": "string",
"renotify_interval": "integer",
"renotify_occurrences": "integer"
},
"monitor_priority": "integer",
"noScreenshot": false,
"restricted_roles": [
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
],
"retry": {
"count": "integer",
"interval": "number"
},
"rumSettings": {
"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"clientTokenId": 12345,
"isEnabled": true
},
"scheduling": {
"timeframes": [
{
"day": 1,
"from": "07:00",
"to": "16:00"
}
],
"timezone": "America/New_York"
},
"tick_every": "integer"
},
"status": "live",
"steps": [
{
"allowFailure": false,
"alwaysExecute": false,
"exitIfSucceed": false,
"isCritical": false,
"name": "string",
"noScreenshot": false,
"params": {},
"public_id": "string",
"timeout": "integer",
"type": "assertElementContent"
}
],
"tags": [
"env:prod"
],
"type": "browser"
}Réponse
OK
Object containing details about a Synthetic browser test.
config [required]Configuration object for a Synthetic browser test.
assertions [required]Array of assertions used for the test.
Object 1An assertion which uses a simple target.
operator [required]Assertion operator to apply.
contains, doesNotContain, is, isNot, lessThan, lessThanOrEqual, moreThan, moreThanOrEqual, matches, doesNotMatchShow 5 more
validates, isInMoreThan, isInLessThan, doesNotExist, isUndefinedpropertyThe associated assertion property.
target [required]Value used by the operator.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
timingsScopeTimings scope for response time assertions.
all, withoutDNStype [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 2An assertion which targets body hash.
operator [required]Assertion operator to apply.
md5, sha1, sha256target [required]Value used by the operator.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
type [required]Type of the assertion.
bodyHashObject 3An assertion for the validatesJSONPath operator.
operator [required]Assertion operator to apply.
validatesJSONPathpropertyThe associated assertion property.
targetComposed target for validatesJSONPath operator.
elementsOperatorThe element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.
jsonPathThe JSON path to assert.
operatorThe specific operator to use on the path.
targetValueThe path target value to compare to.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 4An assertion for the validatesJSONSchema operator.
operator [required]Assertion operator to apply.
validatesJSONSchematargetComposed target for validatesJSONSchema operator.
jsonSchemaThe JSON Schema to assert.
metaSchemaThe JSON Schema meta-schema version used in the assertion.
draft-07, draft-06type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 5An assertion for the validatesXPath operator.
operator [required]Assertion operator to apply.
validatesXPathpropertyThe associated assertion property.
targetComposed target for validatesXPath operator.
operatorThe specific operator to use on the path.
targetValueThe path target value to compare to.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
xPathThe X path to assert.
type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 6A JavaScript assertion.
code [required]The JavaScript code that performs the assertions.
type [required]Type of the assertion.
javascriptObject 7An assertion that checks that an MCP server advertises the expected capabilities.
operator [required]Assertion operator to apply.
contains, doesNotContain, is, isNot, lessThan, lessThanOrEqual, moreThan, moreThanOrEqual, matches, doesNotMatchShow 5 more
validates, isInMoreThan, isInLessThan, doesNotExist, isUndefinedtarget [required]List of MCP server capabilities to assert against.
type [required]Type of the assertion.
mcpServerCapabilitiesObject 8An assertion that verifies the MCP server response respects the MCP specification.
type [required]Type of the assertion.
mcpRespectsSpecificationconfigVariablesArray of variables used for the test.
exampleExample for the variable.
idID of the variable for global variables.
name [required]Name of the variable.
patternPattern of the variable.
secureWhether the value of this variable will be obfuscated in test results. Only for config variables of type text.
type [required]Type of the configuration variable.
global, text, emailrequest [required]Object describing the Synthetic test request.
allow_insecureAllows loading insecure content for an HTTP request in a multistep test step.
basicAuthObject to handle basic authentication when performing the test.
<type=web>Object to handle basic authentication when performing the test.
passwordPassword to use for the basic authentication.
typeThe type of basic authentication to use when performing the test.
webwebusernameUsername to use for the basic authentication.
<type=sigv4>Object to handle SIGV4 authentication when performing the test.
accessKey [required]Access key for the SIGV4 authentication.
regionRegion for the SIGV4 authentication.
secretKey [required]Secret key for the SIGV4 authentication.
serviceNameService name for the SIGV4 authentication.
sessionTokenSession token for the SIGV4 authentication.
type [required]The type of authentication to use when performing the test.
sigv4sigv4<type=ntlm>Object to handle NTLM authentication when performing the test.
domainDomain for the authentication to use when performing the test.
passwordPassword for the authentication to use when performing the test.
type [required]The type of authentication to use when performing the test.
ntlmntlmusernameUsername for the authentication to use when performing the test.
workstationWorkstation for the authentication to use when performing the test.
<type=digest>Object to handle digest authentication when performing the test.
password [required]Password to use for the digest authentication.
type [required]The type of basic authentication to use when performing the test.
digestdigestusername [required]Username to use for the digest authentication.
<type=oauth-client>Object to handle oauth client authentication when performing the test.
accessTokenUrl [required]Access token URL to use when performing the authentication.
audienceAudience to use when performing the authentication.
clientId [required]Client ID to use when performing the authentication.
clientSecret [required]Client secret to use when performing the authentication.
resourceResource to use when performing the authentication.
scopeScope to use when performing the authentication.
tokenApiAuthentication [required]Type of token to use when performing the authentication.
header, bodytype [required]The type of basic authentication to use when performing the test.
oauth-clientoauth-client<type=oauth-rop>Object to handle oauth rop authentication when performing the test.
accessTokenUrl [required]Access token URL to use when performing the authentication.
audienceAudience to use when performing the authentication.
clientIdClient ID to use when performing the authentication.
clientSecretClient secret to use when performing the authentication.
password [required]Password to use when performing the authentication.
resourceResource to use when performing the authentication.
scopeScope to use when performing the authentication.
tokenApiAuthentication [required]Type of token to use when performing the authentication.
header, bodytype [required]The type of basic authentication to use when performing the test.
oauth-ropoauth-ropusername [required]Username to use when performing the authentication.
<type=jwt>Object to handle JWT authentication when performing the test.
addClaimsStandard JWT claims to automatically inject.
expWhether to inject the exp (expiration) claim.
iatWhether to inject the iat (issued at) claim.
algorithm [required]Algorithm to use for the JWT authentication.
HS256, RS256, ES256expiresInToken time-to-live in seconds.
headerCustom JWT header as a JSON string.
payload [required]JWT claims as a JSON string.
secret [required]Signing key for the JWT authentication. Use the shared secret for HS256
or the private key (PEM format) for RS256 and ES256.
tokenPrefixPrefix added before the token in the Authorization header. Defaults to Bearer.
type [required]The type of authentication to use when performing the test.
jwtjwtbodyBody to include in the test.
bodyTypeType of the request body.
text/plain, application/json, text/xml, text/html, application/x-www-form-urlencoded, graphql, application/octet-stream, multipart/form-datacallTypeThe type of call to perform. Used by gRPC steps (healthcheck, unary)
and MCP steps (init, tool_list, tool_call). Valid values depend on
the parent step's subtype.
healthcheck, unary, init, tool_list, tool_callcertificateClient certificate to use when performing the test request.
certDefine a request certificate.
contentContent of the certificate or key.
filenameFile name for the certificate or key.
updatedAtDate of update of the certificate or key, ISO format.
keyDefine a request certificate.
contentContent of the certificate or key.
filenameFile name for the certificate or key.
updatedAtDate of update of the certificate or key, ISO format.
certificateDomainsBy default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.
checkCertificateRevocationCheck for certificate revocation.
compressedJsonDescriptorA protobuf JSON descriptor that needs to be gzipped first then base64 encoded.
compressedProtoFileA protobuf file that needs to be gzipped first then base64 encoded.
disableAiaIntermediateFetchingDisable fetching intermediate certificates from AIA.
dnsServerDNS server to use for DNS tests.
dnsServerPortDNS server port to use for DNS tests.
Object 1Integer DNS server port number to use when performing the test.
Object 2String DNS server port number to use when performing the test. Supports templated variables.
filesFiles to be used as part of the request in the test. Only valid if bodyType is multipart/form-data.
bucketKeyBucket key of the file.
contentContent of the file.
encodingEncoding of the file content. The only supported value is base64, indicating the content field contains base64-encoded data.
nameName of the file.
originalFileNameOriginal name of the file.
sizeSize of the file.
typeType of the file.
follow_redirectsSpecifies whether or not the request follows redirects.
formForm to be used as part of the request in the test. Only valid if bodyType is multipart/form-data.
<any-key>A single form entry.
headersHeaders to include when performing the test.
<any-key>A single Header.
hostHost name to perform the test with.
httpVersionHTTP version to use for a Synthetic test.
http1, http2, anyignore_certificate_validationFor SSL tests, whether the test should ignore certificate validation.
isMessageBase64EncodedWhether the message is base64 encoded.
mcpProtocolVersionThe MCP protocol version used by the step. See https://modelcontextprotocol.io/specification.
2025-06-18messageMessage to send for UDP or WebSocket tests.
metadataMetadata to include when performing the gRPC test.
<any-key>A single metadatum.
methodEither the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.
noSavingResponseBodyDetermines whether or not to save the response body.
numberOfPacketsNumber of pings to use per test.
persistCookiesPersist cookies across redirects.
portPort to use when performing the test.
Object 1Integer Port number to use when performing the test.
Object 2String Port number to use when performing the test. Supports templated variables.
proxyThe proxy to perform the test.
headersHeaders to include when performing the test.
<any-key>A single Header.
url [required]URL of the proxy to perform the test.
queryQuery to use for the test.
servernameFor SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.
serviceThe gRPC service on which you want to perform the gRPC call.
shouldTrackHopsTurns on a traceroute probe to discover all gateways along the path to the host destination.
timeoutTimeout in seconds for the test.
toolArgsArguments to pass to the MCP tool. Free-form object whose shape depends on the tool. Used when callType is tool_call.
toolNameThe name of the MCP tool to call. Required when callType is tool_call.
urlURL to perform the test with.
variablesArray of variables used for the test steps.
exampleExample for the variable.
idID for the variable. Global variables require an ID.
name [required]Name of the variable.
patternPattern of the variable.
secureDetermines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.
type [required]Type of browser test variable.
element, email, global, textlocations [required]Array of locations used to run the test.
message [required]Notification message associated with the test. Message can either be text or an empty string.
monitor_idThe associated monitor ID.
name [required]Name of the test.
options [required]Object describing the extra options for a Synthetic test.
accept_self_signedFor SSL tests, whether or not the test should allow self signed certificates.
allow_insecureAllows loading insecure content for an HTTP request in an API test.
bits_ai_auto_investigateWhether Bits AI automatically investigates alerts from the test monitor.
blockedRequestPatternsArray of URL patterns to block.
captureNetworkPayloadsCapture HTTP request/response headers and bodies for Fetch/XHR calls made during browser tests.
checkCertificateRevocationFor SSL tests, whether or not the test should fail on revoked certificate in stapled OCSP.
ciCI/CD options for a Synthetic test.
executionRule [required]Execution rule for a Synthetic test.
blocking, non_blocking, skippeddevice_idsFor browser test, array with the different device IDs used to run the test.
disableAiaIntermediateFetchingFor SSL tests, whether or not the test should disable fetching intermediate certificates from AIA.
disableCorsWhether or not to disable CORS mechanism.
disableCspDisable Content Security Policy for browser tests.
enableProfilingEnable profiling for browser tests.
enableSecurityTestingDEPRECATED Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.
follow_redirectsFor API HTTP test, whether or not the test should follow redirects.
httpVersionHTTP version to use for a Synthetic test.
http1, http2, anyignoreServerCertificateErrorIgnore server certificate error for browser tests.
ignore_certificate_validationFor SSL tests, whether the test should ignore certificate validation.
initialNavigationTimeoutTimeout before declaring the initial step as failed (in seconds) for browser tests.
min_failure_durationMinimum amount of time in failure required to trigger an alert.
min_location_failedMinimum number of locations in failure required to trigger an alert.
monitor_nameThe monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.
monitor_optionsObject containing the options for a Synthetic test as a monitor (for example, renotification).
escalation_messageMessage to include in the escalation notification.
notification_preset_nameThe name of the preset for the notification for the monitor.
show_all, hide_all, hide_query, hide_handles, hide_query_and_handles, show_only_snapshot, hide_handles_and_footerrenotify_intervalTime interval before renotifying if the test is still failing (in minutes).
renotify_occurrencesThe number of times to renotify if the test is still failing.
monitor_priorityInteger from 1 (high) to 5 (low) indicating alert severity.
noScreenshotPrevents saving screenshots of the steps.
restricted_rolesDEPRECATED A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions.
retryObject describing the retry strategy to apply to a Synthetic test.
countNumber of times a test needs to be retried before marking a location as failed. Defaults to 0.
intervalTime interval between retries (in milliseconds). Defaults to 300ms.
rumSettingsThe RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:
{ isEnabled: false }
RUM data is not collected.
{ isEnabled: true }
RUM data is collected from the Synthetic test's default application.
{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 }
RUM data is collected using the specified application.
applicationIdRUM application ID used to collect RUM data for the browser test.
clientTokenIdRUM application API key ID used to collect RUM data for the browser test.
isEnabled [required]Determines whether RUM data is collected during test runs.
schedulingObject containing timeframes and timezone used for advanced scheduling.
timeframes [required]Array containing objects describing the scheduling pattern to apply to each day.
day [required]Number representing the day of the week.
from [required]The hour of the day on which scheduling starts.
to [required]The hour of the day on which scheduling ends.
timezone [required]Timezone in which the timeframe is based.
tick_everyThe frequency at which to run the Synthetic test (in seconds).
public_idThe public ID of the test.
statusDefine whether you want to start (live) or pause (paused) a
Synthetic test.
live, pausedstepsArray of steps for the test.
allowFailureA boolean set to allow this step to fail.
alwaysExecuteA boolean set to always execute this step even if the previous step failed or was skipped.
exitIfSucceedA boolean set to exit the test if the step succeeds.
isCriticalA boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.
nameThe name of the step.
noScreenshotA boolean set to skip taking a screenshot for the step.
paramsThe parameters of the step.
public_idThe public ID of the step.
timeoutThe time before declaring a step failed.
typeStep type used in your Synthetic test.
assertCurrentUrl, assertElementAttribute, assertElementContent, assertElementPresent, assertEmail, assertFileDownload, assertFromJavascript, assertPageContains, assertPageLacks, assertRequestsShow 19 more
click, drag, drop, extractFromJavascript, extractFromEmailBody, extractVariable, goToEmailLink, goToUrl, goToUrlAndMeasureTti, hover, playSubTest, pressKey, refresh, runApiTest, scroll, selectOption, typeText, uploadFiles, waittagsArray of tags attached to the test.
type [required]Type of the Synthetic test, browser.
browserbrowser{
"config": {
"assertions": [
{
"operator": "contains",
"property": "string",
"target": 0,
"timingsScope": "string",
"type": "statusCode"
}
],
"configVariables": [
{
"example": "string",
"id": "string",
"name": "VARIABLE_NAME",
"pattern": "string",
"secure": false,
"type": "text"
}
],
"request": {
"allow_insecure": false,
"basicAuth": {
"password": "PaSSw0RD!",
"type": "web",
"username": "my_username"
},
"body": "string",
"bodyType": "text/plain",
"callType": "unary",
"certificate": {
"cert": {
"content": "string",
"filename": "string",
"updatedAt": "string"
},
"key": {
"content": "string",
"filename": "string",
"updatedAt": "string"
}
},
"certificateDomains": [],
"checkCertificateRevocation": false,
"compressedJsonDescriptor": "string",
"compressedProtoFile": "string",
"disableAiaIntermediateFetching": false,
"dnsServer": "string",
"dnsServerPort": {
"description": "undefined",
"format": "undefined",
"type": "undefined"
},
"files": [
{
"bucketKey": "string",
"content": "string",
"encoding": "string",
"name": "string",
"originalFileName": "string",
"size": "integer",
"type": "string"
}
],
"follow_redirects": false,
"form": {
"<any-key>": "string"
},
"headers": {
"<any-key>": "string"
},
"host": "string",
"httpVersion": "string",
"ignore_certificate_validation": false,
"isMessageBase64Encoded": false,
"mcpProtocolVersion": "2025-06-18",
"message": "string",
"metadata": {
"<any-key>": "string"
},
"method": "string",
"noSavingResponseBody": false,
"numberOfPackets": "integer",
"persistCookies": false,
"port": {
"description": "undefined",
"format": "undefined",
"type": "undefined"
},
"proxy": {
"headers": {
"<any-key>": "string"
},
"url": "https://example.com"
},
"query": {},
"servername": "string",
"service": "Greeter",
"shouldTrackHops": false,
"timeout": "number",
"toolArgs": {},
"toolName": "search",
"url": "https://example.com"
},
"setCookie": "string",
"variables": [
{
"example": "string",
"id": "string",
"name": "VARIABLE_NAME",
"pattern": "string",
"secure": false,
"type": "text"
}
]
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"monitor_id": "integer",
"name": "Example test name",
"options": {
"accept_self_signed": false,
"allow_insecure": false,
"bits_ai_auto_investigate": false,
"blockedRequestPatterns": [],
"captureNetworkPayloads": false,
"checkCertificateRevocation": false,
"ci": {
"executionRule": "blocking"
},
"device_ids": [
"chrome.laptop_large"
],
"disableAiaIntermediateFetching": false,
"disableCors": false,
"disableCsp": false,
"enableProfiling": false,
"enableSecurityTesting": false,
"follow_redirects": false,
"httpVersion": "string",
"ignoreServerCertificateError": false,
"ignore_certificate_validation": false,
"initialNavigationTimeout": "integer",
"min_failure_duration": "integer",
"min_location_failed": "integer",
"monitor_name": "string",
"monitor_options": {
"escalation_message": "string",
"notification_preset_name": "string",
"renotify_interval": "integer",
"renotify_occurrences": "integer"
},
"monitor_priority": "integer",
"noScreenshot": false,
"restricted_roles": [
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
],
"retry": {
"count": "integer",
"interval": "number"
},
"rumSettings": {
"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"clientTokenId": 12345,
"isEnabled": true
},
"scheduling": {
"timeframes": [
{
"day": 1,
"from": "07:00",
"to": "16:00"
}
],
"timezone": "America/New_York"
},
"tick_every": "integer"
},
"public_id": "string",
"status": "live",
"steps": [
{
"allowFailure": false,
"alwaysExecute": false,
"exitIfSucceed": false,
"isCritical": false,
"name": "string",
"noScreenshot": false,
"params": {},
"public_id": "string",
"timeout": "integer",
"type": "assertElementContent"
}
],
"tags": [
"env:prod"
],
"type": "browser"
}- JSON format is wrong - Updating sub-type is forbidden
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Forbidden
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}- Synthetic Monitoring is not activated for the user - Test is not owned by the user - Test can't be found
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Too many requests
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Exemple de code
# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF# Path parameters
export public_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/synthetics/tests/browser/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"config": {
"assertions": [],
"request": {
"method": "GET",
"url": "https://example.com"
}
},
"locations": [
"aws:eu-west-3"
],
"message": "",
"name": "Example browser test",
"options": {
"device_ids": [
"chrome.laptop_large"
],
"tick_every": 3600
},
"status": "live",
"steps": [
{
"name": "Check current URL",
"params": {
"check": "contains",
"value": "example"
},
"type": "assertCurrentUrl"
}
],
"tags": [
"env:production"
],
"type": "browser"
}
EOF// Edit a browser test returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
body := datadogV1.SyntheticsBrowserTest{
Config: datadogV1.SyntheticsBrowserTestConfig{
Assertions: []datadogV1.SyntheticsAssertion{},
ConfigVariables: []datadogV1.SyntheticsConfigVariable{
{
Name: "VARIABLE_NAME",
Secure: datadog.PtrBool(false),
Type: datadogV1.SYNTHETICSCONFIGVARIABLETYPE_TEXT,
},
},
Request: datadogV1.SyntheticsTestRequest{
BasicAuth: &datadogV1.SyntheticsBasicAuth{
SyntheticsBasicAuthWeb: &datadogV1.SyntheticsBasicAuthWeb{
Password: datadog.PtrString("PaSSw0RD!"),
Type: datadogV1.SYNTHETICSBASICAUTHWEBTYPE_WEB.Ptr(),
Username: datadog.PtrString("my_username"),
}},
BodyType: datadogV1.SYNTHETICSTESTREQUESTBODYTYPE_TEXT_PLAIN.Ptr(),
CallType: datadogV1.SYNTHETICSTESTCALLTYPE_UNARY.Ptr(),
Certificate: &datadogV1.SyntheticsTestRequestCertificate{
Cert: &datadogV1.SyntheticsTestRequestCertificateItem{},
Key: &datadogV1.SyntheticsTestRequestCertificateItem{},
},
CertificateDomains: []string{},
Files: []datadogV1.SyntheticsTestRequestBodyFile{
{},
},
HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1.Ptr(),
McpProtocolVersion: datadogV1.SYNTHETICSMCPPROTOCOLVERSION_VERSION_2025_06_18.Ptr(),
Proxy: &datadogV1.SyntheticsTestRequestProxy{
Url: "https://example.com",
},
Service: datadog.PtrString("Greeter"),
ToolName: datadog.PtrString("search"),
Url: datadog.PtrString("https://example.com"),
},
Variables: []datadogV1.SyntheticsBrowserVariable{
{
Name: "VARIABLE_NAME",
Type: datadogV1.SYNTHETICSBROWSERVARIABLETYPE_TEXT,
},
},
},
Locations: []string{
"aws:eu-west-3",
},
Message: "",
Name: "Example test name",
Options: datadogV1.SyntheticsTestOptions{
BlockedRequestPatterns: []string{},
Ci: &datadogV1.SyntheticsTestCiOptions{
ExecutionRule: datadogV1.SYNTHETICSTESTEXECUTIONRULE_BLOCKING,
},
DeviceIds: []string{
"chrome.laptop_large",
},
HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1.Ptr(),
MonitorOptions: &datadogV1.SyntheticsTestOptionsMonitorOptions{
NotificationPresetName: datadogV1.SYNTHETICSTESTOPTIONSMONITOROPTIONSNOTIFICATIONPRESETNAME_SHOW_ALL.Ptr(),
},
RestrictedRoles: []string{
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
},
Retry: &datadogV1.SyntheticsTestOptionsRetry{},
RumSettings: &datadogV1.SyntheticsBrowserTestRumSettings{
ApplicationId: datadog.PtrString("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
ClientTokenId: datadog.PtrInt64(12345),
IsEnabled: true,
},
Scheduling: &datadogV1.SyntheticsTestOptionsScheduling{
Timeframes: []datadogV1.SyntheticsTestOptionsSchedulingTimeframe{
{
Day: 1,
From: "07:00",
To: "16:00",
},
{
Day: 3,
From: "07:00",
To: "16:00",
},
},
Timezone: "America/New_York",
},
},
Status: datadogV1.SYNTHETICSTESTPAUSESTATUS_LIVE.Ptr(),
Steps: []datadogV1.SyntheticsStep{
{
Type: datadogV1.SYNTHETICSSTEPTYPE_ASSERT_ELEMENT_CONTENT.Ptr(),
},
},
Tags: []string{
"env:prod",
},
Type: datadogV1.SYNTHETICSBROWSERTESTTYPE_BROWSER,
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewSyntheticsApi(apiClient)
resp, r, err := api.UpdateBrowserTest(ctx, "public_id", body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.UpdateBrowserTest`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.UpdateBrowserTest`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Edit a browser test returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.SyntheticsApi;
import com.datadog.api.client.v1.model.SyntheticsBasicAuth;
import com.datadog.api.client.v1.model.SyntheticsBasicAuthWeb;
import com.datadog.api.client.v1.model.SyntheticsBasicAuthWebType;
import com.datadog.api.client.v1.model.SyntheticsBrowserTest;
import com.datadog.api.client.v1.model.SyntheticsBrowserTestConfig;
import com.datadog.api.client.v1.model.SyntheticsBrowserTestRumSettings;
import com.datadog.api.client.v1.model.SyntheticsBrowserTestType;
import com.datadog.api.client.v1.model.SyntheticsBrowserVariable;
import com.datadog.api.client.v1.model.SyntheticsBrowserVariableType;
import com.datadog.api.client.v1.model.SyntheticsConfigVariable;
import com.datadog.api.client.v1.model.SyntheticsConfigVariableType;
import com.datadog.api.client.v1.model.SyntheticsMCPProtocolVersion;
import com.datadog.api.client.v1.model.SyntheticsStep;
import com.datadog.api.client.v1.model.SyntheticsStepType;
import com.datadog.api.client.v1.model.SyntheticsTestCallType;
import com.datadog.api.client.v1.model.SyntheticsTestCiOptions;
import com.datadog.api.client.v1.model.SyntheticsTestExecutionRule;
import com.datadog.api.client.v1.model.SyntheticsTestOptions;
import com.datadog.api.client.v1.model.SyntheticsTestOptionsHTTPVersion;
import com.datadog.api.client.v1.model.SyntheticsTestOptionsMonitorOptions;
import com.datadog.api.client.v1.model.SyntheticsTestOptionsMonitorOptionsNotificationPresetName;
import com.datadog.api.client.v1.model.SyntheticsTestOptionsRetry;
import com.datadog.api.client.v1.model.SyntheticsTestOptionsScheduling;
import com.datadog.api.client.v1.model.SyntheticsTestOptionsSchedulingTimeframe;
import com.datadog.api.client.v1.model.SyntheticsTestPauseStatus;
import com.datadog.api.client.v1.model.SyntheticsTestRequest;
import com.datadog.api.client.v1.model.SyntheticsTestRequestBodyFile;
import com.datadog.api.client.v1.model.SyntheticsTestRequestBodyType;
import com.datadog.api.client.v1.model.SyntheticsTestRequestCertificate;
import com.datadog.api.client.v1.model.SyntheticsTestRequestCertificateItem;
import com.datadog.api.client.v1.model.SyntheticsTestRequestProxy;
import java.util.Arrays;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
SyntheticsApi apiInstance = new SyntheticsApi(defaultClient);
SyntheticsBrowserTest body =
new SyntheticsBrowserTest()
.config(
new SyntheticsBrowserTestConfig()
.configVariables(
Collections.singletonList(
new SyntheticsConfigVariable()
.name("VARIABLE_NAME")
.secure(false)
.type(SyntheticsConfigVariableType.TEXT)))
.request(
new SyntheticsTestRequest()
.basicAuth(
new SyntheticsBasicAuth(
new SyntheticsBasicAuthWeb()
.password("PaSSw0RD!")
.type(SyntheticsBasicAuthWebType.WEB)
.username("my_username")))
.bodyType(SyntheticsTestRequestBodyType.TEXT_PLAIN)
.callType(SyntheticsTestCallType.UNARY)
.certificate(
new SyntheticsTestRequestCertificate()
.cert(new SyntheticsTestRequestCertificateItem())
.key(new SyntheticsTestRequestCertificateItem()))
.files(Collections.singletonList(new SyntheticsTestRequestBodyFile()))
.httpVersion(SyntheticsTestOptionsHTTPVersion.HTTP1)
.mcpProtocolVersion(SyntheticsMCPProtocolVersion.VERSION_2025_06_18)
.proxy(new SyntheticsTestRequestProxy().url("https://example.com"))
.service("Greeter")
.toolName("search")
.url("https://example.com"))
.variables(
Collections.singletonList(
new SyntheticsBrowserVariable()
.name("VARIABLE_NAME")
.type(SyntheticsBrowserVariableType.TEXT))))
.locations(Collections.singletonList("aws:eu-west-3"))
.message("")
.name("Example test name")
.options(
new SyntheticsTestOptions()
.ci(
new SyntheticsTestCiOptions()
.executionRule(SyntheticsTestExecutionRule.BLOCKING))
.deviceIds(Collections.singletonList("chrome.laptop_large"))
.httpVersion(SyntheticsTestOptionsHTTPVersion.HTTP1)
.monitorOptions(
new SyntheticsTestOptionsMonitorOptions()
.notificationPresetName(
SyntheticsTestOptionsMonitorOptionsNotificationPresetName.SHOW_ALL))
.restrictedRoles(
Collections.singletonList("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"))
.retry(new SyntheticsTestOptionsRetry())
.rumSettings(
new SyntheticsBrowserTestRumSettings()
.applicationId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
.clientTokenId(12345L)
.isEnabled(true))
.scheduling(
new SyntheticsTestOptionsScheduling()
.timeframes(
Arrays.asList(
new SyntheticsTestOptionsSchedulingTimeframe()
.day(1)
.from("07:00")
.to("16:00"),
new SyntheticsTestOptionsSchedulingTimeframe()
.day(3)
.from("07:00")
.to("16:00")))
.timezone("America/New_York")))
.status(SyntheticsTestPauseStatus.LIVE)
.steps(
Collections.singletonList(
new SyntheticsStep().type(SyntheticsStepType.ASSERT_ELEMENT_CONTENT)))
.tags(Collections.singletonList("env:prod"))
.type(SyntheticsBrowserTestType.BROWSER);
try {
SyntheticsBrowserTest result = apiInstance.updateBrowserTest("public_id", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#updateBrowserTest");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Edit a browser test returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_basic_auth_web import SyntheticsBasicAuthWeb
from datadog_api_client.v1.model.synthetics_basic_auth_web_type import SyntheticsBasicAuthWebType
from datadog_api_client.v1.model.synthetics_browser_test import SyntheticsBrowserTest
from datadog_api_client.v1.model.synthetics_browser_test_config import SyntheticsBrowserTestConfig
from datadog_api_client.v1.model.synthetics_browser_test_rum_settings import SyntheticsBrowserTestRumSettings
from datadog_api_client.v1.model.synthetics_browser_test_type import SyntheticsBrowserTestType
from datadog_api_client.v1.model.synthetics_browser_variable import SyntheticsBrowserVariable
from datadog_api_client.v1.model.synthetics_browser_variable_type import SyntheticsBrowserVariableType
from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable
from datadog_api_client.v1.model.synthetics_config_variable_type import SyntheticsConfigVariableType
from datadog_api_client.v1.model.synthetics_mcp_protocol_version import SyntheticsMCPProtocolVersion
from datadog_api_client.v1.model.synthetics_restricted_roles import SyntheticsRestrictedRoles
from datadog_api_client.v1.model.synthetics_step import SyntheticsStep
from datadog_api_client.v1.model.synthetics_step_type import SyntheticsStepType
from datadog_api_client.v1.model.synthetics_test_call_type import SyntheticsTestCallType
from datadog_api_client.v1.model.synthetics_test_ci_options import SyntheticsTestCiOptions
from datadog_api_client.v1.model.synthetics_test_execution_rule import SyntheticsTestExecutionRule
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion
from datadog_api_client.v1.model.synthetics_test_options_monitor_options import SyntheticsTestOptionsMonitorOptions
from datadog_api_client.v1.model.synthetics_test_options_monitor_options_notification_preset_name import (
SyntheticsTestOptionsMonitorOptionsNotificationPresetName,
)
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
from datadog_api_client.v1.model.synthetics_test_options_scheduling import SyntheticsTestOptionsScheduling
from datadog_api_client.v1.model.synthetics_test_options_scheduling_timeframe import (
SyntheticsTestOptionsSchedulingTimeframe,
)
from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
from datadog_api_client.v1.model.synthetics_test_request_body_file import SyntheticsTestRequestBodyFile
from datadog_api_client.v1.model.synthetics_test_request_body_type import SyntheticsTestRequestBodyType
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
from datadog_api_client.v1.model.synthetics_test_request_certificate_item import SyntheticsTestRequestCertificateItem
from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy
body = SyntheticsBrowserTest(
config=SyntheticsBrowserTestConfig(
assertions=[],
config_variables=[
SyntheticsConfigVariable(
name="VARIABLE_NAME",
secure=False,
type=SyntheticsConfigVariableType.TEXT,
),
],
request=SyntheticsTestRequest(
basic_auth=SyntheticsBasicAuthWeb(
password="PaSSw0RD!",
type=SyntheticsBasicAuthWebType.WEB,
username="my_username",
),
body_type=SyntheticsTestRequestBodyType.TEXT_PLAIN,
call_type=SyntheticsTestCallType.UNARY,
certificate=SyntheticsTestRequestCertificate(
cert=SyntheticsTestRequestCertificateItem(),
key=SyntheticsTestRequestCertificateItem(),
),
certificate_domains=[],
files=[
SyntheticsTestRequestBodyFile(),
],
http_version=SyntheticsTestOptionsHTTPVersion.HTTP1,
mcp_protocol_version=SyntheticsMCPProtocolVersion.VERSION_2025_06_18,
proxy=SyntheticsTestRequestProxy(
url="https://example.com",
),
service="Greeter",
tool_name="search",
url="https://example.com",
),
variables=[
SyntheticsBrowserVariable(
name="VARIABLE_NAME",
type=SyntheticsBrowserVariableType.TEXT,
),
],
),
locations=[
"aws:eu-west-3",
],
message="",
name="Example test name",
options=SyntheticsTestOptions(
blocked_request_patterns=[],
ci=SyntheticsTestCiOptions(
execution_rule=SyntheticsTestExecutionRule.BLOCKING,
),
device_ids=[
"chrome.laptop_large",
],
http_version=SyntheticsTestOptionsHTTPVersion.HTTP1,
monitor_options=SyntheticsTestOptionsMonitorOptions(
notification_preset_name=SyntheticsTestOptionsMonitorOptionsNotificationPresetName.SHOW_ALL,
),
restricted_roles=SyntheticsRestrictedRoles(
[
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
]
),
retry=SyntheticsTestOptionsRetry(),
rum_settings=SyntheticsBrowserTestRumSettings(
application_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
client_token_id=12345,
is_enabled=True,
),
scheduling=SyntheticsTestOptionsScheduling(
timeframes=[
SyntheticsTestOptionsSchedulingTimeframe(
day=1,
_from="07:00",
to="16:00",
),
SyntheticsTestOptionsSchedulingTimeframe(
day=3,
_from="07:00",
to="16:00",
),
],
timezone="America/New_York",
),
),
status=SyntheticsTestPauseStatus.LIVE,
steps=[
SyntheticsStep(
type=SyntheticsStepType.ASSERT_ELEMENT_CONTENT,
),
],
tags=[
"env:prod",
],
type=SyntheticsBrowserTestType.BROWSER,
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = SyntheticsApi(api_client)
response = api_instance.update_browser_test(public_id="public_id", body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Edit a browser test returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new
body = DatadogAPIClient::V1::SyntheticsBrowserTest.new({
config: DatadogAPIClient::V1::SyntheticsBrowserTestConfig.new({
assertions: [],
config_variables: [
DatadogAPIClient::V1::SyntheticsConfigVariable.new({
name: "VARIABLE_NAME",
secure: false,
type: DatadogAPIClient::V1::SyntheticsConfigVariableType::TEXT,
}),
],
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
basic_auth: DatadogAPIClient::V1::SyntheticsBasicAuthWeb.new({
password: "PaSSw0RD!",
type: DatadogAPIClient::V1::SyntheticsBasicAuthWebType::WEB,
username: "my_username",
}),
body_type: DatadogAPIClient::V1::SyntheticsTestRequestBodyType::TEXT_PLAIN,
call_type: DatadogAPIClient::V1::SyntheticsTestCallType::UNARY,
certificate: DatadogAPIClient::V1::SyntheticsTestRequestCertificate.new({
cert: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({}),
key: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({}),
}),
certificate_domains: [],
files: [
DatadogAPIClient::V1::SyntheticsTestRequestBodyFile.new({}),
],
http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP1,
mcp_protocol_version: DatadogAPIClient::V1::SyntheticsMCPProtocolVersion::VERSION_2025_06_18,
proxy: DatadogAPIClient::V1::SyntheticsTestRequestProxy.new({
url: "https://example.com",
}),
service: "Greeter",
tool_name: "search",
url: "https://example.com",
}),
variables: [
DatadogAPIClient::V1::SyntheticsBrowserVariable.new({
name: "VARIABLE_NAME",
type: DatadogAPIClient::V1::SyntheticsBrowserVariableType::TEXT,
}),
],
}),
locations: [
"aws:eu-west-3",
],
message: "",
name: "Example test name",
options: DatadogAPIClient::V1::SyntheticsTestOptions.new({
blocked_request_patterns: [],
ci: DatadogAPIClient::V1::SyntheticsTestCiOptions.new({
execution_rule: DatadogAPIClient::V1::SyntheticsTestExecutionRule::BLOCKING,
}),
device_ids: [
"chrome.laptop_large",
],
http_version: DatadogAPIClient::V1::SyntheticsTestOptionsHTTPVersion::HTTP1,
monitor_options: DatadogAPIClient::V1::SyntheticsTestOptionsMonitorOptions.new({
notification_preset_name: DatadogAPIClient::V1::SyntheticsTestOptionsMonitorOptionsNotificationPresetName::SHOW_ALL,
}),
restricted_roles: [
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
],
_retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({}),
rum_settings: DatadogAPIClient::V1::SyntheticsBrowserTestRumSettings.new({
application_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
client_token_id: 12345,
is_enabled: true,
}),
scheduling: DatadogAPIClient::V1::SyntheticsTestOptionsScheduling.new({
timeframes: [
DatadogAPIClient::V1::SyntheticsTestOptionsSchedulingTimeframe.new({
day: 1,
from: "07:00",
to: "16:00",
}),
DatadogAPIClient::V1::SyntheticsTestOptionsSchedulingTimeframe.new({
day: 3,
from: "07:00",
to: "16:00",
}),
],
timezone: "America/New_York",
}),
}),
status: DatadogAPIClient::V1::SyntheticsTestPauseStatus::LIVE,
steps: [
DatadogAPIClient::V1::SyntheticsStep.new({
type: DatadogAPIClient::V1::SyntheticsStepType::ASSERT_ELEMENT_CONTENT,
}),
],
tags: [
"env:prod",
],
type: DatadogAPIClient::V1::SyntheticsBrowserTestType::BROWSER,
})
p api_instance.update_browser_test("public_id", body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Edit a browser test returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
use datadog_api_client::datadogV1::model::SyntheticsBasicAuth;
use datadog_api_client::datadogV1::model::SyntheticsBasicAuthWeb;
use datadog_api_client::datadogV1::model::SyntheticsBasicAuthWebType;
use datadog_api_client::datadogV1::model::SyntheticsBrowserTest;
use datadog_api_client::datadogV1::model::SyntheticsBrowserTestConfig;
use datadog_api_client::datadogV1::model::SyntheticsBrowserTestRumSettings;
use datadog_api_client::datadogV1::model::SyntheticsBrowserTestType;
use datadog_api_client::datadogV1::model::SyntheticsBrowserVariable;
use datadog_api_client::datadogV1::model::SyntheticsBrowserVariableType;
use datadog_api_client::datadogV1::model::SyntheticsConfigVariable;
use datadog_api_client::datadogV1::model::SyntheticsConfigVariableType;
use datadog_api_client::datadogV1::model::SyntheticsMCPProtocolVersion;
use datadog_api_client::datadogV1::model::SyntheticsStep;
use datadog_api_client::datadogV1::model::SyntheticsStepType;
use datadog_api_client::datadogV1::model::SyntheticsTestCallType;
use datadog_api_client::datadogV1::model::SyntheticsTestCiOptions;
use datadog_api_client::datadogV1::model::SyntheticsTestExecutionRule;
use datadog_api_client::datadogV1::model::SyntheticsTestOptions;
use datadog_api_client::datadogV1::model::SyntheticsTestOptionsHTTPVersion;
use datadog_api_client::datadogV1::model::SyntheticsTestOptionsMonitorOptions;
use datadog_api_client::datadogV1::model::SyntheticsTestOptionsMonitorOptionsNotificationPresetName;
use datadog_api_client::datadogV1::model::SyntheticsTestOptionsRetry;
use datadog_api_client::datadogV1::model::SyntheticsTestOptionsScheduling;
use datadog_api_client::datadogV1::model::SyntheticsTestOptionsSchedulingTimeframe;
use datadog_api_client::datadogV1::model::SyntheticsTestPauseStatus;
use datadog_api_client::datadogV1::model::SyntheticsTestRequest;
use datadog_api_client::datadogV1::model::SyntheticsTestRequestBodyFile;
use datadog_api_client::datadogV1::model::SyntheticsTestRequestBodyType;
use datadog_api_client::datadogV1::model::SyntheticsTestRequestCertificate;
use datadog_api_client::datadogV1::model::SyntheticsTestRequestCertificateItem;
use datadog_api_client::datadogV1::model::SyntheticsTestRequestProxy;
#[tokio::main]
async fn main() {
let body = SyntheticsBrowserTest::new(
SyntheticsBrowserTestConfig::new(
vec![],
SyntheticsTestRequest::new()
.basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
SyntheticsBasicAuthWeb::new()
.password("PaSSw0RD!".to_string())
.type_(SyntheticsBasicAuthWebType::WEB)
.username("my_username".to_string()),
)))
.body_type(SyntheticsTestRequestBodyType::TEXT_PLAIN)
.call_type(SyntheticsTestCallType::UNARY)
.certificate(
SyntheticsTestRequestCertificate::new()
.cert(SyntheticsTestRequestCertificateItem::new())
.key(SyntheticsTestRequestCertificateItem::new()),
)
.certificate_domains(vec![])
.files(vec![SyntheticsTestRequestBodyFile::new()])
.http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
.mcp_protocol_version(SyntheticsMCPProtocolVersion::VERSION_2025_06_18)
.proxy(SyntheticsTestRequestProxy::new(
"https://example.com".to_string(),
))
.service("Greeter".to_string())
.tool_name("search".to_string())
.url("https://example.com".to_string()),
)
.config_variables(vec![SyntheticsConfigVariable::new(
"VARIABLE_NAME".to_string(),
SyntheticsConfigVariableType::TEXT,
)
.secure(false)])
.variables(vec![SyntheticsBrowserVariable::new(
"VARIABLE_NAME".to_string(),
SyntheticsBrowserVariableType::TEXT,
)]),
vec!["aws:eu-west-3".to_string()],
"".to_string(),
"Example test name".to_string(),
SyntheticsTestOptions::new()
.blocked_request_patterns(vec![])
.ci(SyntheticsTestCiOptions::new(
SyntheticsTestExecutionRule::BLOCKING,
))
.device_ids(vec!["chrome.laptop_large".to_string()])
.http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
.monitor_options(
SyntheticsTestOptionsMonitorOptions::new().notification_preset_name(
SyntheticsTestOptionsMonitorOptionsNotificationPresetName::SHOW_ALL,
),
)
.restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()])
.retry(SyntheticsTestOptionsRetry::new())
.rum_settings(
SyntheticsBrowserTestRumSettings::new(true)
.application_id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string())
.client_token_id(12345),
)
.scheduling(SyntheticsTestOptionsScheduling::new(
vec![
SyntheticsTestOptionsSchedulingTimeframe::new(
1,
"07:00".to_string(),
"16:00".to_string(),
),
SyntheticsTestOptionsSchedulingTimeframe::new(
3,
"07:00".to_string(),
"16:00".to_string(),
),
],
"America/New_York".to_string(),
)),
SyntheticsBrowserTestType::BROWSER,
)
.status(SyntheticsTestPauseStatus::LIVE)
.steps(vec![
SyntheticsStep::new().type_(SyntheticsStepType::ASSERT_ELEMENT_CONTENT)
])
.tags(vec!["env:prod".to_string()]);
let configuration = datadog::Configuration::new();
let api = SyntheticsAPI::with_config(configuration);
let resp = api.update_browser_test("public_id".to_string(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* Edit a browser test returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v1.SyntheticsApi(configuration);
const params: v1.SyntheticsApiUpdateBrowserTestRequest = {
body: {
config: {
assertions: [],
configVariables: [
{
name: "VARIABLE_NAME",
secure: false,
type: "text",
},
],
request: {
basicAuth: {
password: "PaSSw0RD!",
type: "web",
username: "my_username",
},
bodyType: "text/plain",
callType: "unary",
certificate: {
cert: {},
key: {},
},
certificateDomains: [],
files: [{}],
httpVersion: "http1",
mcpProtocolVersion: "2025-06-18",
proxy: {
url: "https://example.com",
},
service: "Greeter",
toolName: "search",
url: "https://example.com",
},
variables: [
{
name: "VARIABLE_NAME",
type: "text",
},
],
},
locations: ["aws:eu-west-3"],
message: "",
name: "Example test name",
options: {
blockedRequestPatterns: [],
ci: {
executionRule: "blocking",
},
deviceIds: ["chrome.laptop_large"],
httpVersion: "http1",
monitorOptions: {
notificationPresetName: "show_all",
},
restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
retry: {},
rumSettings: {
applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
clientTokenId: 12345,
isEnabled: true,
},
scheduling: {
timeframes: [
{
day: 1,
from: "07:00",
to: "16:00",
},
{
day: 3,
from: "07:00",
to: "16:00",
},
],
timezone: "America/New_York",
},
},
status: "live",
steps: [
{
type: "assertElementContent",
},
],
tags: ["env:prod"],
type: "browser",
},
publicId: "public_id",
};
apiInstance
.updateBrowserTest(params)
.then((data: v1.SyntheticsBrowserTest) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"