---
title: API testing template variables
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Synthetic Testing and Monitoring > Synthetic Monitoring Notifications >
  Synthetic Monitoring Template Variables > API testing template variables
---

# API testing template variables

## Overview{% #overview %}

Template variables allow you to insert dynamic values from your test results and configuration into Synthetic Monitoring notification messages for API tests. These variables are accessed using the `synthetics.attributes` prefix.

Use the filters above to view variables by protocol type and variable category.

{% section displayed-if="Variables is Test results" %}
This section only applies to users who meet the following criteria: Variables is Test results

This section covers three categories of variables:

- Protocol-specific variables: Request, response, and timing data specific to the selected protocol.
- Common variables: Assertions, DNS resolution, and shared timing data available across all protocols.
- Execution results: Test status, duration, failure details, and step counts.

{% section displayed-if="Test type is HTTP" %}
This section only applies to users who meet the following criteria: Test type is HTTP

### HTTP Protocol Variables{% #http-protocol-variables %}

{% tab title="Request" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.request`
{% /dt %}

{% dd %}
Information about the request
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.request.method`
{% /dt %}

{% dd %}
The HTTP method
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.request.body`
{% /dt %}

{% dd %}
The request body if set
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.request.headers`
{% /dt %}

{% dd %}
The request headers
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Response" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.response`
{% /dt %}

{% dd %}
Information about the response
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.body`
{% /dt %}

{% dd %}
The response body as string (truncated if too big)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.bodySize`
{% /dt %}

{% dd %}
The size of the full response body
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.cacheHeaders`
{% /dt %}

{% dd %}
A dictionary of caching-related headers
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.cdn`
{% /dt %}

{% dd %}
The response CDN info if any
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.cdn.provider`
{% /dt %}

{% dd %}
The CDN provider name (for example, `akamai`, `cloudflare`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.cdn.cache`
{% /dt %}

{% dd %}
The cache info
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.cdn.cache.cached`
{% /dt %}

{% dd %}
If the data was cached
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.cdn.cache.status`
{% /dt %}

{% dd %}
The cache status as provided in associated cache header
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.headers`
{% /dt %}

{% dd %}
The response headers
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.httpVersion`
{% /dt %}

{% dd %}
The HTTP version
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.redirects`
{% /dt %}

{% dd %}
A list of redirections if any
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.redirects.statusCode`
{% /dt %}

{% dd %}
The HTTP status code for the redirect
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.redirects.location`
{% /dt %}

{% dd %}
The returned location to redirect to
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.statusCode`
{% /dt %}

{% dd %}
The response HTTP status code
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Timings" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.authentication`
{% /dt %}

{% dd %}
The time spent for the authentication challenge (for example, NTLM)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.download`
{% /dt %}

{% dd %}
The time spent downloading the response
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.firstByte`
{% /dt %}

{% dd %}
The time spent waiting for the first byte of response to be received
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.redirect`
{% /dt %}

{% dd %}
The time spent in HTTP redirections
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.ssl`
{% /dt %}

{% dd %}
The duration of the TLS handshake (only when testing an HTTPS endpoint)
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

{% section displayed-if="Test type is DNS" %}
This section only applies to users who meet the following criteria: Test type is DNS

### DNS Protocol Variables{% #dns-protocol-variables %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.response.records.type`
{% /dt %}

{% dd %}
DNS record type
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.records.values`
{% /dt %}

{% dd %}
DNS record values
{% /dd %}

{% /dl %}
{% /section %}

{% section displayed-if="Test type is SSL" %}
This section only applies to users who meet the following criteria: Test type is SSL

### SSL Protocol Variables{% #ssl-protocol-variables %}

{% tab title="Certificate" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.cert`
{% /dt %}

{% dd %}
SSL certificate information
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.cipher`
{% /dt %}

{% dd %}
Cipher suite used (for example, `TLS_AES_128_GCM_SHA256`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.extKeyUsage`
{% /dt %}

{% dd %}
Extended key usage data
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.fingerprint`
{% /dt %}

{% dd %}
SHA-1 digest of the DER encoded certificate
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.fingerprint256`
{% /dt %}

{% dd %}
SHA-256 digest of the DER encoded certificate
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.issuer`
{% /dt %}

{% dd %}
Information about the certificate authority that signed the certificate
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.issuer.C`
{% /dt %}

{% dd %}
Country code
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.issuer.ST`
{% /dt %}

{% dd %}
Street
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.issuer.L`
{% /dt %}

{% dd %}
Locality
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.issuer.O`
{% /dt %}

{% dd %}
Organization
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.issuer.OU`
{% /dt %}

{% dd %}
Organizational unit
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.issuer.CN`
{% /dt %}

{% dd %}
Common name
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.subject`
{% /dt %}

{% dd %}
Information about the certificate subject (same fields as issuer)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.subject.altName`
{% /dt %}

{% dd %}
All domains for which the certificate is valid (Subject Alternative Name)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.protocol`
{% /dt %}

{% dd %}
SSL/TLS protocol version
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.serialNumber`
{% /dt %}

{% dd %}
Certificate serial number
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.tlsVersion`
{% /dt %}

{% dd %}
TLS version parsed from protocol, if available
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.valid.from`
{% /dt %}

{% dd %}
Certificate validity start date (millisecond-based epoch)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.valid.to`
{% /dt %}

{% dd %}
Certificate validity end date (millisecond-based epoch)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.exponent`
{% /dt %}

{% dd %}
RSA key exponent (for RSA keys)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.cert.modulus`
{% /dt %}

{% dd %}
RSA key modulus as a hexadecimal string (for RSA keys)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ocsp`
{% /dt %}

{% dd %}
OCSP (Online Certificate Status Protocol) information
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Timings" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.handshake`
{% /dt %}

{% dd %}
SSL handshake timing
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

{% section displayed-if="Test type is WebSocket" %}
This section only applies to users who meet the following criteria: Test type is WebSocket

### WebSocket Protocol Variables{% #websocket-protocol-variables %}

{% tab title="Timings" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.open`
{% /dt %}

{% dd %}
Time to open connection (in milliseconds)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.receive`
{% /dt %}

{% dd %}
Time to receive response
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Handshake" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.handshake.request`
{% /dt %}

{% dd %}
Handshake request data
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.handshake.request.headers`
{% /dt %}

{% dd %}
Headers sent during the handshake
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.handshake.response`
{% /dt %}

{% dd %}
Handshake response data
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.handshake.response.headers`
{% /dt %}

{% dd %}
Headers received during the handshake
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.handshake.response.statusCode`
{% /dt %}

{% dd %}
HTTP status code of the handshake response
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Message" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.request.message`
{% /dt %}

{% dd %}
WebSocket request message
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.message`
{% /dt %}

{% dd %}
WebSocket response message
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Close" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.close.reason`
{% /dt %}

{% dd %}
Connection close reason
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.close.statusCode`
{% /dt %}

{% dd %}
Connection close status code
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

{% section displayed-if="Test type is UDP" %}
This section only applies to users who meet the following criteria: Test type is UDP

### UDP Protocol Variables{% #udp-protocol-variables %}

{% tab title="Request" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.request.message`
{% /dt %}

{% dd %}
UDP request message
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Response" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.response.message`
{% /dt %}

{% dd %}
UDP response message
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Timings" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.message`
{% /dt %}

{% dd %}
Message timing
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

{% section displayed-if="Test type is TCP" %}
This section only applies to users who meet the following criteria: Test type is TCP

### TCP Protocol Variables{% #tcp-protocol-variables %}

{% tab title="Connection" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.connectionOutcome`
{% /dt %}

{% dd %}
Connection result (`established`, `refused`, or `timeout`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.netpath.routers.ip`
{% /dt %}

{% dd %}
Router IP addresses from network path data
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Traceroute" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute`
{% /dt %}

{% dd %}
Traceroute hop data, available when **Track number of network hops (TTL)** is enabled in the test
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.routers.ip`
{% /dt %}

{% dd %}
Router IP address for the hop
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.routers.resolvedHost`
{% /dt %}

{% dd %}
Resolved hostname for the router IP, if available
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.packetsSent`
{% /dt %}

{% dd %}
Number of network packets sent
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.packetsReceived`
{% /dt %}

{% dd %}
Number of packets received
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.packetLossPercentage`
{% /dt %}

{% dd %}
Ratio of packet loss (float between 0 and 1)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.latency.min`
{% /dt %}

{% dd %}
Minimum latency
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.latency.max`
{% /dt %}

{% dd %}
Maximum latency
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.latency.avg`
{% /dt %}

{% dd %}
Average latency
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.latency.stddev`
{% /dt %}

{% dd %}
Standard deviation
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute.latency.values`
{% /dt %}

{% dd %}
Latency values array
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

{% section displayed-if="Test type is ICMP" %}
This section only applies to users who meet the following criteria: Test type is ICMP

### ICMP Protocol Variables{% #icmp-protocol-variables %}

{% tab title="Traceroute" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.traceroute`
{% /dt %}

{% dd %}
Traceroute data (same structure as TCP traceroute)
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Ping" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.request.host`
{% /dt %}

{% dd %}
Target host
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping`
{% /dt %}

{% dd %}
Ping result data
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.packetsSent`
{% /dt %}

{% dd %}
Number of network packets sent
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.packetsReceived`
{% /dt %}

{% dd %}
Number of packets received
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.packetLossPercentage`
{% /dt %}

{% dd %}
Ratio of packet loss (float between 0 and 1)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.packetSize`
{% /dt %}

{% dd %}
Packet size
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.resolvedIP`
{% /dt %}

{% dd %}
Resolved IP address of the pinged host
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.latency.min`
{% /dt %}

{% dd %}
Minimum latency
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.latency.max`
{% /dt %}

{% dd %}
Maximum latency
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.latency.avg`
{% /dt %}

{% dd %}
Average latency
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.latency.stddev`
{% /dt %}

{% dd %}
Standard deviation
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.ping.latency.values`
{% /dt %}

{% dd %}
Latency values array
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

{% section displayed-if="Test type is gRPC" %}
This section only applies to users who meet the following criteria: Test type is gRPC

### gRPC Protocol Variables{% #grpc-protocol-variables %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.callType`
{% /dt %}

{% dd %}
Call type (`unary` or `healthcheck`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.rpc`
{% /dt %}

{% dd %}
RPC call timing
{% /dd %}

{% /dl %}

{% tab title="Health check" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.response.healthcheck.status`
{% /dt %}

{% dd %}
Health check status (`UNKNOWN = 0`, `SERVING = 1`, `NOT_SERVING = 2`, `SERVICE_UNKNOWN = 3`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.healthcheck.message.service`
{% /dt %}

{% dd %}
Name of the called service, if provided
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.metadata`
{% /dt %}

{% dd %}
Dictionary of gRPC response metadata
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Unary" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.request.message`
{% /dt %}

{% dd %}
gRPC request message
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.request.service`
{% /dt %}

{% dd %}
The called service
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.message`
{% /dt %}

{% dd %}
gRPC response message (as JSON string)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.response.metadata`
{% /dt %}

{% dd %}
Dictionary of gRPC response metadata
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

### Common Variables{% #common-variables %}

These variables are available for all API test protocols.

{% tab title="Assertions" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.assertions`
{% /dt %}

{% dd %}
List of configured assertions for the test
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.assertions.actual`
{% /dt %}

{% dd %}
The evaluated value of the assertion
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.assertions.expected`
{% /dt %}

{% dd %}
The expected value configured for the assertion (for example, `1000`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.assertions.operator`
{% /dt %}

{% dd %}
The assertion operator (for example, `lessThan`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.assertions.type`
{% /dt %}

{% dd %}
The assertion type (for example, `responseTime`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.assertions.valid`
{% /dt %}

{% dd %}
Whether the assertion passed (boolean)
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="DNS resolution" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.dnsResolution.resolvedIp`
{% /dt %}

{% dd %}
The IP address called for the test (available when testing a domain rather than an IP)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.dnsResolution.server`
{% /dt %}

{% dd %}
The DNS server used for resolution
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Timings" %}

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.total`
{% /dt %}

{% dd %}
Total time of the test in milliseconds (same as `result.duration`)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.dns`
{% /dt %}

{% dd %}
Duration of the DNS lookup in milliseconds (available when testing a domain rather than an IP)
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.timings.tcp`
{% /dt %}

{% dd %}
Time to establish the TCP connection in milliseconds (HTTP, TCP, SSL, and WebSocket subtypes)
{% /dd %}

{% /dl %}

{% /tab %}

### Execution results{% #execution-results %}

Path: `synthetics.attributes`

Use these variables to access test execution results, status, duration, and step counts.

{% tab title="Result" %}

{% dl %}

{% dt %}
`{{synthetics.attributes.result}}`
{% /dt %}

{% dd %}
The `result` object contains information about the executed test run
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.id}}`
{% /dt %}

{% dd %}
Unique result ID
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.status}}`
{% /dt %}

{% dd %}
Test execution status (for example, `passed` or `failed`)
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.duration}}`
{% /dt %}

{% dd %}
Test duration in milliseconds
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.testStartedAt}}`, `{{synthetics.attributes.result.testFinishedAt}}`, `{{synthetics.attributes.result.testTriggeredAt}}`
{% /dt %}

{% dd %}
Epoch timestamps in milliseconds
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.failure}}`
{% /dt %}

{% dd %}
The `failure` object contains information about why the test failed
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.failure.message}}`
{% /dt %}

{% dd %}
The failure message
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.failure.code}}`
{% /dt %}

{% dd %}
The failure code
{% /dd %}

{% /dl %}

For a complete list of API test error codes, see [API Testing Errors](https://docs.datadoghq.com/synthetics/api_tests/errors.md). Review the [conditional alerting](https://docs.datadoghq.com/synthetics/notifications/conditional_alerting.md#send-alerts-based-on-an-error-code) page for an example of how to use the `synthetics.attributes.result.failure` variable in a notification.
{% /tab %}

{% tab title="Count" %}

{% dl %}

{% dt %}
`{{synthetics.attributes.count}}`
{% /dt %}

{% dd %}
The `count` object contains step statistics about the test
{% /dd %}

{% dt %}
`{{synthetics.attributes.count.steps.total}}`
{% /dt %}

{% dd %}
The total number of steps
{% /dd %}

{% dt %}
`{{synthetics.attributes.count.steps.completed}}`
{% /dt %}

{% dd %}
The number of steps that were run
{% /dd %}

{% dt %}
`{{synthetics.attributes.count.errors}}`
{% /dt %}

{% dd %}
The total number of errors that occurred while running the test. For multistep and mobile tests, this is the number of failed steps. For browser tests, this is the sum of all browser errors.
{% /dd %}

{% dt %}
`{{synthetics.attributes.count.hops}}`
{% /dt %}

{% dd %}
The number of traceroute hops for TCP and ICMP tests
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

{% section displayed-if="Variables is Test info" %}
This section only applies to users who meet the following criteria: Variables is Test info

### Test metadata{% #test-metadata %}

Path: `synthetics.attributes`

Use these variables to access test configuration and execution location information.

{% tab title="Test Info" %}

{% dl %}

{% dt %}
`{{synthetics.attributes.test}}`
{% /dt %}

{% dd %}
The `test` object contains information about the test like its `name`, `type`, `subtype`, and `id`
{% /dd %}

{% dt %}
`{{synthetics.attributes.test.name}}`
{% /dt %}

{% dd %}
The name of the test
{% /dd %}

{% dt %}
`{{synthetics.attributes.test.type}}`
{% /dt %}

{% dd %}
Test type (for example, `api`)
{% /dd %}

{% dt %}
`{{synthetics.attributes.test.subType}}`
{% /dt %}

{% dd %}
Subtype for API tests (for example, `http`, `dns`, and `multi`)
{% /dd %}

{% dt %}
`{{synthetics.attributes.test.id}}`
{% /dt %}

{% dd %}
The test's public ID (for example, `abc-def-ghi`)
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Location" %}

{% dl %}

{% dt %}
`{{synthetics.attributes.location}}`
{% /dt %}

{% dd %}
The `location` object contains information about the location of where the test is run from
{% /dd %}

{% dt %}
`{{synthetics.attributes.location.id}}`
{% /dt %}

{% dd %}
Location ID (for example, `aws:eu-central-1`)
{% /dd %}

{% dt %}
`{{synthetics.attributes.location.name}}`
{% /dt %}

{% dd %}
Name of the location (for example, `Frankfurt (AWS)`)
{% /dd %}

{% dt %}
`{{synthetics.attributes.location.privateLocation}}`
{% /dt %}

{% dd %}
`true` for Private Locations
{% /dd %}

{% /dl %}

{% /tab %}
{% /section %}

{% section displayed-if="Variables is Step details" %}
This section only applies to users who meet the following criteria: Variables is Step details

### Extracted variables{% #extracted-variables %}

Path: `synthetics.attributes.variables.extracted`

These are step execution metadata and results containing detailed information about how each step ran, including response data, timing metrics, and protocol-specific details. These values are only available for successful test results and can only be used in Recovery notifications.

**General step properties:**

{% dl %}

{% dt %}
`synthetics.attributes.variables.extracted.steps.allowFailure`
{% /dt %}

{% dd %}
Whether the step is allowed to fail without failing the entire test
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.steps.duration`
{% /dt %}

{% dd %}
Step execution duration in milliseconds
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.steps.failure`
{% /dt %}

{% dd %}
Failure information object containing `.code` and `.message`
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.steps.id`
{% /dt %}

{% dd %}
Unique step identifier
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.steps.isCritical`
{% /dt %}

{% dd %}
Whether the step is critical to the test
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.steps.status`
{% /dt %}

{% dd %}
Step execution status
{% /dd %}

{% dt %}
`synthetics.attributes.variables.extracted.steps.type`
{% /dt %}

{% dd %}
Type of step being executed
{% /dd %}

{% /dl %}

## Step summary{% #step-summary %}

Path: `synthetics.attributes.result.steps`

Access step data by index, name, or ID to reference specific steps in your notification messages. Use these reference methods when working with step-related variables throughout this documentation.

Each step exposes the following properties: `.id`, `.status`, `.type`, `.duration`, `.description`, `.failure.message`, `.code`, and `.url`.

You can reference steps in three ways:

{% tab title="By index" %}
Use positive numbers to count from the beginning, or negative numbers to count from the end:

{% dl %}

{% dt %}
`synthetics.attributes.result.steps.0`
{% /dt %}

{% dd %}
First step
{% /dd %}

{% dt %}
`synthetics.attributes.result.steps.1`
{% /dt %}

{% dd %}
Second step
{% /dd %}

{% dt %}
`synthetics.attributes.result.steps.-1`
{% /dt %}

{% dd %}
Last step
{% /dd %}

{% dt %}
`synthetics.attributes.result.steps.-2`
{% /dt %}

{% dd %}
Second to last step
{% /dd %}

{% /dl %}

**Example:** `{{synthetics.attributes.result.steps.-1.status}}` returns the status of the last step.
{% /tab %}

{% tab title="By name" %}
Use the step name in brackets:

{% dl %}

{% dt %}
`synthetics.attributes.result.steps[Click button]`
{% /dt %}

{% dd %}
References the step named "Click button"
{% /dd %}

{% /dl %}

**Example:** `{{synthetics.attributes.result.steps[Click button].status}}` returns the status of the step named "Click button".
{% /tab %}

{% tab title="By ID" %}
Use the step's unique identifier:

{% dl %}

{% dt %}
`synthetics.attributes.result.steps.abc-def-ghi`
{% /dt %}

{% dd %}
References the step with ID "abc-def-ghi"
{% /dd %}

{% /dl %}

**Example:** `{{synthetics.attributes.result.steps.abc-def-ghi.status}}` returns the status of the step with step ID "abc-def-ghi".
{% /tab %}

Review the [conditional alerting](https://docs.datadoghq.com/synthetics/notifications/conditional_alerting.md#send-alerts-to-a-specific-slack-channel-based-on-failed-step) page for an example of how to use the `synthetics.attributes.result.step` variable in a Slack notification based on a failed step.

### Accessing step properties{% #accessing-step-properties %}

Combine any reference method with a property:

- `{{synthetics.attributes.result.steps.-1.status}}` - Status of the last step
- `{{synthetics.attributes.result.steps[Click button].status}}` - Status of the step named "Click button"
- `{{synthetics.attributes.result.steps.abc-def-ghi.status}}` - Status of the step with step ID "abc-def-ghi"
{% /section %}

{% section displayed-if="Variables is Local & Global" %}
This section only applies to users who meet the following criteria: Variables is Local & Global

### Local & Global Variables{% #local--global-variables %}

Use these variables to access locally configured variables and globally defined variables in your notifications.

{% tab title="Local" %}
Path: `synthetics.attributes.result.variables.config`

These are local variables configured for API tests or defined outside individual steps in step-based tests. This also includes variables created by JavaScript code execution.

{% dl %}

{% dt %}
`{{synthetics.attributes.result.variables.config.name}}`
{% /dt %}

{% dd %}
Variable name
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.variables.config.type}}`
{% /dt %}

{% dd %}
Variable type
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.variables.config.secure}}`
{% /dt %}

{% dd %}
Whether the variable value is obfuscated
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.variables.config.value}}`
{% /dt %}

{% dd %}
Variable value (non-obfuscated only)
{% /dd %}

{% /dl %}

{% /tab %}

{% tab title="Global" %}
Path: `synthetics.attributes.result.variables.extracted`

These are extracted variables whose value updates a global variable value.

Available only for **successful test results** and **recovery notifications**.

{% dl %}

{% dt %}
`{{synthetics.attributes.result.variables.extracted.id}}`
{% /dt %}

{% dd %}
Global variable ID
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.variables.extracted.name}}`
{% /dt %}

{% dd %}
Variable name
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.variables.extracted.secure}}`
{% /dt %}

{% dd %}
Whether the variable value is obfuscated
{% /dd %}

{% dt %}
`{{synthetics.attributes.result.variables.extracted.val}}`
{% /dt %}

{% dd %}
Variable value (note: uses `.val`, not `.value`)
{% /dd %}

{% /dl %}

{% /tab %}

Review the [advanced notifications](https://docs.datadoghq.com/synthetics/notifications/advanced_notifications.md#use-local-variables-in-a-notification) page for an example of how to use local variables in a notification.
{% /section %}

## Further reading{% #further-reading %}

- [Learn how to manage monitors](https://docs.datadoghq.com/monitors/manage.md)
- [Learn more about monitor templates](https://docs.datadoghq.com/monitors/templates.md)
- [Understanding Synthetic Monitor Alerting](https://docs.datadoghq.com/synthetics/guide/how-synthetics-monitors-trigger-alerts.md)
