# \[Solved\] Postman API, InstanceNotFoundError on single collection that is visible in the collection list

**URL:** <https://community.postman.com/t/solved-postman-api-instancenotfounderror-on-single-collection-that-is-visible-in-the-collection-list/4206>\
**Category:** Help Hub\
**Tags:** collections, postman-api\
**Created:** [February 20, 2019, 3:14pm UTC](https://community.postman.com/t/solved-postman-api-instancenotfounderror-on-single-collection-that-is-visible-in-the-collection-list/4206 "2019-02-20T15:14:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SmeltPeer](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/smeltpeer/32/1087_2.png) [@SmeltPeer](https://community.postman.com/u/SmeltPeer)\
**Post date:** [February 20, 2019, 3:14pm UTC](https://community.postman.com/t/solved-postman-api-instancenotfounderror-on-single-collection-that-is-visible-in-the-collection-list/4206/1 "2019-02-20T15:14:16Z")

</div>

In our CICD pipeline, we use api requests to retrieve the relevant Collections to run through our tests. Therefore we do first a GET on the collections and do a GET on all collections to retrieve the content as JSON so we can run it with Newman.

Unfortunately, not all collections we get back do return a correct content. For example:  
(anonymized with #)

```
curl -X GET \
  https://api.getpostman.com/collections \
    -H 'X-Api-Key: #############################' 

```

result:

```
{
    "collections": [
        {
            "id": "######-####-####-####-#######001",
            "name": "Collection ABC",
            "owner": "#######",
            "uid": "######-####-####-####-#######001"
        },
        {
            "id": "######-####-####-####-#######002",
            "name": "Collection DEF",
            "owner": "#######",
            "uid": "######-####-####-####-#######002"
        },
        {
            "id": "######-####-####-####-#######003",
            "name": "Collection XYZ",
            "owner": "#######",
            "uid": "######-####-####-####-#######003"
        }
}

```

When I do a get of Collection ABC and DEF, it returns a correct JSON. But when I do a get on Collection XYZ, I get the message:

```
curl -X GET \
  https://api.getpostman.com/collections/######-####-####-####-#######003 \
           -H 'X-Api-Key: #############################' 

{
    "error": {
        "name": "instanceNotFoundError",
        "message": "Instance not found in the database."
    }
}

```

It is reproducible for this and some other collections. Even when I make changes to their name or content. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![SmeltPeer](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/smeltpeer/32/1087_2.png) [@SmeltPeer](https://community.postman.com/u/SmeltPeer)\
**Post date:** [February 21, 2019, 8:06am UTC](https://community.postman.com/t/solved-postman-api-instancenotfounderror-on-single-collection-that-is-visible-in-the-collection-list/4206/2 "2019-02-21T08:06:15Z")

</div>

I could solve it by using the `uid` instead of `id` attribute to retrieve the collection. The difference seems to be as follow:

`id` is the id of the request  
`uid` is the `ownerid` + `id`. I think to differentiate between different versions of users if you are working in a team.

When you try to get a collection by id, but it is created by another member it will throw the instanceNotFoundError. If you get the collection with the `uid` it works fine.
