# Unable to find Schema for API version

**URL:** <https://community.postman.com/t/unable-to-find-schema-for-api-version/14980>\
**Category:** Help Hub\
**Created:** [August 13, 2020, 12:52am UTC](https://community.postman.com/t/unable-to-find-schema-for-api-version/14980 "2020-08-13T00:52:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhe.wang](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/zhe.wang/32/5236_2.png) [@zhe.wang](https://community.postman.com/u/zhe.wang)\
**Post date:** [August 13, 2020, 12:52am UTC](https://community.postman.com/t/unable-to-find-schema-for-api-version/14980/1 "2020-08-13T00:52:17Z")

</div>

I have a single `apiId` with two versions:  
`https://api.getpostman.com/apis/{{apiId}}/versions`

```auto
{
    "versions": [
        {
            "id": "v2",
            "name": "Two",
            ...
            "lastRevision": 16598951405
        },
        {
            "id": "v1",
            "name": "One",
            ...
            "lastRevision": 16561247529
        }
    ]
}

```

In order to create a collection from schema, the `schemaId` along with `apiVersionId` are to be provided.  
`https://api.getpostman.com/apis/{{apiId}}/versions/{{apiVersionId}}/schemas/{{schemaId}}/collections?workspace={{workspaceId}}`

I’m unable to determine the `schemaId` for `v2`. Retrieving the single API only responds with `v1`:  
`https://api.getpostman.com/apis/{{apiId}}`

```auto
{
    "api": {
        "id": "api1",
        "name": "API",
        ...
        "versions": [
            {
                "api": "api1",
                "id": "v1",
                "name": "One",
                ...
                "schemas": [
                    {
                        "id": "schemaId",
                        "type": "openapi2",
                        "language": "json"
                    }
                ]
            }
        ]
    }
}

```

Retrieving the schema for `v2` using `schemaId` fails with:

```auto
{
    "error": {
        "name": "schemaApiVersionMismatchError",
        "message": "The Schema ID provided does not belong to the API Version ID provided."
    }
}

```

Both schemas against the API are synced via GitHub integration.

---

<div class="post-metadata">

**Author:** ![zhe.wang](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/zhe.wang/32/5236_2.png) [@zhe.wang](https://community.postman.com/u/zhe.wang)\
**Post date:** [August 17, 2020, 3:39am UTC](https://community.postman.com/t/unable-to-find-schema-for-api-version/14980/2 "2020-08-17T03:39:33Z")

</div>

I’ve stopped using schema sync via GitHub integration and it’s responding with both schemas.

---

<div class="post-metadata">

**Author:** ![Kurmavatar](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kurmavatar/32/3026_2.png) [@Kurmavatar](https://community.postman.com/u/Kurmavatar)\
**Post date:** [August 17, 2020, 6:06am UTC](https://community.postman.com/t/unable-to-find-schema-for-api-version/14980/3 "2020-08-17T06:06:23Z")

</div>

Hi @zhe.wang

I tried to retrieve Schema ID for different versions and that worked fine for me. One time where I faced the issue - when I used version name instead of version Id for the schema, could you check if the same helps you? Below is the collection that helped me to retrieve this:

> **[How to Update Schema using Postman API?](https://documenter.getpostman.com/view/6034746/SzYUZLy5?version=latest)**
>
> In order to update your API Schema - run the requests one after the other and saving the required value in a dedicated environment.
