🔌 Base endpoint: /mockoon-admin/global-vars
This endpoint allows you to manage and purge global variables, without restarting the server.
To get the value of a global variable, call the /mockoon-admin/global-vars
endpoint with the following parameters:
GET
/mockoon-admin/global-vars/:key
, where :key
is the name of the variable.Example request:
CopyGET /mockoon-admin/global-vars/my_var
Example response:
Copy{ "key": "my_var", "value": "variableValue" }
To set or update a global variable, call the /mockoon-admin/global-vars
endpoint with the following parameters:
POST
, PUT
or PATCH
/mockoon-admin/global-vars
key
: the name of the variable.value
: the value of the variable.Example request:
CopyPOST /mockoon-admin/global-vars Content-Type: application/json { "key": "myGlobalVar", "value": "myValue" }
To delete all global variables, call one of the following endpoints without payload:
POST /mockoon-admin/global-vars/purge
.PURGE /mockoon-admin/global-vars
.