Logo
30 days of Postman - for developers API Documentation

Create collection from schema

POST https://api.getpostman.com/apis/{{apiId}}/versions/{{apiVersionId}}/schemas/{{schemaId}}/collections?workspace={{workspaceId}}

This call creates a collection and links it to an API as one or multiple relations.

Request body requires two keys: - name - Name of the collection to be created. - relations - A list of relation(s) to be created.

The allowed relation types are contracttest, integrationtest, testsuite, and documentation.

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

 

Body PARAM

Key Datatype Required Description 
workspace
string



HEADERS

Key Datatype Required Description 
Content-Type
string




RESPONSES

status OK

{ "collection": { "id": "e6b0d46a-8722-4f42-ab86-f5f473187ddf", "uid": "112098-e6b0d46a-8722-4f42-ab86-f5f473187ddf" }, "relations": [ { "type": "contracttest", "id": "4b40f06a-5a6a-448f-bfcd-a6dbcb68da22" } ] }



Curl
curl -X POST 'https://api.getpostman.com/apis/undefined/versions/undefined/schemas/undefined/collections?workspace=undefined?workspace=undefined' -H 'Content-Type: application/json' -d '{"name":"My generated collection","relations":[{"type":"contracttest"}]}'

ENDPOINTS