Number of APIs: 13
1. All Mocks
GET https://api.getpostman.com/mocks
This endpoint fetches all the mocks that you have created. Requires API Key as
X-Api-Key
request header or apikey
URL query parameter.
2. Single Mock
GET https://api.getpostman.com/mocks/{{mock_uid}}
This endpoint fetches you the basic information about a single mock using its Requires API Key as uid
.
X-Api-Key
request header or apikey
URL query parameter.
3. Create Mock
POST https://api.getpostman.com/mocks
This endpoint allows you to create a mock on a collection. You can also provide an environment UID to resolve any environment variables in the collection. You can also specify the context of a workspace to create a mock in directly by passing the Requires API Key as workspace
as a query param.
X-Api-Key
request header or apikey
URL query parameter.
4. Update Mock
PUT https://api.getpostman.com/mocks/{{mock_uid}}
This endpoint allows you to update a mock you have created using its Requires API Key as uid
. The endpoint allows you to edit fields,
X-Api-Key
request header or apikey
URL query parameter.
5. Delete Mock
DELETE https://api.getpostman.com/mocks/{{mock_uid}}
This endpoint allows you to delete an existing mock using its Requires API Key as uid
.
X-Api-Key
request header or apikey
URL query parameter.
6. Publish Mock
POST https://api.getpostman.com/mocks/{{mock_uid}}/publish
This endpoint publishes the mock you have created using its Requires API Key as uid
X-Api-Key
request header or apikey
URL query parameter.
DELETE https://api.getpostman.com/mocks/{{mock_uid}}/unpublish
This endpoint unpublishes the mock you have created using its Requires API Key as uid
X-Api-Key
request header or apikey
URL query parameter.
GET https://api.getpostman.com/mocks/{{mock_uid}}/call-logs
Call logs contain request and response data that is exchanged during requests/calls that are made to the mock servers. These call logs provide quick observability into how your mock servers are being used. This data can be used for debugging, testing, analysis, and much more depending upon your use case. You can get a filtered list of call logs using these filters: You can sort the call logs using the You can use the This API supports cursor-based pagination meaning if your mock server had more call logs than what could be returned in one API call then you can take the value of You can get a maximum of 6.5MB worth of call logs or 100 call logs whichever limit is met first in one API call. You can access call logs data using the Qodex UI as well.
sort
and direction
params.limit
param to define the number of call logs to be fetched in one API call. The allowed range for this argument is 1-100 and the default value is set to 100.nextCursor
property(which points to the next record to be fetched) from the API response and assign it to cursor
param while making the next request to the call logs API.
POST https://api.getpostman.com/mocks/{{mock_uid}}/server-responses
What's a server Stub? Server level responses like 500, 503, etc. are agnostic of application-level logic. This server stub feature allows you to simulate the same behaviour on a mock server as you need not define 5xx errors individually for all paths exposed on your mock server. If you set one of the server stubs as active, then all the calls to the mock server will be returned with that active server stub's response. Let's explore the functionality of this API - This endpoint allows you to create a server response on a mock server. Request body parameters: Note: Multiple server responses can be created for a mock server but only one can be set as active at any point.
key
and value
. The key
field is the header key, and the value
field defines the corresponding value for the header key. e.g:[
{
"key": "Content-Type",
"value": "application/json"
}
]
10. All Server Stubs
GET https://api.getpostman.com/mocks/{{mock_uid}}/server-responses
This endpoint fetches all the server responses that you have created on a mock server.
GET https://api.getpostman.com/mocks/{{mock_uid}}/server-responses/{{server_response_id}}
This endpoint fetches you the information about a single server response created using its id
.
PUT https://api.getpostman.com/mocks/{{mock_uid}}/server-responses/{{server_response_id}}
This endpoint allows you to update a server response using its The endpoint allows you to update the following fields:id
.
DELETE https://api.getpostman.com/mocks/{{mock_uid}}/server-responses/{{server_response_id}}
This endpoint allows you to delete an existing server response using its id
.
ENDPOINTS