Update a mock server
PUT https://api.getpostman.com/mocks/{{mockId}}
Updates a mock server. Include the mock
object in the request body with one or more of the following properties:
-
name
— A string that contains the mock server's name. -
environment
— A string that contains the environment UID. -
private
— A boolean value that, if true, sets the mock server as private. -
versionTag
— A string that contains the API's version tag ID. -
config
— An object that contains the following properties:-
serverResponseId
— A string that contains the server response ID. This sets the given server response as the default response for each request.
-
Request Body
{"mock"=>{"name"=>"{{mockName}}", "environment"=>"{{environmentUid}}", "private"=>"<boolean>", "versionTag"=>"{{apiVersionTagId}}", "config"=>{"serverResponseId"=>"{{serverResponseId}}"}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"mock":{"id":"e3d951bf-873f-49ac-a658-b2dcb91d3289","owner":"12345678","uid":"12345678-e3d951bf-873f-49ac-a658-b2dcb91d3289","collection":"12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2","mockUrl":"https://e3d951bf-873f-49ac-a658-b2dcb91d3289.mock.pstmn.io","name":"Test Mock","config":{"headers":[],"matchBody":false,"matchQueryParams":true,"matchWildcards":true,"delay":null,"serverResponseId":null},"createdAt":"2022-06-09T19:38:06.000Z","updatedAt":"2022-06-13T18:55:25.000Z","environment":"12345678-5daabc50-8451-43f6-922d-96b403b4f28e"}}