Database Branch by Name
https://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/async
Create a new database branch
Expected parameters
Name | Description | In | Required | Schema |
---|---|---|---|---|
db_branch_name | The DBBranchName matches the pattern | path | ✅ | string |
Create Database Branch
PUThttps://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/async
Expected parameters
Name | Description | In | Required | Schema |
---|---|---|---|---|
from | Name of source branch to branch the new schema from | query | - | string |
Request Body Type Definition
type CreateBranchAsync = {
/**
* Select the branch to fork from. Defaults to 'main'
*/
from?: string;
metadata?: BranchMetadata;
};
/**
* @example {"repository":"github.com/my/repository","branch":"feature-login","stage":"testing","labels":["epic-100"]}
*/
type BranchMetadata = {
/**
* @minLength 1
*/
repository?: string;
branch?: BranchName;
/**
* @minLength 1
*/
stage?: string;
labels?: string[];
};
/**
* @maxLength 255
* @minLength 1
* @pattern [a-zA-Z0-9_\-~]+
*/
type BranchName = string;
Responses
type CreateBranchAsync = {
/**
* The id of the branch creation task
*/
taskID: string;
};
type CreateBranchAsync = {
id?: string;
message: string;
};
{
"message": "invalid API key"
}
type CreateBranchAsync = {
id?: string;
message: string;
};
type CreateBranchAsync = {
id?: string;
message: string;
};
type CreateBranchAsync = void;
type CreateBranchAsync = void;