> ## Documentation Index
> Fetch the complete documentation index at: https://docs.requestly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync a Collection from a Specification

> Generate a runnable API collection from an OpenAPI specification, then keep it in step with the spec using Update Collections.

A specification describes your API. A [collection](/api-client/api-collections) is what you actually send requests with. API Design connects the two: generate a collection from a specification once, then push later spec changes into it whenever you want.

<Warning>
  The sync only runs one way. The specification is the source of truth, and editing the generated collection never changes the specification. Anything you write in the collection that the spec does not describe stays in the collection alone.
</Warning>

That is the single most important thing on this page. If you change a path in the collection expecting the spec to follow, it will not, and the next update will flag your request as new.

## Prerequisites

* The specification is saved. A brand new, unsaved specification cannot generate a collection yet; the button explains that.
* The specification has at least one path. A document with an empty `paths` cannot produce a collection, and the button says so before you click.
* The specification has no blocking issues. See [Issues & Governance](/api-client/api-design/issues-and-governance) for which severities block.
* Your role can create and update items in the project. A viewer sees the buttons disabled with the reason.

## Generate a collection

<Steps>
  <Step title="Open the specification">
    Switch the API Client sidebar to **API Design** and open the specification from the **Specs** section.
  </Step>

  <Step title="Start Generate Collection">
    In the editor toolbar, click **Generate Collection**. If the specification already has collections linked to it, the toolbar shows a **Collections** button instead: open it and click **+ Generate Collection** inside.

    You can also start from the sidebar: open the specification's three-dot menu and choose **Generate collection**.

    <Frame>
      <img src="https://mintcdn.com/requestly/-Ov2rg1Fb6ueLIFe/images/api-design-generate-collection-modal.light.png?fit=max&auto=format&n=-Ov2rg1Fb6ueLIFe&q=85&s=698a1b5906d82151387e1f594cabe893" alt="The Generate collection from spec dialog with a Collection name field and a list of already-linked collections" className="dark:hidden" width="1280" height="800" data-path="images/api-design-generate-collection-modal.light.png" />

      <img src="https://mintcdn.com/requestly/-Ov2rg1Fb6ueLIFe/images/api-design-generate-collection-modal.dark.png?fit=max&auto=format&n=-Ov2rg1Fb6ueLIFe&q=85&s=204d9ec96434e1da2ba6025cfaee50b2" alt="The Generate collection from spec dialog with a Collection name field and a list of already-linked collections" className="hidden dark:block" width="1280" height="800" data-path="images/api-design-generate-collection-modal.dark.png" />
    </Frame>
  </Step>

  <Step title="Name the collection and generate">
    Type a name and click **Generate**. The dialog also lists any collections already linked to this specification, so you can tell whether you are about to create a duplicate.
  </Step>

  <Step title="Check the result">
    A new top-level collection appears in the sidebar. Folders come from your URL path segments, and each operation becomes one request with its method, URL, headers, query parameters, path variables, body and content type already filled in.
  </Step>
</Steps>

<Note>
  Generate always creates a **new** top-level collection. You cannot attach an existing collection to a specification, and generated collections are always top level rather than nested inside another collection.
</Note>

One specification can have several linked collections, which is useful when different teams want their own copy. Each one is tracked separately and updated separately.

## Keep a linked collection up to date

Once a collection is linked, Requestly watches the specification and works out what has drifted. You do not have to ask it to check.

When something has drifted, the toolbar button changes: it reads **Update Collections** with a count of pending changes and picks up a warning icon. Open it to see one row per linked collection.

<Frame>
  <img src="https://mintcdn.com/requestly/-Ov2rg1Fb6ueLIFe/images/api-design-collections-panel.light.png?fit=max&auto=format&n=-Ov2rg1Fb6ueLIFe&q=85&s=3d75f6789ea4c514f16b2ccef43491b0" alt="The Collections popover listing a linked collection with an amber pending-change count and an enabled Update button" className="dark:hidden" width="1280" height="800" data-path="images/api-design-collections-panel.light.png" />

  <img src="https://mintcdn.com/requestly/-Ov2rg1Fb6ueLIFe/images/api-design-collections-panel.dark.png?fit=max&auto=format&n=-Ov2rg1Fb6ueLIFe&q=85&s=24c58ce55d404b5c9cfaf9db5585c3e8" alt="The Collections popover listing a linked collection with an amber pending-change count and an enabled Update button" className="hidden dark:block" width="1280" height="800" data-path="images/api-design-collections-panel.dark.png" />
</Frame>

Each row shows the collection's name, an amber count when it has pending changes, and an **Update** button. Click the name to open that collection in a tab. If a row has nothing pending, its Update button is disabled and says "No pending changes".

<Steps>
  <Step title="Open the Collections popover">
    Click **Update Collections** in the spec editor toolbar.
  </Step>

  <Step title="Click Update on the collection you want">
    Requestly opens a preview of exactly what would change in that one collection. Nothing has been written yet.
  </Step>

  <Step title="Read the preview">
    Changes are grouped by kind, and each group has an info icon explaining what happens to your own edits. See [What the preview tells you](#what-the-preview-tells-you).

    <Frame>
      <img src="https://mintcdn.com/requestly/-Ov2rg1Fb6ueLIFe/images/api-design-update-preview.light.png?fit=max&auto=format&n=-Ov2rg1Fb6ueLIFe&q=85&s=c94699ce515c1137a849b9046fb4af2f" alt="The Update preview dialog grouping changes into Added, Updated and In collection not in spec sections, with an Apply button counting the changes" className="dark:hidden" width="1280" height="800" data-path="images/api-design-update-preview.light.png" />

      <img src="https://mintcdn.com/requestly/-Ov2rg1Fb6ueLIFe/images/api-design-update-preview.dark.png?fit=max&auto=format&n=-Ov2rg1Fb6ueLIFe&q=85&s=34c82b057a470ca8b504dccdfc3f069e" alt="The Update preview dialog grouping changes into Added, Updated and In collection not in spec sections, with an Apply button counting the changes" className="hidden dark:block" width="1280" height="800" data-path="images/api-design-update-preview.dark.png" />
    </Frame>
  </Step>

  <Step title="Apply">
    Click **Apply n changes**. Everything actionable in the preview is applied together; there is no per-row opt out. Requestly confirms how many changes landed.
  </Step>
</Steps>

<Check>
  After a successful apply, the toolbar button drops back to **Collections** with no count. That is how you know the collection matches the specification.
</Check>

## What Update Collections tracks

Update applies content changes as well as structural ones, so an edit to a request body or a query parameter in the spec does reach the collection.

**Tracked:**

* Operations added, removed or renamed, by method and path
* Operations moved between folders
* An operation's summary or description
* Request headers, query parameters, path variables, body and content type
* Folder renames, and folder descriptions taken from your OpenAPI tags
* The linked collection's own description, taken from the specification's top-level description

**Not tracked:** response definitions, security schemes, examples and callbacks. The linked collection's **name** is also never overwritten, because you chose it when you generated the collection.

A similar info icon sits next to the toolbar button in the product, so you can check what is tracked without opening a preview.

## What the preview tells you

The preview is grouped so you can see the risk before you accept it. Each group's info icon states what survives.

| Group                          | What it means                                                                                                                          |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| **Added**                      | New requests created under the matching path folder.                                                                                   |
| **Renamed**                    | The request's URL is updated in place. Your auth, body, headers and captured responses are preserved.                                  |
| **Moved**                      | The request is re-parented to match the spec's path. Auth, body, headers and captured responses are preserved.                         |
| **Updated**                    | Spec-side content changed, such as a summary, description, parameter or body. Your auth, scripts and captured responses are preserved. |
| **Folders renamed**            | The folder name is updated in place. Requests inside it, and their auth and variables, are preserved.                                  |
| **Folders updated**            | The folder description is updated from the OpenAPI tag. Folder auth, variables and scripts are preserved.                              |
| **Folders removed**            | Folders left empty by moved requests are tidied up.                                                                                    |
| **In collection, not in spec** | Informational only. These requests have no operation in the specification.                                                             |

The last row is the one worth reading twice. Requests that exist in the collection but not in the specification are **never** deleted by Apply. They are listed so you know they are there, they are not counted in the change total, and you have to remove them yourself if you do not want them.

A request lands in that group for one of two reasons: it really was removed from the specification, or it cannot be expressed in one. Two requests that share the same path and method, such as two query-string variants of the same endpoint, collapse to a single operation, so one of them will always show up here.

## When the specification cannot be synced

* **Errors in the specification.** The Update and Generate buttons are disabled and the tooltip names the count, for example "2 errors blocking - check bottom panel". Click the disabled button to jump straight to the offending rows in the [Issues panel](/api-client/api-design/issues-and-governance).
* **The check has not finished.** Immediately after a large edit the buttons read "Checking validation..." and stay disabled until the check completes.
* **Unsupported features.** If your specification uses something the collection format cannot represent, the Collections popover lists it under an "unsupported features" note. The rest of the specification still generates and updates normally.
* **The specification was deleted while the preview was open.** Apply stops and tells you to reopen the specification.

## Next steps

* [Issues & Governance](/api-client/api-design/issues-and-governance) to clear whatever is blocking a sync.
* [Versions and releases](/api-client/api-design/versions-and-releases) to pin a snapshot of the specification for downstream consumers.
* [API Design overview](/api-client/api-design/overview) for how specifications, components and collections fit together.
