Create collection
POST https://api.getpostman.com/collections
This endpoint allows you to create collections using the Qodex Collection v2 format. For more information about the v2 schema, check the format here.
On successful creation of the collection, the response returns the collection name
, id
and the uid
.
Requires API Key as
X-Api-Key
request header orapikey
URL query parameter.
Request Body
{"collection"=>{"info"=>{"name"=>"Demo collection for mocking", "description"=>"This is just a sample collection.", "schema"=>"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"}, "item"=>[{"name"=>"Sample POST Request", "request"=>{"url"=>"https://postman-echo.com/post", "method"=>"POST", "header"=>[{"key"=>"Content-Type", "value"=>"application/json"}], "body"=>{"mode"=>"raw", "raw"=>"{\"data\": \"123\"}"}, "description"=>"This is a sample POST Request"}}, {"name"=>"Sample GET Request", "request"=>{"url"=>"https://postman-echo/get", "method"=>"GET", "description"=>"This is a sample GET Request"}}]}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-Api-Key | string | ||
Content-Type | string |
RESPONSES
status: OK
{"collection":{"id":"2412a72c-1d8e-491b-aced-93809c0e94e9","name":"Sample Collection","uid":"5852-2412a72c-1d8e-491b-aced-93809c0e94e9"}}