POST
/
v1
/
mock-apis
/
{mockApiId}
/
imports
curl --request POST \
  --url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/imports \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: */*' \
  --data '{
  "mappings": [
    {
      "id": "<string>",
      "uuid": "<string>",
      "name": "<string>",
      "request": "{\n  \"urlPath\" : \"/charges\",\n  \"method\" : \"POST\",\n  \"headers\" : {\n    \"Content-Type\" : {\n      \"equalTo\" : \"application/json\"\n    }\n  }\n",
      "response": {
        "status": 123,
        "statusMessage": "<string>",
        "headers": {},
        "additionalProxyRequestHeaders": {},
        "removeProxyRequestHeaders": [
          "<string>"
        ],
        "body": "<string>",
        "base64Body": "<string>",
        "jsonBody": "<any>",
        "bodyFileName": "user-profile-responses/user1.json",
        "fault": "CONNECTION_RESET_BY_PEER",
        "fixedDelayMilliseconds": 123,
        "delayDistribution": {
          "median": 123,
          "sigma": 123,
          "type": "lognormal"
        },
        "chunkedDribbleDelay": {
          "numberOfChunks": 123,
          "totalDuration": 123
        },
        "fromConfiguredStub": true,
        "proxyBaseUrl": "<string>",
        "proxyUrlPrefixToRemove": "<string>",
        "transformerParameters": {},
        "transformers": [
          "<string>"
        ]
      },
      "persistent": true,
      "priority": 2,
      "scenarioName": "<string>",
      "requiredScenarioState": "<string>",
      "newScenarioState": "<string>",
      "postServeActions": {},
      "serveEventListeners": [
        {
          "name": "change-state",
          "parameters": {
            "operations": [
              {
                "operation": "SET",
                "context": "<string>",
                "key": "<string>",
                "value": "<string>"
              }
            ]
          }
        }
      ],
      "metadata": {}
    }
  ]
}'

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

mockApiId
string
required

The ID of the Mock API

Required string length: 5 - 10
Example:

"jjl8y"

Body

A JSON file containing WireMock stub mappings.

mappings
object[]
required

Response

200

Successfully imported