Create Collection for Mock Server

POST https://api.getpostman.com/collections?workspace={{workspaceId}}

Create Collection for Mock Server

Creates a Collection from one associated with the API in the API Builder, that we can use to spin up a Mock Server.

Overview

Body Tab

Sends the collectionFromApiBuilder variable that houses the JSON of the Collection that we need to build the Collection for the Mock Server.

Pre-request Script Tab

Sends a message to the Console that the Request is starting to create a Collection for the Mock Server.

Tests Tab

  1. Checks for a 200 HTTP response to confirm that the new Collection for the Mock Server has been created.
  2. Parse the Response.
  3. Save the new ID as secondCollectionUid Collection Variable.

Request Params

KeyDatatypeRequiredDescription
workspacestring

RESPONSES

status: OK

{"collection":{"id":"12ece9e1-2abf-4edc-8e34-de66e74114d2","name":"Test Collection","uid":"12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2"}}