# Refresh Mock Server and Collection after API definiton has changed

**URL:** <https://community.postman.com/t/refresh-mock-server-and-collection-after-api-definiton-has-changed/12157>\
**Category:** Help Hub\
**Tags:** mocks, collections\
**Created:** [April 23, 2020, 12:35pm UTC](https://community.postman.com/t/refresh-mock-server-and-collection-after-api-definiton-has-changed/12157 "2020-04-23T12:35:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbrunmaypbs](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@pbrunmaypbs](https://community.postman.com/u/pbrunmaypbs)\
**Post date:** [April 23, 2020, 12:35pm UTC](https://community.postman.com/t/refresh-mock-server-and-collection-after-api-definiton-has-changed/12157/1 "2020-04-23T12:35:00Z")

</div>

> **Archived topic — some details may be out of date.**  
> Mock servers built from saved collection examples are still supported. Postman now also has **code-based mocks** : JavaScript request handlers plus a `config.yaml`, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (`postman mock generate`) and run it (`postman mock run`). See [About mocks](https://learning.postman.com/docs/design-apis/mock-apis/mocks/overview) and [Create a mock](https://learning.postman.com/docs/design-apis/mock-apis/mocks/create-a-mock).  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) can build and run mocks for you.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

What is the fasted way of refreshing a collection and a mock server after the OpenAPI schema has been changed? Do i really always need to recreate them ?

---

<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:** [April 25, 2020, 5:50am UTC](https://community.postman.com/t/refresh-mock-server-and-collection-after-api-definiton-has-changed/12157/2 "2020-04-25T05:50:33Z")

</div>

Hi @pbrunmaypbs

Welcome to the community 👋

Yes! I do understand how important it is unfortunately, there is no way to do this at present. We are currently tracking this feature on GitHub - below is the link for the same:

> <https://github.com/postmanlabs/postman-app-support/issues/6722>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> When updatin…g collections from API schema, all examples are lost - you need recreate all examples from zero - this kind of development is useless if you prefer develop collections from API spec.
> 
> \*\*Describe the solution you'd like\*\*
> Add option "Update Collection" next to "Generate Collection" in APIs tab
> 
> \*\*Describe alternatives you've considered\*\*
> After every update add manually all examples.
> 
> IMHO it's priority for APIs new feature you released.

Feel free to upvote or add any additional comments that will help our team look into it 🙂

---

<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:** [May 6, 2020, 5:34am UTC](https://community.postman.com/t/refresh-mock-server-and-collection-after-api-definiton-has-changed/12157/3 "2020-05-06T05:34:52Z")

</div>

Closed on May 6, 2020, 5:34am UTC


