About the Wix Branches API

The Wix Branches API lets you create and manage branches within a Wix site. A branch is a version of draft site content that can be edited independently of the published site, also known as a test site.

Branches let site owners and developers create isolated versions of a site for testing changes without affecting the live site. Each branch maintains its own content, design, and settings while sharing the same site infrastructure.

With the Wix Branches API, you can:

  • Create branches from existing branches or blank websites
  • Update branch metadata such as name and tags
  • Query and filter branches to efficiently manage multiple versions
  • Set a default branch for API operations
  • Organize branches using tags with bulk operations

Before you begin

  • This API allows you to manage branch metadata only. Editing the branch content itself is only possible in the editor.
  • When a new site is created, a default branch is automatically created with type ORIGINAL_BRANCH.

Use cases

Branch types

The following branch types are supported:

  • ORIGINAL_BRANCH: The branch created when the site was created. Can be accessed for editing and publishing in the editor.
  • USER: A branch created by a site owner that can be accessed for editing and publishing in the editor.
  • TECHNICAL: A branch created for technical purposes, unrelated to site owners. For internal use. Automatically deleted 30 days after creation.
  • MOBILE_APP: A branch for the mobile representation of the site.

Default branch

You can designate one branch as the default branch for a site.

Use SetDefaultBranch to designate a branch as the default, and GetDefaultBranch to retrieve the currently designated default branch.

Source types

When creating a branch, you must specify a source type that determines where the branch's initial content comes from:

  • SOURCE_BRANCH: Creates a branch from an existing branch. When using this source type, provide sourceBranchProperties with the source branch ID and optionally its revision number.
  • SOURCE_TEMPLATE: Creates a branch from a template. For internal use only.

The sourceType field must be aligned with its corresponding properties. Misalignment will result in an ILLEGAL_SOURCE_TYPE error.

Terminology

  • Branch: A version of draft site content that can be edited independently of the published site. Also known as a test site.
  • Source Branch: The original branch from which a new branch is created.
  • Editor: The platform site owners use to build and edit their sites. Wix offers 2 editors for site building:
Did this help?