GET
/
v1
/
variables
List all environment variables
curl --request GET \
  --url https://api.checklyhq.com/v1/variables \
  --header 'Authorization: <api-key>'
[
  {
    "key": "API_KEY",
    "value": "<string>",
    "locked": false,
    "secret": false
  }
]

Overview

Environment variables allow you to store configuration values, API keys, and other data that can be used across your checks and check groups. This endpoint returns all environment variables configured in your account.

Response Example

{
  "data": [
    {
      "id": "var_123456789",
      "key": "API_BASE_URL",
      "value": "https://api.production.com",
      "locked": false,
      "description": "Base URL for production API endpoints",
      "usage": {
        "checksCount": 15,
        "checkGroupsCount": 3
      },
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-20T14:45:00.000Z"
    },
    {
      "id": "var_987654321",
      "key": "SECRET_API_KEY",
      "value": "***masked***",
      "locked": true,
      "description": "Authentication key for external service",
      "usage": {
        "checksCount": 8,
        "checkGroupsCount": 2
      },
      "createdAt": "2024-01-10T08:15:00.000Z",
      "updatedAt": "2024-01-18T16:20:00.000Z"
    },
    {
      "id": "var_456789123",
      "key": "DATABASE_CONNECTION_STRING",
      "value": "***masked***",
      "locked": true,
      "description": "Primary database connection string",
      "usage": {
        "checksCount": 5,
        "checkGroupsCount": 1
      },
      "createdAt": "2024-01-12T14:20:00.000Z",
      "updatedAt": "2024-01-19T09:30:00.000Z"
    },
    {
      "id": "var_789123456",
      "key": "STAGING_ENV",
      "value": "staging",
      "locked": false,
      "description": "Environment identifier for staging checks",
      "usage": {
        "checksCount": 12,
        "checkGroupsCount": 4
      },
      "createdAt": "2024-01-08T11:45:00.000Z",
      "updatedAt": "2024-01-16T13:15:00.000Z"
    }
  ],
  "meta": {
    "currentPage": 1,
    "totalPages": 1,
    "totalItems": 4,
    "limit": 10
  }
}

Common Use Cases

API Configuration

Store API endpoints, tokens, and authentication credentials
GET /v1/variables?key=API_*

Environment Settings

Configure different values for staging, production, and development
GET /v1/variables?key=*_ENV

Shared Data

Share common values across multiple checks and check groups
GET /v1/variables?locked=false

Security

Store sensitive values securely with encryption
GET /v1/variables?locked=true

Additional Examples

curl -X GET "https://api.checklyhq.com/v1/variables?locked=false" \
  -H "Authorization: Bearer cu_1234567890abcdef" \
  -H "X-Checkly-Account: 550e8400-e29b-41d4-a716-446655440000"
Locked environment variables are encrypted and their values are masked in API responses for security. Use the usage field to understand which checks depend on each variable.

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

Query Parameters

limit
integer
default:10

Limit the number of results

Required range: 1 <= x <= 100
page
number
default:1

Page number

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.