PUT
/
v1
/
mock-apis
/
{mockApiId}
/
mappings
/
{stubMappingId}
curl --request PUT \
  --url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/{stubMappingId} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "request": {
    "method": "GET",
    "url": "/some/thing"
  },
  "response": {
    "body": "Hello world!",
    "headers": {
      "Content-Type": "text/plain"
    },
    "status": 200
  }
}'
{
  "id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
  "priority": 3,
  "request": {
    "headers": {
      "Accept": {
        "equalTo": "text/plain"
      }
    },
    "method": "GET",
    "url": "/some/thing"
  },
  "response": {
    "body": "Hello world!",
    "headers": {
      "Content-Type": "text/plain"
    },
    "status": 200
  }
}

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
stubMappingId
string
required

The UUID of stub mapping

Body

application/json
id
string

This stub mapping's unique identifier

metadata
object

Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.

name
string

The stub mapping's name

newScenarioState
string

The new state for the scenario to be updated to after this stub is served.

persistent
boolean

Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.

postServeActions
object

A map of the names of post serve action extensions to trigger and their parameters.

priority
integer

This stub mapping's priority relative to others. 1 is highest.

Required range: x > 1
request
object
requiredScenarioState
string

The required state of the scenario in order for this stub to be matched.

response
object
scenarioName
string

The name of the scenario that this stub mapping is part of

serveEventListeners
object[]

The list of serve event listeners

uuid
string

Alias for the id

Response

200 - application/json
id
string

This stub mapping's unique identifier

metadata
object

Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.

name
string

The stub mapping's name

newScenarioState
string

The new state for the scenario to be updated to after this stub is served.

persistent
boolean

Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.

postServeActions
object

A map of the names of post serve action extensions to trigger and their parameters.

priority
integer

This stub mapping's priority relative to others. 1 is highest.

Required range: x > 1
request
object
requiredScenarioState
string

The required state of the scenario in order for this stub to be matched.

response
object
scenarioName
string

The name of the scenario that this stub mapping is part of

serveEventListeners
object[]

The list of serve event listeners

uuid
string

Alias for the id