Creating Datadog Synthetics API Tests - Test Types and Locations

You create a Synthetics API test by choosing a subtype such as HTTP or DNS, writing the success conditions as assertions, and deciding where and how often it runs. Deciding up front whether to run from outside or inside your network and how to handle transient failures gives you monitoring that does not alert too often.

Choose the subtype by the layer of failure you want to catch

An API test sends a single request to a service and checks the response. Subtypes are divided by network layer, and as of October 2026 there are eight: HTTP / SSL / DNS / WebSocket / TCP / UDP / ICMP / gRPC (source: API Testing). Which one you choose depends on which layer's failures you want to learn about first.

What each subtype checks (as of October 2026)
SubtypeWhat it checksExample failures it can catch
HTTPEndpoint response time, status code, headers, and bodyError status codes, a body different from what was expected
SSLValidity and expiration of SSL / TLS certificatesCertificates nearing expiration
DNSWhether records resolve and how long resolution takesUnexpected A / AAAA / CNAME / TXT / MX records, slow name resolution
WebSocketResponses and conditions after opening a connectionDegraded response time, missing expected headers
TCPWhether a connection to a host's port can be madePorts such as SSH (22) or SMTP (25) closing
UDPResponses on UDP portsNo response or delays from services running over UDP
ICMPPing responses and round-trip timeUnreachable hosts, changes in firewall settings
gRPCResponses from Behavior Checks and service status from Health ChecksServers that do not accept RPCs
Source: API Testing and the Overview of each subtype page (UDP Testing and others)

For UDP tests, the official documentation recommends placing a process on the receiving host that listens on the port and returns a response, which means one more preparation step than the other types (source: UDP Testing). One way to proceed is to review your own incident records, count whether failures most often occurred in name resolution, certificates, or application responses, and then decide which subtype to create first. The overall picture of synthetic monitoring and why to start with API tests is in the Synthetics explanation.

Build HTTP test requests from the URL and method

There are two ways to create one: start from a template, or choose the HTTP type with Start from scratch and specify the URL. The method can be chosen from GET / POST / PATCH / PUT / HEAD / DELETE / OPTIONS, and both http and https URLs are supported. Clicking Send sends a trial request, and a preview of the response appears on the right side of the screen (as of October 2026; source: HTTP Testing). Headers, authentication, and the body are split across tabs in Advanced options.

Advanced options tabs and their main fields (as of October 2026)
TabMain fields
Request OptionsHTTP version, following redirects, timeout, request headers, cookies
AuthenticationClient certificates (mTLS), Basic, Digest, NTLM, AWS Signature v4, OAuth 2.0, JWT
Query ParametersNames and values of queries that need encoding
Request BodyBody type (such as application/json or GraphQL) and content
ProxyURL and headers of the proxy to go through
PrivacyA setting that does not save the response body at runtime
JavascriptA script that creates variables before the request is sent
Source: HTTP Testing

The HTTP version is easy to overlook. The default setting falls back from HTTP/2 to HTTP/1.1. For endpoints behind a CDN such as Akamai or CloudFront, the official recommendation is to pin it to HTTP/2 only or HTTP/1.1 only. Version support differs by the side running the test (the probe), and leaving the default can cause intermittent HTTP errors. If an API behind a CDN fails for no clear reason, check this field first.

Catch broken content with body conditions, not just status codes

You write success conditions as assertions. The types of assertions and the fact that the automatically added conditions do not look at the body are covered in the Assertion glossary page. What matters on the creating side is what to add to the three that are added automatically. For example, if you want either 200 or 302 to count as success, writing a regular expression such as (200|302) in the status code's matches gives you an "or" condition (as of October 2026; source: HTTP Testing).

Examples of failures paired with assertions to add
FailureAssertion to add
The status code stays successful but the body is an error JSONUse a body jsonpath to check a field that is present only on success
Field names or types change silentlyUse a body jsonschema to check the shape of the response
There is a response but it is slowis less than on response time
Conditions that cannot be written with the standard typesJavaScript assertions (such as Chai's dd.expect())
Source: HTTP Testing (the Define assertions table and the JavaScript tab)

When reading JSON in a JavaScript assertion, parse the body with JSON.parse(dd.response.body) before touching its fields. If the error message on failure could contain personal information, enabling Do not save response body on the Privacy tab truncates the error message. The more conditions you add, the stricter the check becomes, so each time you add one, run it against the preview response with Send to confirm it passes when things are healthy.

Run from managed locations, or place a run location inside your network

You choose whether to run from the managed locations Datadog provides or from private locations you place in your own network. Managed locations are for testing public sites and endpoints from the regions where your users are, and they are placed in regions of AWS / Google Cloud / Azure. In the list as of October 2026, the locations in Japan are AWS Tokyo and Osaka and Google Cloud Tokyo (source: HTTP Testing). APIs reachable only from inside your network are tested from private locations. How to place them and how they work is covered in the Private Location section of the Synthetics explanation.

Examples of choosing run locations (as of October 2026)
What you want to confirmHow to set up locations
Whether domestic users can reach a public APITwo locations, AWS Tokyo and Osaka
Whether overseas users can reach it tooOne location each from AMER / APAC / EMEA via Regions in Snippets
Whether an internal-only API respondsA private location placed inside your network
Separating the external route from internal responsesSeparate tests for managed locations and private locations
Source: HTTP Testing (the Select locations and Snippets sections)

The more locations you add, the more you need to decide whether a temporary failure at a single location should trigger an alert. This is where alert conditions come in, and the form in the official documentation is "alert if any assertion fails for X minutes from at least n of N locations." In the author's view, with two domestic locations, starting with a setting that alerts only when both fail means you will not be paged for fluctuations at just one.

If all locations fail at once, suspect allowlisting of the source

When a test fails at every location right after it is created, the target server may not be accepting Datadog's requests. Some systems do not let through robot requests without a way to identify them, and Datadog publishes how to identify its requests. The sources of managed locations are listed as CIDRs in synthetics.json on the ip-ranges domain for each Datadog site. The default user-agent for API tests is Datadog/Synthetics (as of October 2026; source: Identify Synthetic Bots). Where a WAF or an IP allowlist is blocking them, open a path using these ranges or headers.

How failures show up and where to look first
How the failure shows upWhere to look first
Fails at every location right after creationWhether the source IP ranges and headers are allowed by the target
Only one location fails occasionallyRetries (Fast retry) and the n in the alert condition
Fails intermittently behind a CDNThe HTTP version in Request Options
Source: Identify Synthetic Bots / HTTP Testing

The official documentation says source IPs rarely change except when new locations are added. If you want to know when they change, it describes pointing an API test at synthetics.json itself. The assertion is set with a JSONPath such as $.synthetics['prefixes_ipv4_by_location']['aws:ap-northeast-1'].length. For transient failures, Fast retry can rerun the test X times at Y-millisecond intervals after a failure. The number of runs grows by frequency multiplied by locations. The relationship between run counts and billing is left to the billing section of the Synthetics explanation.

When a single request is not enough, and when the Agent's HTTP check is enough

An API test completes in a single request. For flows that chain requests, such as logging in and then placing an order, and for endpoints that require authentication, Multistep API Tests are recommended (as of October 2026; source: API Testing). If you want to check screen interactions too, use browser tests; if you reuse the same values across multiple tests, global variables defined on the Settings page are the place for them. Conversely, if you only need to check whether a fixed URL is up from an internal host, the HTTP check included in the Agent is enough.

Differences between API tests and the Agent's HTTP check (as of October 2026)
AspectSynthetics API testAgent HTTP check
Where it runs fromA managed location or a private locationThe host where the Agent is installed
Where the configuration is writtenThe Datadog UI (can also be managed with Terraform and similar tools)http_check.d/conf.yaml in the Agent's conf.d/
What it can checkResponses and assertions for each subtypeStatus code, certificate expiration, strings in the body, response time
How failures are handledAlert conditions by number of locations and duration, Fast retryA monitor that picks up the check results
Source: HTTP Testing / HTTP Check

The official documentation for the HTTP check also mentions running it from hosts that do not run the monitored site. Even so, it still runs from your own host, so API tests from managed locations answer more directly the question of whether external users can reach you.

Make the first test fail on purpose and confirm how notifications arrive

As with regular monitors, test notifications are routed by writing recipients that start with @ in the message or by selecting people and integrations from a list. Messages can use conditional variables such as {{#is_alert}} and {{#is_recovery}}, and information about the failing locations is attached to the notification. If you want to pause during maintenance, selecting a scheduled downtime in the Downtimes section stops the test automatically during that time (as of October 2026; source: HTTP Testing). Delivery to chat is covered in setting up Slack and Teams notifications, and managing tests as JSON in the monitor API and JSON. The author's recommendation is to save your first HTTP test with just one status code assertion that a healthy response will not pass. When the alert fires and reaches the channel, change the assertion back to the correct value and receive the recovery notification as well. Recording in your runbook the number of minutes from saving to the first notification gives you a guide for how long to wait with the second test.

References

Share