---
title: Get a Network Path test
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Synthetics
---

# Get a Network Path test{% #get-a-network-path-test %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                                  |
| ----------------- | ----------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/synthetics/tests/network/{public_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/synthetics/tests/network/{public_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/synthetics/tests/network/{public_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/synthetics/tests/network/{public_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/synthetics/tests/network/{public_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/synthetics/tests/network/{public_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/synthetics/tests/network/{public_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/synthetics/tests/network/{public_id} |

### Overview

This endpoint requires the `synthetics_read` permission.

OAuth apps require the `synthetics_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#synthetics) to access this endpoint.



### Arguments

#### Path Parameters

| Name                        | Type   | Description                                                 |
| --------------------------- | ------ | ----------------------------------------------------------- |
| public_id [*required*] | string | The public ID of the Network Path test to get details from. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Network Path test response.

| Parent field    | Field                                | Type            | Description                                                                                                                                                                                                                                                      |
| --------------- | ------------------------------------ | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                 | data                                 | object          | Network Path test response data.                                                                                                                                                                                                                                 |
| data            | attributes                           | object          | Object containing details about a Network Path test.                                                                                                                                                                                                             |
| attributes      | config [*required*]             | object          | Configuration object for a Network Path test.                                                                                                                                                                                                                    |
| config          | assertions                           | [ <oneOf>] | Array of assertions used for the test.                                                                                                                                                                                                                           |
| assertions      | Option 1                             | object          | Network latency assertion for a Network Path test.                                                                                                                                                                                                               |
| Option 1        | operator [*required*]           | enum            | Assertion operator to apply. Allowed enum values: `is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual`                                                                                                                                                   |
| Option 1        | property [*required*]           | enum            | The associated assertion property. Allowed enum values: `avg,max,min`                                                                                                                                                                                            |
| Option 1        | target [*required*]             | double          | Target value in milliseconds.                                                                                                                                                                                                                                    |
| Option 1        | type [*required*]               | enum            | Type of the latency assertion. Allowed enum values: `latency`                                                                                                                                                                                                    |
| assertions      | Option 2                             | object          | Multi-network hop assertion for a Network Path test.                                                                                                                                                                                                             |
| Option 2        | operator [*required*]           | enum            | Assertion operator to apply. Allowed enum values: `is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual`                                                                                                                                                   |
| Option 2        | property [*required*]           | enum            | The associated assertion property. Allowed enum values: `avg,max,min`                                                                                                                                                                                            |
| Option 2        | target [*required*]             | double          | Target value in number of hops.                                                                                                                                                                                                                                  |
| Option 2        | type [*required*]               | enum            | Type of the multi-network hop assertion. Allowed enum values: `multiNetworkHop`                                                                                                                                                                                  |
| assertions      | Option 3                             | object          | Packet loss percentage assertion for a Network Path test.                                                                                                                                                                                                        |
| Option 3        | operator [*required*]           | enum            | Assertion operator to apply. Allowed enum values: `is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual`                                                                                                                                                   |
| Option 3        | target [*required*]             | double          | Target value as a percentage (0 to 1).                                                                                                                                                                                                                           |
| Option 3        | type [*required*]               | enum            | Type of the packet loss percentage assertion. Allowed enum values: `packetLossPercentage`                                                                                                                                                                        |
| assertions      | Option 4                             | object          | Jitter assertion for a Network Path test.                                                                                                                                                                                                                        |
| Option 4        | operator [*required*]           | enum            | Assertion operator to apply. Allowed enum values: `is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual`                                                                                                                                                   |
| Option 4        | target [*required*]             | double          | Target value in milliseconds.                                                                                                                                                                                                                                    |
| Option 4        | type [*required*]               | enum            | Type of the jitter assertion. Allowed enum values: `jitter`                                                                                                                                                                                                      |
| config          | request                              | object          | Object describing the request for a Network Path test.                                                                                                                                                                                                           |
| request         | destination_service                  | string          | An optional label displayed for the destination host in the Network Path visualization.                                                                                                                                                                          |
| request         | e2e_queries [*required*]        | int64           | The number of packets sent to probe the destination to measure packet loss, latency and jitter.                                                                                                                                                                  |
| request         | host [*required*]               | string          | Host name to query.                                                                                                                                                                                                                                              |
| request         | max_ttl [*required*]            | int64           | The maximum time-to-live (max number of hops) used in outgoing probe packets.                                                                                                                                                                                    |
| request         | port                                 | int64           | For TCP or UDP tests, the port to use when performing the test. If not set on a UDP test, a random port is assigned, which may affect the results.                                                                                                               |
| request         | source_service                       | string          | An optional label displayed for the source host in the Network Path visualization.                                                                                                                                                                               |
| request         | tcp_method                           | enum            | For TCP tests, the TCP traceroute strategy. Allowed enum values: `prefer_sack,syn,sack`                                                                                                                                                                          |
| request         | timeout                              | int64           | Timeout in seconds.                                                                                                                                                                                                                                              |
| request         | traceroute_queries [*required*] | int64           | The number of traceroute path tracings.                                                                                                                                                                                                                          |
| attributes      | locations [*required*]          | [string]        | Array of locations used to run the test. Network Path tests can be run from managed locations to test public endpoints, or from a [Datadog Agent](https://docs.datadoghq.com/synthetics/network_path_tests.md#agent-configuration) to test private environments. |
| attributes      | message [*required*]            | string          | Notification message associated with the test.                                                                                                                                                                                                                   |
| attributes      | monitor_id                           | int64           | The associated monitor ID.                                                                                                                                                                                                                                       |
| attributes      | name [*required*]               | string          | Name of the test.                                                                                                                                                                                                                                                |
| attributes      | options [*required*]            | object          | Object describing the extra options for a Synthetic test.                                                                                                                                                                                                        |
| options         | min_failure_duration                 | int64           | Minimum amount of time in failure required to trigger an alert.                                                                                                                                                                                                  |
| options         | min_location_failed                  | int64           | Minimum number of locations in failure required to trigger an alert.                                                                                                                                                                                             |
| options         | monitor_name                         | string          | The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.                                                                                                                                                              |
| options         | monitor_options                      | object          | Object containing the options for a Synthetic test as a monitor (for example, renotification).                                                                                                                                                                   |
| monitor_options | escalation_message                   | string          | Message to include in the escalation notification.                                                                                                                                                                                                               |
| monitor_options | notification_preset_name             | enum            | The name of the preset for the notification for the monitor. Allowed enum values: `show_all,hide_all,hide_query,hide_handles,hide_query_and_handles,show_only_snapshot,hide_handles_and_footer`                                                                  |
| monitor_options | renotify_interval                    | int64           | Time interval before renotifying if the test is still failing (in minutes).                                                                                                                                                                                      |
| monitor_options | renotify_occurrences                 | int64           | The number of times to renotify if the test is still failing.                                                                                                                                                                                                    |
| options         | monitor_priority                     | int32           | Integer from 1 (high) to 5 (low) indicating alert severity.                                                                                                                                                                                                      |
| options         | restricted_roles                     | [string]        | **DEPRECATED**: 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.                                                       |
| options         | retry                                | object          | Object describing the retry strategy to apply to a Synthetic test.                                                                                                                                                                                               |
| retry           | count                                | int64           | Number of times a test needs to be retried before marking a location as failed. Defaults to 0.                                                                                                                                                                   |
| retry           | interval                             | double          | Time interval between retries (in milliseconds). Defaults to 300ms.                                                                                                                                                                                              |
| options         | scheduling                           | object          | Object containing timeframes and timezone used for advanced scheduling.                                                                                                                                                                                          |
| scheduling      | timeframes [*required*]         | [object]        | Array containing objects describing the scheduling pattern to apply to each day.                                                                                                                                                                                 |
| timeframes      | day [*required*]                | int32           | Number representing the day of the week.                                                                                                                                                                                                                         |
| timeframes      | from [*required*]               | string          | The hour of the day on which scheduling starts.                                                                                                                                                                                                                  |
| timeframes      | to [*required*]                 | string          | The hour of the day on which scheduling ends.                                                                                                                                                                                                                    |
| scheduling      | timezone [*required*]           | string          | Timezone in which the timeframe is based.                                                                                                                                                                                                                        |
| options         | tick_every                           | int64           | The frequency at which to run the Synthetic test (in seconds).                                                                                                                                                                                                   |
| attributes      | public_id                            | string          | The public ID for the test.                                                                                                                                                                                                                                      |
| attributes      | status                               | enum            | Define whether you want to start (`live`) or pause (`paused`) a Synthetic test. Allowed enum values: `live,paused`                                                                                                                                               |
| attributes      | subtype                              | enum            | Subtype of the Synthetic Network Path test: `tcp`, `udp`, or `icmp`. Allowed enum values: `tcp,udp,icmp`                                                                                                                                                         |
| attributes      | tags                                 | [string]        | Array of tags attached to the test.                                                                                                                                                                                                                              |
| attributes      | type [*required*]               | enum            | Type of the Synthetic test, `network`. Allowed enum values: `network`                                                                                                                                                                                            |
| data            | id                                   | string          | The public ID of the Network Path test.                                                                                                                                                                                                                          |
| data            | type                                 | enum            | Type of response, `network_test`. Allowed enum values: `network_test`                                                                                                                                                                                            |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "destination_service": "string",
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "source_service": "string",
          "tcp_method": "prefer_sack",
          "timeout": "integer",
          "traceroute_queries": 3
        }
      },
      "locations": [
        "aws:us-east-1",
        "agent:my-agent-name"
      ],
      "message": "Network Path test notification",
      "monitor_id": 12345678,
      "name": "Example Network Path test",
      "options": {
        "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",
        "restricted_roles": [
          "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        ],
        "retry": {
          "count": "integer",
          "interval": "number"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        },
        "tick_every": "integer"
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "id": "abc-def-123",
    "type": "network_test"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
API error response.
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
API error response.
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export public_id="CHANGE_ME" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get a Network Path test returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.synthetics_api import SyntheticsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = SyntheticsApi(api_client)
    response = api_instance.get_synthetics_network_test(
        public_id="c7a-uwa-wn2",
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get a Network Path test returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SyntheticsAPI.new
p api_instance.get_synthetics_network_test("c7a-uwa-wn2")
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get a Network Path 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/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSyntheticsApi(apiClient)
	resp, r, err := api.GetSyntheticsNetworkTest(ctx, "c7a-uwa-wn2")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.GetSyntheticsNetworkTest`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.GetSyntheticsNetworkTest`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get a Network Path test returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SyntheticsApi;
import com.datadog.api.client.v2.model.SyntheticsNetworkTestResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    SyntheticsApi apiInstance = new SyntheticsApi(defaultClient);

    try {
      SyntheticsNetworkTestResponse result = apiInstance.getSyntheticsNetworkTest("c7a-uwa-wn2");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SyntheticsApi#getSyntheticsNetworkTest");
      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](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get a Network Path test returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api
        .get_synthetics_network_test("c7a-uwa-wn2".to_string())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) 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 run
##### 

```typescript
/**
 * Get a Network Path test returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.SyntheticsApi(configuration);

const params: v2.SyntheticsApiGetSyntheticsNetworkTestRequest = {
  publicId: "c7a-uwa-wn2",
};

apiInstance
  .getSyntheticsNetworkTest(params)
  .then((data: v2.SyntheticsNetworkTestResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
