Logo
30 days of Postman - for developers API Documentation

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.

You can also specify the context of a workspace to create a collection in directly by passing the workspace as a query param.

Requires API Key as X-Api-Key request header or apikey URL query parameter.

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
Content-Type
string




RESPONSES

status OK

{ "collection": { "id": "2412a72c-1d8e-491b-aced-93809c0e94e9", "name": "Sample Collection", "uid": "5852-2412a72c-1d8e-491b-aced-93809c0e94e9" } }



Curl
curl -X POST 'https://api.getpostman.com/collections' -H 'Content-Type: application/json' -d '{"collection":{"info":{"name":"Sample Collection undefined","description":"This is just a sample collection.","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item":[{"name":"This is a folder","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"}}]}}'

ENDPOINTS