Logo
15_Days_of_Postman_-_for_testers_IvanKo API Documentation

Get all mock servers

GET {{baseUrl}}/mocks

Gets all mock servers. By default, this endpoint returns only mock servers you created across all workspaces.

Note:

If you pass both the teamId and workspace query parameters, this endpoint only accepts the workspace query.

 

Body PARAM

Key Datatype Required Description 
teamId
string Return only mock servers that belong the given team ID.
workspace
string Return only mock servers in the given workspace.



HEADERS

Key Datatype Required Description 




RESPONSES

status OK

{ "mocks": [ { "id": "e3d951bf-873f-49ac-a658-b2dcb91d3289", "owner": "12345678", "uid": "12345678-e3d951bf-873f-49ac-a658-b2dcb91d3289", "collection": "12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2", "mockUrl": "https://e3d951bf-873f-49ac-a658-b2dcb91d3289.mock.pstmn.io", "name": "Test Mock A", "config": { "headers": [], "matchBody": false, "matchQueryParams": true, "matchWildcards": true, "delay": { "type": "fixed", "duration": 140000 }, "serverResponseId": null }, "createdAt": "2022-07-25T20:54:30.000Z", "updatedAt": "2022-07-25T20:54:30.000Z", "isPublic": false, // If true, the mock server is public and visible to all users. This field does not indicate the mock server's access control status. "environment": "12345678-5daabc50-8451-43f6-922d-96b403b4f28e" }, { "id": "c929c990-59f1-480a-aea4-c37e25c8785d", "owner": "12345678", "uid": "12345678-b86af87f-7e1f-4476-85bb-c1f71424fd5e", "collection": "12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2", "mockUrl": "https://c929c990-59f1-480a-aea4-c37e25c8785d.mock.pstmn.io", "name": "Test", "config": { "headers": [], "matchBody": false, "matchHeader": false, "matchQueryParams": true, "matchWildcards": true, "delay": null, "serverResponseId": null }, "createdAt": "2023-06-30T12:57:40.000Z", "updatedAt": "2023-06-30T12:57:40.000Z", "isPublic": false, // If true, the mock server is public and visible to all users. This field does not indicate the mock server's access control status. "environment": "12345678-5daabc50-8451-43f6-922d-96b403b4f28e" } ] }



Curl
curl -X GET 'https://api.getpostman.com/mocks?teamId=<integer>&workspace=<string>'

ENDPOINTS