🔌 Base endpoint: /mockoon-admin/env-vars
This endpoint allows you to manage the environment variables, without restarting the mock server or the application.
To get the value of an environment variable, call the /mockoon-admin/env-vars
endpoint with the following parameters:
GET
/mockoon-admin/env-vars/:key
, where :key
is the name of the variable, including or not the MOCKOON_
prefix, or the custom prefix defined in the application settings.Example request:
CopyGET /mockoon-admin/env-vars/MOCKOON_ENV_VAR
Example response:
Copy{ "key": "MOCKOON_ENV_VAR", "value": "variableValue" }
To set or update an environment variable, call the /mockoon-admin/env-vars
endpoint with the following parameters:
POST
, PUT
or PATCH
/mockoon-admin/env-vars
key
: the name of the variable, including the MOCKOON_
prefix, or the custom prefix defined in the application settings.value
: the value of the variable.Example request:
CopyPOST /mockoon-admin/env-vars Content-Type: application/json { "key": "MOCKOON_ENV_VAR", "value": "myValue" }
⚠️ This will only create or update the environment variable for the running mock server. It will not modify your system environment variables.