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

# Agent versions and tags

> Create, publish, and delete agent versions, then point phone numbers at prod and staging environment tags to switch versions without updating each number.

An agent can have several versions, each with its own configuration. Versions let you keep earlier work as you make changes and choose which configuration your calls use.

## Draft and published versions

A new version starts as a **draft**, which you can edit and test. **Publishing** makes that version read-only, giving you a fixed configuration you can return to later. To continue making changes, create another draft from it.

Both draft and published agent versions can be attached to [phone numbers](/deploy/purchase-number).

Version numbers start at **V0** and increase each time you create a new version. Publishing keeps the same number and removes the draft label: **V2 (draft)** becomes **V2**.

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/Bbz9TRzc2W4" title="How to Use Versioning and Environment Tags with Retell AI" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

## Manage versions

Click the version button in the upper right corner of the agent page to open the versions panel.

<Frame>
  <img style={{ maxHeight: 560 }} src="https://mintcdn.com/retellai/D9cEiBKGEvGbaqXg/images/version-v2/version-open-button.png?fit=max&auto=format&n=D9cEiBKGEvGbaqXg&q=85&s=ac949091f0be4ea8a3ef981561c96ae9" width="558" height="656" data-path="images/version-v2/version-open-button.png" />
</Frame>

The panel groups versions under **Draft** and **Published**. Select a version to open its configuration. Drafts also show which version they were created from, so you can trace a change back to its starting point.

<Frame>
  <img style={{ maxHeight: 560 }} src="https://mintcdn.com/retellai/D9cEiBKGEvGbaqXg/images/version-v2/versions.png?fit=max&auto=format&n=D9cEiBKGEvGbaqXg&q=85&s=4a0b44e3ba7ef48d47fa1c85a45a5b88" width="700" height="1816" data-path="images/version-v2/versions.png" />
</Frame>

### Create a draft

Select the version you want to start from, then click **+** in the versions panel. The new draft is a copy you can edit without changing the source version.

You can create a draft from any past version, and keep several drafts at once to try different approaches. Give each draft a [test call](/test/test-phone) before deciding which one to use.

### Publish a draft

Select your draft and click **Publish** in the upper right corner of the agent page, then confirm in the dialog.

<Frame>
  <img style={{ maxHeight: 560 }} src="https://mintcdn.com/retellai/D9cEiBKGEvGbaqXg/images/version-v2/publish-pop-up.png?fit=max&auto=format&n=D9cEiBKGEvGbaqXg&q=85&s=2e563fa4af992c1b5cbb85c5e7f2ca90" width="842" height="758" data-path="images/version-v2/publish-pop-up.png" />
</Frame>

### Delete a version

Open the versions panel, select the version you no longer need, and use the delete option. If it's a published version with phone numbers or environment tags attached, remove those assignments first.

## Environment tags

An environment tag is a name that points to an agent version. Assign a phone number to a tag, and it follows whichever version the tag points to. This is useful when you want to switch versions without updating each phone number's settings.

For example, your production number could use the `prod` tag, assigned to **V2**. While it continues to use **V2**, you can test **V3**. When you're ready to switch, move `prod` to **V3**. To return to the previous configuration, move it back to **V2**.

Each agent starts with `prod` and `staging` tags. A version can have more than one tag, so both can point to the same version if needed.

<Frame>
  <img style={{ maxHeight: 560 }} src="https://mintcdn.com/retellai/D9cEiBKGEvGbaqXg/images/version-v2/tags-info.png?fit=max&auto=format&n=D9cEiBKGEvGbaqXg&q=85&s=8195bf4290d8fee44d8d4a9934504afd" width="1212" height="776" data-path="images/version-v2/tags-info.png" />
</Frame>

### Create and configure a tag

Click **Environment** in the agent header, then **Configure Tags**. Choose an existing tag to edit its settings, or click **+ Add** to create one. Each agent can have up to **10 tags**, including the defaults.

<Frame>
  <img style={{ maxHeight: 560 }} src="https://mintcdn.com/retellai/D9cEiBKGEvGbaqXg/images/version-v2/configure-tags.png?fit=max&auto=format&n=D9cEiBKGEvGbaqXg&q=85&s=6b293fd54f2ebffd3c0a87fc8b39cd73" width="1732" height="1264" data-path="images/version-v2/configure-tags.png" />
</Frame>

You can set [dynamic variable](/build/dynamic-variables) values for each tag in this dialog. Those values are supplied when a call uses the tag.

For example, an agent might use a dynamic variable for its transfer destination. Set that variable to your own number under `staging` and your team's number under `prod`. You can then test transfers on the same agent version without sending test calls to your team.

### Assign or move a tag

In the versions panel, select the version you want the tag to use. Click **Environment** in the agent header and choose the tag. Its label appears beside the version.

To move a tag, repeat these steps on a different version. Phone numbers that use the tag follow the change; phone numbers assigned directly to a version stay on that version.

<Frame>
  <img style={{ maxHeight: 560 }} src="https://mintcdn.com/retellai/D9cEiBKGEvGbaqXg/images/version-v2/select-tags.png?fit=max&auto=format&n=D9cEiBKGEvGbaqXg&q=85&s=1c3e03352c6948d4e653768066c75eaf" width="1014" height="430" data-path="images/version-v2/select-tags.png" />
</Frame>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.