Admin API overview


Each running mock server exposes an admin API that allows you to manage your environment. This API can be used to automate the management of your mock server, especially in a remote environment, without having to restart the application.

 Admin API base endpoint

The admin API base endpoint is the same as the mock server URL with the /mockoon-admin path appended.

For example, if your mock server is running on http://localhost:3000, the admin API base endpoint will be http://localhost:3000/mockoon-admin.

 Disable the admin API

The admin API is enabled by default.

In the desktop application, the admin API cannot be disabled. However, you can disable it when running your mock with the CLI or the serverless library.

 Disable the admin API with the CLI

To disable the admin API when running your mock with the CLI, use the --disable-admin-api flag:

Copy
mockoon-cli start --disable-admin-api -d ./mock.json

 Disable the admin API with the serverless library

To disable the admin API when running your mock with the serverless library, set the enableAdminApi option to false when building the MockoonServerless instance:

Copy
const mockoonServerless = new mockoon.MockoonServerless(mockEnv, { enableAdminApi: false });

 Admin API capabilities

Currently, the admin API allows you to: