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 returnsapplication/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 anAuthorization header of the form Token <api-key>:
request
Basic authentication (legacy)
Pass anAuthorization header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string
username:api-key.
request
<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 anAuthorization 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:
/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.