List environment variables
List environment variables. Values are omitted for both config and secret variables.
Requires ENVIRONMENT_VARIABLES:READ.
Header parameters
Query parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Paginated environment variable metadata. |
| 400 | Bad Request | Validation error |
| 401 | Unauthorized | Unauthenticated |
| 403 | Forbidden | Forbidden |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Internal server error |
Response Schema
Request
curl --request GET \
--url https://api.onlineornot.com/v1/env \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
Response
{
"result": [
{
"id": "a1b2c3d4e5f6g7h8",
"name": "API_TOKEN",
"type": "secret",
"has_value": true,
"created_at": "2026-09-20T12:00:00.000Z",
"updated_at": "2026-09-20T12:00:00.000Z"
}
],
"result_info": {
"page": 1,
"per_page": 20,
"count": 1,
"total_count": 1
},
"success": true,
"errors": [],
"messages": []
}
Create an environment variable
Create a reusable config or secret for uptime check request headers, HTTP Basic Auth usernames and passwords, and webhook URL templates. Reference variables using . Each uptime check supports at most 32 distinct variable references across its headers and HTTP Basic Auth combined. Browser checks do not support environment variable references. See variable-backed webhook URL examples. Config values are readable; secrets are write-only. A variable's type cannot be changed after creation. Anyone who can edit uptime checks can use variables from the same organization. Exact secret values are automatically redacted from results; encoded or transformed values may remain visible.
Requires ENVIRONMENT_VARIABLES:EDIT.
Header parameters
Body parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 201 | Created | Environment variable created. Config responses include the value; secret responses contain metadata only. |
| 400 | Bad Request | Validation error |
| 401 | Unauthorized | Unauthenticated |
| 403 | Forbidden | Forbidden |
| 409 | Conflict | The organization has 1,000 variables (environment_variable_limit_reached) or the name already exists (environment_variable_name_conflict) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Internal server error |
Response Schema
Request
curl --request POST \
--url https://api.onlineornot.com/v1/env \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--data '{"name":"PRIMARY_REGION","type":"config","value":"us-east-1"}'
Response
{
"result": {
"id": "a1b2c3d4e5f6g7h8",
"name": "API_TOKEN",
"type": "secret",
"has_value": true,
"created_at": "2026-09-20T12:00:00.000Z",
"updated_at": "2026-09-20T12:00:00.000Z"
},
"success": true,
"errors": [],
"messages": []
}
Get an environment variable
Get an environment variable. Config responses include the value; secret responses do not.
Requires ENVIRONMENT_VARIABLES:READ.
Header parameters
Path parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Environment variable detail. |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Unauthenticated |
| 403 | Forbidden | Forbidden |
| 404 | Not Found | Environment variable not found in this organization (environment_variable_not_found) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Internal server error |
Response Schema
Request
curl --request GET \
--url https://api.onlineornot.com/v1/env/a1b2c3d4e5f6g7h8 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
Response
{
"result": {
"id": "a1b2c3d4e5f6g7h8",
"name": "API_TOKEN",
"type": "secret",
"has_value": true,
"created_at": "2026-09-20T12:00:00.000Z",
"updated_at": "2026-09-20T12:00:00.000Z"
},
"success": true,
"errors": [],
"messages": []
}
Update an environment variable
Rename a variable, replace its value, or both. Renaming updates saved uptime check headers, HTTP Basic Auth usernames and passwords, and webhook URL templates. Type cannot be changed; secret values are never returned.
Requires ENVIRONMENT_VARIABLES:EDIT.
Header parameters
Path parameters
Body parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Environment variable updated. Config responses include the value; secret responses contain metadata only. |
| 400 | Bad Request | Validation error |
| 401 | Unauthorized | Unauthenticated |
| 403 | Forbidden | Forbidden |
| 404 | Not Found | Environment variable not found in this organization (environment_variable_not_found) |
| 409 | Conflict | The new name already exists (environment_variable_name_conflict) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Internal server error |
Response Schema
Request
curl --request PATCH \
--url https://api.onlineornot.com/v1/env/a1b2c3d4e5f6g7h8 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--data '{"value":"<replacement value>"}'
Response
{
"result": {
"id": "a1b2c3d4e5f6g7h8",
"name": "API_TOKEN",
"type": "secret",
"has_value": true,
"created_at": "2026-09-20T12:00:00.000Z",
"updated_at": "2026-09-20T12:00:00.000Z"
},
"success": true,
"errors": [],
"messages": []
}
Delete an environment variable
Delete an environment variable that is not referenced by a saved uptime check or webhook. References in uptime check headers, HTTP Basic Auth usernames and passwords, or webhook URL templates block deletion. References from paused checks also block deletion.
Requires ENVIRONMENT_VARIABLES:EDIT.
Header parameters
Path parameters
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Environment variable deleted. |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Unauthenticated |
| 403 | Forbidden | Forbidden |
| 404 | Not Found | Environment variable not found in this organization (environment_variable_not_found) |
| 409 | Conflict | The variable is referenced by saved uptime check headers, HTTP Basic Auth usernames or passwords, or a webhook URL template (environment_variable_in_use) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Internal server error |
Response Schema
Request
curl --request DELETE \
--url https://api.onlineornot.com/v1/env/a1b2c3d4e5f6g7h8 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
Response
{
"result": {
"id": "string"
},
"success": true,
"errors": [],
"messages": []
}