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

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{&quot;mock&quot;:{&quot;id&quot;:&quot;e3d951bf-873f-49ac-a658-b2dcb91d3289&quot;,&quot;owner&quot;:&quot;12345678&quot;,&quot;uid&quot;:&quot;12345678-e3d951bf-873f-49ac-a658-b2dcb91d3289&quot;,&quot;collection&quot;:&quot;12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2&quot;,&quot;mockUrl&quot;:&quot;https://e3d951bf-873f-49ac-a658-b2dcb91d3289.mock.pstmn.io&quot;,&quot;name&quot;:&quot;Test Mock&quot;,&quot;config&quot;:{&quot;headers&quot;:[],&quot;matchBody&quot;:false,&quot;matchQueryParams&quot;:true,&quot;matchWildcards&quot;:true,&quot;delay&quot;:null,&quot;serverResponseId&quot;:null},&quot;createdAt&quot;:&quot;2022-06-09T19:38:06.000Z&quot;,&quot;updatedAt&quot;:&quot;2022-06-13T18:55:25.000Z&quot;,&quot;environment&quot;:&quot;12345678-5daabc50-8451-43f6-922d-96b403b4f28e&quot;}}