POST https://api.getpostman.com/mocks
In Qodex v10 and higher you cannot create mocks for collections added to an API definition. 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 contains 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.
Body
PARAM
Key | Datatype | Required | Description |
workspace
|
string | Optional. A workspace ID in which to create the mock server. If you do not include this query parameter, the system creates the mock server in your "My Workspace" workspace. |
HEADERS
Key | Datatype | Required | Description |
Content-Type
|
string |
RESPONSES
status OK
{
"mock": {
"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",
"config": {
"headers": [],
"matchBody": false,
"matchQueryParams": true,
"matchWildcards": true,
"delay": null,
"serverResponseId": null
},
"createdAt": "2022-06-09T19:00:39.000Z",
"updatedAt": "2022-06-09T19:00:39.000Z",
"environment": "12345678-5daabc50-8451-43f6-922d-96b403b4f28e"
}
} |
ENDPOINTS