PUT
/
v1
/
variables
/
{key}
Update an environment variable
curl --request PUT \
  --url https://api.checklyhq.com/v1/variables/{key} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "API_KEY",
  "value": "bAxD7biGCZL6K60Q",
  "locked": false,
  "secret": false
}'
{
  "key": "API_KEY",
  "value": "<string>",
  "locked": false,
  "secret": false
}

Overview

The Update Environment Variable endpoint allows you to modify existing environment variables in your Checkly account. You can update variable values, security settings, and other configuration options. Common Use Cases:
  • Variable Value Updates
  • Security Setting Changes
  • Configuration Management
  • Variable Maintenance
Updating environment variables will affect all checks and scripts that reference them. Ensure proper testing before making changes to production variables.
Changes to environment variables take effect immediately across all checks. Use caution when updating variables used in critical monitoring scenarios.

Authorizations

Authorization
string
header
required

The Checkly Public API uses API keys to authenticate requests. You can get the API Key here.

Your API key is like a password: keep it secure!

Authentication to the API is performed using the Bearer auth method in the Authorization header and using the account ID.

For example, set Authorization header while using cURL:

curl -H "Authorization: Bearer [apiKey]" "X-Checkly-Account: [accountId]"

Headers

x-checkly-account
string

Your Checkly account ID, you can find it at https://app.checklyhq.com/settings/account/general

Path Parameters

key
string
required

Body

application/json
value
string
required

The value of the environment variable.

Example:

"bAxD7biGCZL6K60Q"

key
string

The key of the environment variable (this value cannot be changed).

Example:

"API_KEY"

locked
boolean
default:false

Used only in the UI to hide the value like a password.

secret
boolean
default:false

Set an environment variable as secret. Once set, its value cannot be unlocked.

Response

Successful

key
string
required

The key of the environment variable (this value cannot be changed).

Example:

"API_KEY"

value
string
required
locked
boolean
default:false

Used only in the UI to hide the value like a password.

secret
boolean
default:false

Set an environment variable as secret. Once set, its value cannot be unlocked.