Resolve the branch to use

https://{your-workspace-slug}.{region}.xata.sh/dbs/db_name/resolveBranch

This endpoint is typically used by the Xata SDKs to resolve the correct branch to use in a particular situation. The main input is the git branch.

Expected parameters

NameDescriptionInRequiredSchema
db_name

The Database Name

path✅string

Resolve a Git Branch to a Xata Branch

GET
https://{your-workspace-slug}.{region}.xata.sh/dbs/db_name/resolveBranch

Failed to compile MDX

Expected parameters

NameDescriptionInRequiredSchema
gitBranch

The Git Branch

query-string
fallbackBranch

Default branch to fallback to

query-string

Responses

{
    "branch": "main",
    "reason": {
        "code": "DEFAULT_BRANCH",
        "message": "Default branch for this database (main)"
    }
}