Skip to main content
POST
/
v1
/
mock-apis
/
{mockApiId}
/
recordings
/
start
Start recording
curl --request POST \
  --url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/recordings/start \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "targetBaseUrl": "http://example.mocklab.io",
  "filters": {
    "urlPathPattern": "/api/.*",
    "method": "GET"
  },
  "captureHeaders": {
    "Accept": {},
    "Content-Type": {
      "caseInsensitive": true
    }
  },
  "requestBodyPattern": {
    "matcher": "equalToJson",
    "ignoreArrayOrder": false,
    "ignoreExtraElements": true
  },
  "extractBodyCriteria": {
    "textSizeThreshold": "2048",
    "binarySizeThreshold": "10240"
  },
  "persist": false,
  "repeatsAsScenarios": false,
  "transformers": [
    "modify-response-header"
  ],
  "transformerParameters": {
    "headerValue": "123"
  }
}'

Authorizations

Authorization
string
header
required

Your API key prefixed by 'Token '

Path Parameters

mockApiId
string
required

The ID of the Mock API

Required string length: 5 - 10
Example:

"jjl8y"

Body

application/json
captureHeaders
object

Headers from the request to include in the generated stub mappings, mapped to parameter objects. The only parameter available is "caseInsensitive", which defaults to false

Example:
{
"Accept": {},
"Content-Type": { "caseInsensitive": true }
}
extractBodyCriteria
object

Criteria for extracting response bodies to a separate file instead of including it in the stub mapping

Example:
{
"binarySizeThreshold": "1 Mb",
"textSizeThreshold": "2 kb"
}
persist
boolean
default:true

Whether to save stub mappings to the file system or just return them

repeatsAsScenarios
boolean
default:true

When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded

requestBodyPattern
object

Control the request body matcher used in generated stub mappings Automatically determine matcher based on content type (the default)

  • Option 1
  • Option 2
  • Option 3
  • Option 4
transformerParameters
object

List of names of stub mappings transformers to apply to generated stubs

transformers
string[]

Parameters to pass to stub mapping transformers

filters
object

Filter requests for which to create stub mapping

Example:

"{\n \"urlPath\" : \"/charges\",\n \"method\" : \"POST\",\n \"headers\" : {\n \"Content-Type\" : {\n \"equalTo\" : \"application/json\"\n }\n }\n"

targetBaseUrl
string

Target URL when using the record and playback API

Example:

"https://example.wiremock.org"

Response

200

Successfully started recording

I