Logo
30 days challenge API Documentation

Collections

Number of APIs: 7


1. All Collections

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

The /collections endpoint returns a list of all collections that are accessible by you. The list includes your own collections and the collections that you have subscribed to.

The response contains an array of collection information containing the name, id, owner and uid of each collection.

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



2. Single Collection

GET https://api.getpostman.com/collections/{{collection_uid}}

Access the contents of a collection that is accessible to you using its unique id (uid).

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



3. 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.



4. Update Collection

PUT https://api.getpostman.com/collections/{{collection_uid}}

This endpoint allows you to update an existing collection using the Qodex Collection v2 format. For more information about the v2 schema, check the format here.

On successful updation of the collection, the response returns the collection name, id and uid.

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

Note: Please be careful when trying to update the collection, as the existing collection will be replaced by the request body.



5. Delete Collection

DELETE https://api.getpostman.com/collections/{{collection_uid}}

This endpoint allows you to delete an existing collection.

On successful deletion of the collection, the response returns the id and uid.

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



6. Create a Fork

POST https://api.getpostman.com/collections/fork/{{collection_uid}}?workspace={{workspace_id}}

This endpoint allows you to create a fork from an existing collection.

On successful creation of the collection, the response returns the collection name, id, uid along with fork information.

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

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



7. Merge a Fork

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

This endpoint allows you to merge a forked collection back to its destination collection.

On successful creation of the collection, the response returns the collection name, id and uid.

You need to specify the fork UID (as source) and destination collection UID (as destination) in the request body.

Optionally, you can also specify the merge strategy as either deleteSource or updateSourceWithDestination. Following is an explanation of the merge strategies

Merge Strategy Behaviour
deleteSource Forked collection is deleted after merging
updateSourceWithDestination Forked collection is up to date with changes in destination collection

If the collections cannot be merged (due to conflicts), appropriate error messages will be returned.

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



ENDPOINTS