# How to retrieve collections not linked to any workspace?

**URL:** <https://community.postman.com/t/how-to-retrieve-collections-not-linked-to-any-workspace/13963>\
**Category:** Help Hub\
**Tags:** collections\
**Created:** [July 7, 2020, 8:41pm UTC](https://community.postman.com/t/how-to-retrieve-collections-not-linked-to-any-workspace/13963 "2020-07-07T20:41:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LCHOLLET](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LCHOLLET](https://community.postman.com/u/LCHOLLET)\
**Post date:** [July 7, 2020, 8:41pm UTC](https://community.postman.com/t/how-to-retrieve-collections-not-linked-to-any-workspace/13963/1 "2020-07-07T20:41:58Z")

</div>

**`Question for Kin: `**  
Hello,  
I discovered I have a lot of collections in Profile / My Collections, but only few of them are used in workspaces. I would like to know if there is an easy way, given a collection, to know if it belongs to a workspace or not, so that I can keep it or delete it.  
Thanks in advance  
Laurent

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [July 11, 2020, 12:03am UTC](https://community.postman.com/t/how-to-retrieve-collections-not-linked-to-any-workspace/13963/2 "2020-07-11T00:03:24Z")

</div>

Hi, @LCHOLLET,

Welcome to the community!

You can do this using the Postman API. You need to:

1. List all collections associated with your user.
2. List all collections associated with all your workspaces.
3. Locate all collections from step 1 that aren’t present in step 2.

This can be a little cumbersome. I created a script that uses [postmanctl](https://github.com/kevinswiber/postmanctl) and [jq](https://stedolan.github.io/jq/) to help out. You’ll need to install both tools, which should work cross-platform. The script, however, will need to be modified for Windows.

The script is here: [https://github.com/kevinswiber/postmanctl/blob/master/examples/find-orphan-collections/find-orphan-collections.sh](https://github.com/kevinswiber/postmanctl/blob/master/examples/find-orphan-collections/find-orphan-collections.sh)

This will only list the collection UIDs. You can use `postmanctl` to get more details: `postmanctl describe collection <uid>`.

Hope that helps,

Kevin

---

<div class="post-metadata">

**Author:** ![LCHOLLET](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LCHOLLET](https://community.postman.com/u/LCHOLLET)\
**Post date:** [July 16, 2020, 12:35pm UTC](https://community.postman.com/t/how-to-retrieve-collections-not-linked-to-any-workspace/13963/3 "2020-07-16T12:35:36Z")

</div>

Hi Kevin,

Thanks a lot for your help!

I have installed your tool but failed when configuring the API key.

Do you have an example of the expected content for

$HOME/.postmanctl.yaml

?

Thks again!

Laurent

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [July 16, 2020, 3:28pm UTC](https://community.postman.com/t/how-to-retrieve-collections-not-linked-to-any-workspace/13963/4 "2020-07-16T15:28:04Z")

</div>

Hi @LCHOLLET,

An example config file is here: [https://github.com/kevinswiber/postmanctl/blob/master/configs/example.postmanctl.yaml](https://github.com/kevinswiber/postmanctl/blob/master/configs/example.postmanctl.yaml), but you don’t have to edit this directly.

Here are instructions for configuring access: [https://github.com/kevinswiber/postmanctl/tree/master/configs#configuring-access](https://github.com/kevinswiber/postmanctl/tree/master/configs#configuring-access). You’ll need a Postman API Key to add to your configuration, which can be generated here: [https://go.postman.co/settings/me/api-keys](https://go.postman.co/settings/me/api-keys).

Hope that helps.

Best,

Kevin

---

<div class="post-metadata">

**Author:** ![LCHOLLET](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LCHOLLET](https://community.postman.com/u/LCHOLLET)\
**Post date:** [July 16, 2020, 4:23pm UTC](https://community.postman.com/t/how-to-retrieve-collections-not-linked-to-any-workspace/13963/5 "2020-07-16T16:23:16Z")

</div>

Hi Kevin,

I succeed in having the list of orphans and could compare and check it is correct!

Thanks a lot

Laurent
