Create a collection

POST https://api.getpostman.com/collections

Creates a collection using the [Qodex Collection v2 schema format]

Request Params

KeyDatatypeRequiredDescription
workspacestringOptional. A workspace ID in which to create the collection.

If you do not include this query parameter, the system creates the collection in your "My Workspace" workspace. |

Request Body

{"collection"=>{"info"=>{"name"=>"{{collectionName}}", "description"=>"{{collectionDescription}}", "schema"=>"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"}, "item"=>[{"name"=>"{{collectionFolderName}}", "id"=>"82ee981b-e19f-962a-401e-ea34ebfb4848", "event"=>[{"listen"=>"test", "script"=>{"id"=>"7d2334fc-a84a-4c3d-b26c-7529afa4c0ae", "exec"=>["pm.test(\"Status code is 200\", function () {", "    pm.response.to.have.status(200);", "});"], "type"=>"text/javascript"}}], "request"=>{"url"=>"https://echo.getpostman.com/headers", "method"=>"GET", "header"=>[{"key"=>"Content-Type", "value"=>"application/json"}]}}]}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

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