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.
| Subtype | What it checks | Example failures it can catch |
|---|---|---|
| HTTP | Endpoint response time, status code, headers, and body | Error status codes, a body different from what was expected |
| SSL | Validity and expiration of SSL / TLS certificates | Certificates nearing expiration |
| DNS | Whether records resolve and how long resolution takes | Unexpected A / AAAA / CNAME / TXT / MX records, slow name resolution |
| WebSocket | Responses and conditions after opening a connection | Degraded response time, missing expected headers |
| TCP | Whether a connection to a host's port can be made | Ports such as SSH (22) or SMTP (25) closing |
| UDP | Responses on UDP ports | No response or delays from services running over UDP |
| ICMP | Ping responses and round-trip time | Unreachable hosts, changes in firewall settings |
| gRPC | Responses from Behavior Checks and service status from Health Checks | Servers that do not accept RPCs |
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.
| Tab | Main fields |
|---|---|
| Request Options | HTTP version, following redirects, timeout, request headers, cookies |
| Authentication | Client certificates (mTLS), Basic, Digest, NTLM, AWS Signature v4, OAuth 2.0, JWT |
| Query Parameters | Names and values of queries that need encoding |
| Request Body | Body type (such as application/json or GraphQL) and content |
| Proxy | URL and headers of the proxy to go through |
| Privacy | A setting that does not save the response body at runtime |
| Javascript | A script that creates variables before the request is sent |
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).
| Failure | Assertion to add |
|---|---|
| The status code stays successful but the body is an error JSON | Use a body jsonpath to check a field that is present only on success |
| Field names or types change silently | Use a body jsonschema to check the shape of the response |
| There is a response but it is slow | is less than on response time |
| Conditions that cannot be written with the standard types | JavaScript assertions (such as Chai's dd.expect()) |
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.
| What you want to confirm | How to set up locations |
|---|---|
| Whether domestic users can reach a public API | Two locations, AWS Tokyo and Osaka |
| Whether overseas users can reach it too | One location each from AMER / APAC / EMEA via Regions in Snippets |
| Whether an internal-only API responds | A private location placed inside your network |
| Separating the external route from internal responses | Separate tests for managed locations and private locations |
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 the failure shows up | Where to look first |
|---|---|
| Fails at every location right after creation | Whether the source IP ranges and headers are allowed by the target |
| Only one location fails occasionally | Retries (Fast retry) and the n in the alert condition |
| Fails intermittently behind a CDN | The HTTP version in Request Options |
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.
| Aspect | Synthetics API test | Agent HTTP check |
|---|---|---|
| Where it runs from | A managed location or a private location | The host where the Agent is installed |
| Where the configuration is written | The 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 check | Responses and assertions for each subtype | Status code, certificate expiration, strings in the body, response time |
| How failures are handled | Alert conditions by number of locations and duration, Fast retry | A monitor that picks up the check results |
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.