Update a mock server

PUT https://api.getpostman.com/mocks/{{mockUid}}

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;06040138-dd6b-4cce-9a02-7e1c1ab59723&quot;,&quot;owner&quot;:&quot;11582779&quot;,&quot;uid&quot;:&quot;11582779-06040138-dd6b-4cce-9a02-7e1c1ab59723&quot;,&quot;collection&quot;:&quot;11582779-fd6797e2-de6b-4699-975c-85290e4c2499&quot;,&quot;mockUrl&quot;:&quot;https://06040138-dd6b-4cce-9a02-7e1c1ab59723.mock.pstmn.io&quot;,&quot;name&quot;:&quot;Test Mock Server&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-03-22T05:48:43.000Z&quot;,&quot;updatedAt&quot;:&quot;2022-03-22T06:50:34.000Z&quot;,&quot;environment&quot;:&quot;11582779-ac1b6608-deb7-4c05-9d48-ee775aabfc19&quot;}}