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-global-variable.md. A documentation index is available at /llms.txt.
Language
Datadog site

Edit a global variable

PUThttps://api.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.us3.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.us5.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.datadoghq.eu/api/v1/synthetics/variables/{variable_id}https://api.ap1.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.ap2.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.uk1.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.ddog-gov.com/api/v1/synthetics/variables/{variable_id}https://api.us2.ddog-gov.com/api/v1/synthetics/variables/{variable_id}

Overview

Edit a Synthetic global variable.

This endpoint requires the synthetics_global_variable_write permission.

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

Arguments

Path Parameters

Name
Type
Description
variable_id [required]
string

The ID of the global variable.

Request

Body Data (required)

Details of the global variable to update.

Field
Type
Description
attributes
object

Attributes of the global variable.

description [required]
string

Description of the global variable.

is_fido
boolean

Determines if the global variable is a FIDO variable.

is_totp
boolean

Determines if the global variable is a TOTP/MFA variable.

name [required]
string

Name of the global variable. Unique across Synthetic global variables.

parse_test_options
object

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

parse_test_public_id
string

A Synthetic test ID to use as a test to generate the variable value.

tags [required]
[string]

Tags of the global variable.

value
object

Value of the global variable.

Response

OK

Synthetic global variable.

Field
Type
Description
attributes
object

Attributes of the global variable.

description [required]
string

Description of the global variable.

id
string

Unique identifier of the global variable.

is_fido
boolean

Determines if the global variable is a FIDO variable.

is_totp
boolean

Determines if the global variable is a TOTP/MFA variable.

name [required]
string

Name of the global variable. Unique across Synthetic global variables.

parse_test_options
object

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

parse_test_public_id
string

A Synthetic test ID to use as a test to generate the variable value.

tags [required]
[string]

Tags of the global variable.

value [required]
object

Value of the global variable.

Code Example

Edit a global variable
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF
# Path parameters
export variable_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/v1/synthetics/variables/${variable_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Example description",
  "name": "MY_VARIABLE",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "secure": false,
    "value": "variable-value"
  }
}
EOF