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

Patch a test suite

PATCHhttps://api.datadoghq.com/api/v2/synthetics/suites/{public_id}/jsonpatchhttps://api.us3.datadoghq.com/api/v2/synthetics/suites/{public_id}/jsonpatchhttps://api.us5.datadoghq.com/api/v2/synthetics/suites/{public_id}/jsonpatchhttps://api.datadoghq.eu/api/v2/synthetics/suites/{public_id}/jsonpatchhttps://api.ap1.datadoghq.com/api/v2/synthetics/suites/{public_id}/jsonpatchhttps://api.ap2.datadoghq.com/api/v2/synthetics/suites/{public_id}/jsonpatchhttps://api.uk1.datadoghq.com/api/v2/synthetics/suites/{public_id}/jsonpatchhttps://api.ddog-gov.com/api/v2/synthetics/suites/{public_id}/jsonpatchhttps://api.us2.ddog-gov.com/api/v2/synthetics/suites/{public_id}/jsonpatch

Présentation

Patch a Synthetic test suite using JSON Patch (RFC 6902). Use partial updates to modify only specific fields of a test suite.

Common operations include:

  • Replace field values: {"op": "replace", "path": "/name", "value": "new_name"}
  • Add/update tags: {"op": "add", "path": "/tags/-", "value": "new_tag"}
  • Remove fields: {"op": "remove", "path": "/message"}

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

Paramètres du chemin

Name
Type
Description
public_id [required]
string

The public ID of the Synthetic test suite to patch.

Requête

Body Data (required)

JSON Patch document with operations to apply.

Champ
Type
Description
data [required]
object

Data object for a JSON Patch request on a Synthetic test suite.

Réponse

OK

Synthetics suite response

Champ
Type
Description
data
object

Synthetics suite response data

Exemple de code

Patch a test suite
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF
# Path parameters
export public_id="123-abc-456"

# 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 PATCH "https://api.${DD_SITE}/api/v2/synthetics/suites/${public_id}/jsonpatch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "json_patch": [
        {
          "op": "add",
          "path": "/name"
        }
      ]
    },
    "type": "suites_json_patch"
  }
}
EOF