Branch Metadata

https://{your-workspace-slug}.xata.sh/db/{db_branch_name}/metadata/

This path allows interacting with the metadata of a specific database branch.

Expected Parameters
NameDescriptionInRequiredSchema
db_branch_nameThe DBBranchName matches the pattern `{db_name}:{branch_name}`. pathstring

Update Branch Metadata

PUT  https://{your-workspace-slug}.xata.sh/db/{db_branch_name}/metadata/

Update the branch metadata

Request Body Type Definition
type UpdateBranchMetadata = 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[];
};

/**
 * @pattern [a-zA-Z0-9_\-~]+
 */
type BranchName = string;
Possible Responses
Status CodeDescriptionExample Response/Type Definition
204No Content
400Bad Request
type UpdateBranchMetadata = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
404Example response
type UpdateBranchMetadata = {
    id?: string;
    message: string;
};
5XXUnexpected Error

Get Branch Metadata

GET  https://{your-workspace-slug}.xata.sh/db/{db_branch_name}/metadata/
Possible Responses
Status CodeDescriptionExample Response/Type Definition
200OK
{
  "repository": "github.com/my/repository",
  "branch": "feature-login",
  "stage": "testing",
  "labels": [
    "epic-100"
  ]
}
400Bad Request
type GetBranchMetadata = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
404Example response
type GetBranchMetadata = {
    id?: string;
    message: string;
};
5XXUnexpected Error