Logo
30 days challenge API Documentation

Update Mock

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

This endpoint allows you to update a mock you have created using its uid. The endpoint allows you to edit fields,

  • name
  • environment
  • description
  • private
  • versionTag
  • config
    • serverResponseId - Sets server response as active.

Requires API Key as X-Api-Key request header or apikey URL query parameter.

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
Content-Type
string




RESPONSES

status OK

{ "mock": { "id": "f0115890-b935-4752-b00a-905b0e5a2372", "owner": "459596", "uid": "459596-f0115890-b935-4752-b00a-905b0e5a2372", "collection": "459596-83f8fe34-940c-4cc9-8770-0103aadc739c", "mockUrl": "https://f0115890-b935-4752-b00a-905b0e5a2372.mock-beta.pstmn.io", "name": "Server stub testing", "config": { "headers": [], "matchBody": false, "matchQueryParams": true, "matchWildcards": true, "delay": null, "serverResponseId": null }, "createdAt": "2022-03-22T05:48:43.000Z", "updatedAt": "2022-03-22T06:52:51.000Z" } }



Curl
curl -X PUT 'https://api.getpostman.com/mocks/undefined' -H 'Content-Type: application/json' -d '{"mock":{"name":"My Mock Server","environment":"11582779-ac1b6608-deb7-4c05-9d48-ee775aabfc19","description":"example describing update mock description","private":false,"versionTag":"abf07d3d-f8ec-47d4-8015-9fe83078b4ec","config":{"serverResponseId":"7a2cd600-cf51-4e8a-b802-5e458828f4e5"}}}'

ENDPOINTS