CreateBranch

更新时间:
复制 MD 格式

Creates a Supabase project branch.

Operation description

Creates a new Supabase branch based on a specified parent branch. By default, a child branch inherits the region, network, storage, and other resource configurations from the primary branch.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID. This parameter is required when you create a primary branch. When you create a child branch, the region is inherited from the primary branch by default.

cn-beijing

ProjectId

string

Yes

The Supabase project ID that corresponds to the primary branch.

spb-xxxx

ParentBranchId

string

Yes

The parent branch ID. This parameter specifies the parent branch for the new branch or query condition.

br-main

BranchName

string

Yes

The branch name.

dev

Description

string

No

The branch description.

test branch

Tag

array<object>

No

The list of branch tags.

object

No

The tag object, which contains a tag key and a tag value.

Key

string

No

The tag key.

env

Value

string

No

The tag value.

dev

InitSource

string

No

The initialization source of the branch.

Valid values:

  • ParentData: copies the schema and data from the parent branch. This is the default value.

  • SchemaOnly: copies only the schema structure.

ParentData

ParentTimestamp

string

No

The point in time for data synchronization from the parent branch when creating the branch. The value is in ISO 8601 UTC format.

Default value: the current time.

2026-04-08T09:11:12Z

ParentLsn

string

No

The log sequence number (LSN) from the parent branch at which the branch is created.

0/3522648

Protected

boolean

No

Specifies whether to enable branch protection.

Valid values:

  • true: Enables branch protection.

  • false: Disables branch protection. This is the default value.

false

ExpiresAt

string

No

The time at which the branch automatically expires and is deleted. The value is in ISO 8601 UTC format.

2026-10-08T09:11:12Z

ClientToken

string

No

The client idempotency token. This token ensures the idempotence of retry requests.

123e4567-e89b-12d3-a456-426614174000

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

ABB39CC3-4488-4857-905D-2E4A051D****

BranchId

string

The branch ID. This ID uniquely identifies a Supabase branch.

br-xxxx

ProjectId

string

The Supabase project ID that corresponds to the primary branch.

spb-xxxx

Examples

Success response

JSON format

{
  "RequestId": "ABB39CC3-4488-4857-905D-2E4A051D****",
  "BranchId": "br-xxxx",
  "ProjectId": "spb-xxxx"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.