GET/v1/env

List environment variables

List environment variables. Values are omitted for both config and secret variables.

Requires ENVIRONMENT_VARIABLES:READ.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Query parameters

page:integeroptional
Page number of paginated results, starting at 1.
Default: 1
per_page:integeroptional
Number of items per page. Defaults to 20. Continue requesting subsequent pages until the accumulated item count reaches result_info.total_count or a page is empty.
Default: 20
search:stringoptional
Case-insensitive substring search on environment variable names.

Responses

StatusMeaningDescription
200OKPaginated environment variable metadata.
400Bad RequestValidation error
401UnauthorizedUnauthenticated
403ForbiddenForbidden
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:object[]
result_info:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/env
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": []
}

POST/v1/env

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

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Body parameters

name:string
Case-sensitive name matching [A-Z_][A-Z0-9_]{0,63}, unique within the organization.
type:string
Immutable variable type. Config values are readable and unsuitable for credentials; secret values are write-only.
Accepted values: "config" | "secret"
value:string
Value of the variable, limited to 8 KiB of UTF-8. Secret values are write-only and never appear in API responses.

Responses

StatusMeaningDescription
201CreatedEnvironment variable created. Config responses include the value; secret responses contain metadata only.
400Bad RequestValidation error
401UnauthorizedUnauthenticated
403ForbiddenForbidden
409ConflictThe organization has 1,000 variables (environment_variable_limit_reached) or the name already exists (environment_variable_name_conflict)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:any
*anonymous*:objectoptional
*anonymous*:objectoptional
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

POST
/v1/env
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/v1/env/{environment_variable_id}

Get an environment variable

Get an environment variable. Config responses include the value; secret responses do not.

Requires ENVIRONMENT_VARIABLES:READ.

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

environment_variable_id:string
Environment variable ID.

Responses

StatusMeaningDescription
200OKEnvironment variable detail.
400Bad RequestInvalid request
401UnauthorizedUnauthenticated
403ForbiddenForbidden
404Not FoundEnvironment variable not found in this organization (environment_variable_not_found)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:any
*anonymous*:objectoptional
*anonymous*:objectoptional
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/env/{environment_variable_id}
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": []
}

PATCH/v1/env/{environment_variable_id}

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

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

environment_variable_id:string
Environment variable ID.

Body parameters

name:stringoptional
Case-sensitive name matching [A-Z_][A-Z0-9_]{0,63}, unique within the organization.
value:stringoptional
Value of the variable, limited to 8 KiB of UTF-8. Secret values are write-only and never appear in API responses.

Responses

StatusMeaningDescription
200OKEnvironment variable updated. Config responses include the value; secret responses contain metadata only.
400Bad RequestValidation error
401UnauthorizedUnauthenticated
403ForbiddenForbidden
404Not FoundEnvironment variable not found in this organization (environment_variable_not_found)
409ConflictThe new name already exists (environment_variable_name_conflict)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:any
*anonymous*:objectoptional
*anonymous*:objectoptional
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

PATCH
/v1/env/{environment_variable_id}
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/v1/env/{environment_variable_id}

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

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

environment_variable_id:string
Environment variable ID.

Responses

StatusMeaningDescription
200OKEnvironment variable deleted.
400Bad RequestInvalid request
401UnauthorizedUnauthenticated
403ForbiddenForbidden
404Not FoundEnvironment variable not found in this organization (environment_variable_not_found)
409ConflictThe variable is referenced by saved uptime check headers, HTTP Basic Auth usernames or passwords, or a webhook URL template (environment_variable_in_use)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorInternal server error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

DELETE
/v1/env/{environment_variable_id}
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": []
}

Was this page helpful?