Skip to main content
Use the WireMock Cloud API to automate mock API setup from tests, scripts and CI pipelines. WireMock Cloud has two APIs: a REST API at api.wiremock.cloud for managing mock APIs, teams and settings, and a WireMock-compatible admin API (/__admin) on each mock API for its stubs and requests.

Base URLs

The WireMock Cloud REST API is served from https://api.wiremock.cloud/v1. It accepts and returns application/json. Each mock API also has its own WireMock-compatible admin API at /__admin on the mock API’s base URL, for example https://example.wiremockapi.cloud/__admin. See Admin API security for how it is secured.

Authentication

There are three ways to authenticate yourself with the WireMock Cloud API:

API token authentication (preferred)

Pass an Authorization header of the form Token <api-key>:
request
Your API key can be retrieved from the web application at https://app.wiremock.cloud/account/security. Unfortunately while this is our preferred authentication mechanism, it is not supported by the OpenAPI 3.x specification so it is not the one that features in the generated documentation examples.

Basic authentication (legacy)

Pass an Authorization header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:api-key.
request
Your API key can be retrieved from the web application at https://app.wiremock.cloud/account/security. Unfortunately the generated documentation erroneously describes the <encoded-value> as the base64-encoded string username:password rather than username:api-key - at present we cannot fix this. See Calling the API with HTTP Basic authentication for examples in several languages.

OAuth 2.0 device authorization flow

An enterprise customer wishing to use OAuth 2.0 Access Tokens to authenticate to the WireMock Cloud API, e.g. from their own CLI, and happy to do more integration work, may request access by contacting the WireMock team and then implement the device authorization flow. They can then pass an Authorization header of the form {token_response.token_type} {token_response.access_token}:
request

WireMock admin API

Each mock API serves the WireMock admin API at /__admin on its own base URL, as if it were a standalone WireMock server. Existing WireMock client libraries and scripts work against it - point them at the mock API’s base URL and send your API token. For example, to list a mock API’s stubs:
Automated testing with Java shows the WireMock Java client used this way. The REST API’s /v1/mock-apis/<mock-api-id>/mappings, /requests and /recordings endpoints, shown below, provide the same operations through api.wiremock.cloud. See Admin API security for how to secure it, or make it public.

Main resources

The examples below use API token authentication. Replace <mock-api-id> with your mock API’s ID.

Mock APIs

Create, update, delete and share mock APIs. See Mock APIs for a worked example.

Stub mappings

Create, list, update and delete the stubs in a mock API. The request body uses the same JSON format as WireMock.

Imports

Import OpenAPI, Postman, HAR or WireMock files into a mock API. See Importing via the API.

Requests

Query, verify and reset the requests a mock API has received. See Request log.

Recordings

Start and stop recording from another API.

Settings

Read and change a mock API’s settings, such as chaos, delays and rate limits.

Users, organisations and teams

Get and update your own user details, get your organisation’s product usage, and manage organisation members and teams.

Documentation

The full API is documented under API Reference.