createBranch( )


Creates a branch.

If a source branch isn't provided, the branch will include a blank website.

Important: Align the sourceType field with its corresponding source properties:

  • When sourceType is SOURCE_BRANCH, provide sourceBranchProperties.
  • When sourceType is SOURCE_TEMPLATE, provide sourceTemplateProperties.

Using UNKNOWN_SOURCE_TYPE or mismatched properties results in an ILLEGAL_SOURCE_TYPE error.

Authentication

This method may require higher-level permissions than the caller has, based on their identity and roles and permissions. In these cases, you can ensure the method is called with the required level of authorization by using one of the following:

Permissions
Manage Site Branches
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
branchBranchRequired

Branch to create.

Returns
Return Type:Promise<Branch>
Errors
404Not Found

There are 2 errors with this status code.

409Already Exists

There are 2 errors with this status code.

428Failed Precondition

There are 2 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?