Admin API: Global variables

This endpoint allows you to manage and purge global variables, without restarting the server.

 Set or update a global variable

To set or update a global variable, call the /mockoon-admin/global-vars endpoint with the following parameters:

  • Method: POST, PUT or PATCH
  • URL: /mockoon-admin/global-vars
  • Body: JSON object with the following properties:
    • key: the name of the variable.
    • value: the value of the variable.


POST /mockoon-admin/global-vars Content-Type: application/json { "key": "myGlobalVar", "value": "myValue" }

 Purge all global variables

To delete all global variables, call one of the following endpoints without payload:

  • POST /mockoon-admin/global-vars/purge.
  • PURGE /mockoon-admin/global-vars.