Logo
30 days challenge API Documentation

Update Server Stub

PUT https://api.getpostman.com/mocks/{{mock_uid}}/server-responses/{{server_response_id}}

This endpoint allows you to update a server response using its id.

The endpoint allows you to update the following fields:

  • name
  • statusCode
  • headers
  • body

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 




RESPONSES

status OK

{ "createdAt": "2022-05-02T09:38:04.000Z", "updatedAt": "2022-05-02T09:38:04.000Z", "id": "7a2cd600-cf51-4e8a-b802-5e458828f4e5", "name": "Service Unavailable", "statusCode": 503, "headers": [ { "key": "Content-type", "value": "application/json" } ], "language": null, "body": "{\n \"message\": \"Service is temporarily unavailable due to maintenance. Please reach out to support if the problem persists.\"\n}", "createdBy": "1", "updatedBy": "1", "mock": "69105a6d-7f3e-4662-b116-f92dad8d9f06" }



Curl
curl -X PUT 'https://api.getpostman.com/mocks/undefined/server-responses/undefined' -d '{"serverResponse":{"name":"Service Unavailable","statusCode":503,"headers":[{"key":"Content-type","value":"application/json"}],"body":"{\n \"message\": \"Service is temporarily unavailable due to maintenance. Please reach out to support if the problem persists.\"\n}"}}'

ENDPOINTS