GET/v1/env

List environment variables

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

Requires ENVIRONMENT_VARIABLES:READ; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

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

Responses

StatusMeaningDescription
200OKPaginated environment variable metadata.
400Bad RequestValidation error
401UnauthorizedUnauthenticated
403ForbiddenForbidden
404Not FoundFeature disabled
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}' \
  --header 'X-OnlineOrNot-Organisation: string'

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 readable config or write-only secret variable. Type cannot be changed.

Requires ENVIRONMENT_VARIABLES:EDIT; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

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
404Not FoundFeature disabled
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' \
  --header 'X-OnlineOrNot-Organisation: string' \
  --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; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

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 or feature disabled
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}' \
  --header 'X-OnlineOrNot-Organisation: string'

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. Type cannot be changed; secret values are never returned.

Requires ENVIRONMENT_VARIABLES:EDIT; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

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 or feature disabled
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' \
  --header 'X-OnlineOrNot-Organisation: string' \
  --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.

Requires ENVIRONMENT_VARIABLES:EDIT; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

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 or feature disabled
409ConflictThe environment variable cannot be deleted (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}' \
  --header 'X-OnlineOrNot-Organisation: string'

Response

{
  "result": {
    "id": "string"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?