Logo
30 Days of Postman exercises API Documentation

Mocks

Number of APIs: 7


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 uid.

Requires API Key as 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 workspace as a query param.

Requires API Key as 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 uid. The endpoint allows you to edit fields, * name * environment * description * private * versionTag

Requires API Key as 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 uid.

Requires API Key as 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 uid

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



7. Unpublish Mock

DELETE https://api.getpostman.com/mocks/{{mock_uid}}/unpublish

This endpoint unpublishes the mock you have created using its uid

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



ENDPOINTS