Number of APIs: 13
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.
GET https://api.getpostman.com/mocks/{{mockUid}}
Gets information about a mock server.
POST https://api.getpostman.com/mocks?workspace={{workspaceId}}
Creates a mock server in a collection. Include a You can include the following optional properties in the request body:mock
object in the request body that contains following properties:
collection
— A string that contians the collection ID.
environment
— A string that contains the environment ID to associate with the mock server.name
— A string that contains the the mock server's name.
DELETE https://api.getpostman.com/mocks/{{mockUid}}
Deletes a mock server.
POST https://api.getpostman.com/mocks/{{mockUid}}/publish
Publishes a mock server. Publishing a mock server sets its Access Control configuration setting to public.
DELETE https://api.getpostman.com/mocks/{{mockUid}}/unpublish
Unpublishes a mock server. Unpublishing a mock server sets its Access Control configuration setting to private.
GET https://api.getpostman.com/mocks/{{mockUid}}/call-logs
Gets a mock server's call logs. You can get a maximum of 6.5MB of call logs or a total of 100 call logs, whichever limit is met first in one API call. Call logs contain exchanged request and response data made to mock servers. The logs provide visibility into how the mock servers are being used. You can log data to debug, test, analyze, and more, depending upon the use case.
GET https://api.getpostman.com/mocks/{{mockUid}}/server-responses/{{serverResponseId}}
Gets information about a mock server's server stub.
DELETE https://api.getpostman.com/mocks/{{mockUid}}/server-responses/{{serverResponseId}}
Deletes a mock server's sever response stub.
GET https://api.getpostman.com/mocks
Gets all mock servers.
GET https://api.getpostman.com/mocks/{{mockUid}}/server-responses
Gets all of a mock server's server stubs.
PUT https://api.getpostman.com/mocks/{{mockUid}}/server-responses/{{serverResponseId}}
Updates a mock server's server stub. Include at least one of the following properties in the request body:
name
— A string that contains the server response's name.statusCode
— A string that contains the server stub's response code. This property only accepts 5xx values.headers
— An array of objects that contains the server stub's headers:
key
— A string that contains the header's key.value
— A string that contains the header key's value. This value defines the corresponding value for the header key.body
— A string that contains a response body that returns when you call the mock server.
POST https://api.getpostman.com/mocks/{{mockUid}}/server-responses
Creates a server response stub. Server response stubs let you simulate 5xx server level responses, such as 500 or 503. Server level responses, such as 500 or 503, are agnostic to application-level logic. Server stubs let you simulate this behavior on a mock server. You do not need to define each error for all exposed paths on the mock server. If you set a server stubs as active, then all the calls to the mock server return with that active server stub's response. You can create multiple server responses for a mock server, but only one mock server can be set as active. You must include the following properties in the request body: You can also include the following optional properties:
name
— A string that contains the server response's name.statusCode
— An integer that contains the server stub's 5xx response code. This property only accepts 5xx values.
headers
— An array of objects that contains the server stub's headers:
key
— A string that contains the header's key.value
— A string that contains the header key's value. This value defines the corresponding value for the header key.body
— A string that contains a response body that returns when you call the mock server.
ENDPOINTS