For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/synthetics/edit-a-network-path-test.md. A documentation index is available at /llms.txt.
Language
Datadog site

Edit a Network Path test

PUThttps://api.datadoghq.com/api/v2/synthetics/tests/network/{public_id}https://api.us3.datadoghq.com/api/v2/synthetics/tests/network/{public_id}https://api.us5.datadoghq.com/api/v2/synthetics/tests/network/{public_id}https://api.datadoghq.eu/api/v2/synthetics/tests/network/{public_id}https://api.ap1.datadoghq.com/api/v2/synthetics/tests/network/{public_id}https://api.ap2.datadoghq.com/api/v2/synthetics/tests/network/{public_id}https://api.uk1.datadoghq.com/api/v2/synthetics/tests/network/{public_id}https://api.ddog-gov.com/api/v2/synthetics/tests/network/{public_id}https://api.us2.ddog-gov.com/api/v2/synthetics/tests/network/{public_id}

Overview

This endpoint requires any of the following permissions:

  • synthetics_write
  • synthetics_create_edit_trigger

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Arguments

Path Parameters

Name
Type
Description
public_id [required]
string

The public ID of the Network Path test to edit.

Request

Body Data (required)

New Network Path test details to be saved.

Field
Type
Description
data [required]
object

Data object for creating or editing a Network Path test.

Response

OK

Network Path test response.

Field
Type
Description
data
object

Network Path test response data.

Code Example

Edit a Network Path test
# 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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
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/v2/synthetics/tests/network/${public_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "assertions": [
          {
            "operator": "lessThan",
            "property": "avg",
            "target": 500,
            "type": "latency"
          }
        ],
        "request": {
          "e2e_queries": 50,
          "host": "",
          "max_ttl": 30,
          "port": 443,
          "tcp_method": "prefer_sack",
          "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": {
        "monitor_options": {
          "notification_preset_name": "show_all"
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            },
            {
              "day": 3,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        }
      },
      "public_id": "abc-def-123",
      "status": "live",
      "subtype": "tcp",
      "tags": [
        "env:production"
      ],
      "type": "network"
    },
    "type": "network"
  }
}
EOF