Skip to Content
Mock ServerAccess, logs, settings

Access, logs, settings

Open a mock server from the repository’s Publish Center to manage it. The summary card shows its name, type, update strategy, URL, the commit it serves and its last update.

A mock server's Setting page

The page has these views:

ViewSpec-basedCode-basedWhat it is for
LogsYesYesEvery request and response
StateNoYesInspect the stored state
Mock ScriptsNoYesThe scripts at the served commit
SettingYesYesEverything below

Logs

The Logs view shows each request with its method, path, status and time, and the response. For a code-based mock, it also shows what your code wrote with console.log. Credentials are removed from logs, including the APIGIT-Token and Authorization headers and cookies.

Mock server logs

Access control

A mock server is Public Access or API Token Required. Set this at publish, and change it at any time under Setting.

With API Token Required, a request without a valid token is refused with 401. Send the token in the APIGIT-Token header or as a query parameter:

curl https://petstore-sandbox.mockserver.apigit.com/api/v3/pet/1 \ -H 'APIGIT-Token: <token>' curl 'https://petstore-sandbox.mockserver.apigit.com/api/v3/pet/1?APIGIT-Token=<token>'

The token is shown on the Setting view, where Regenerate Token replaces it. Republishing and following a branch keep the token.

⚠️

Public mock servers accept HTTP requests from any source, and their URL is all anyone needs. Use a token when your document or examples are not meant to be seen.

Setting

SectionWhat you can do
GeneralSee the commit and type, copy the URL, edit the description. Enterprise plans can rename the mock server, which changes its URL.
Update StrategyPin the mock or follow a branch. See Pin or follow a branch.
Documents & Base PathsSpec-based only: add and remove documents, edit base paths, switch validation checks. See Documents and base paths.
Access ControlChoose public or token access, and regenerate the token
Danger ZoneRevoke Mock Server deletes the mock server and its configuration and state
Last updated on