Versions

Add a version

When you set up a version in Redocly, you connect it to a source. You may use the same source for multiple versions.

add new api version

You must give the version a name after you connect the source.

version name

Edit a version

Edit the version name from Version > Settings > General.

edit version name

Delete a version

Delete a version from the registry from Version > Settings > Delete version.

delete version

Version history

A version can change. It has its own history shown in the logs from the version overview screen.

version logs

The version overview will show the recent logs from any branches associated with the version.

Version branches

A version may have one or more branches. It will have one default branch that is set when you connect your source. You may change the default branch any time you want from the version Settings > Branches.

settings-branches

You may control that from the sources configuration.

Other branches

If you have a long-lived branch strategy where the branches are actually different versions, you may want to disable the "Validate from other branches" setting.

To see if it is enabled, check the Version > Overview source section. validate from other branches

Toggle it on or off by editing the source.

Version environment variables

Environment variables can be used to set up different configuration options for different builds, or to define conditions under which specific content appears in a particular build.

For every version added to Redocly Workflows, you can create custom environment variables in Version > Settings > Environment variables.

Select Add variable and provide the name and value for the variable in the dialog that opens. To encrypt the variable and prevent it from being included in the logs, select the optional Secret checkbox before saving changes.

Environment variables for developer portals can be configured via the Redocly Workflows interface in Docs > Developer portal > Settings > Environment variables (for production builds), or by creating an environment file in your developer portal project repository (for non-production builds).

Environment files are used only for building developer portals. Any existing .env. files in your project don't apply to versions or reference docs managed via Redocly Workflows.

More details about supported environment variables and their usage are available in the Developer portal section of the documentation.

Note that environment variables can't be used within the OpenAPI definitions themselves. They are supported within custom plugins, rules, and decorators.

This following example shows a good practice of checking for existence of the EXAMPLE_VARIABLE prior to usage.

if ('EXAMPLE_VARIABLE' in process.env) {
  myExample = process.env.EXAMPLE_VARIABLE;
}