Skip to main content
PATCH
/
organizations
/
{organizationID}
/
projects
/
{projectID}
/
branches
/
{branchID}
Update branch details
curl --request PATCH \
  --url https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "replicas": 2,
  "storage": 123,
  "instanceType": "<string>",
  "backupConfiguration": {
    "retentionPeriod": 2,
    "backupTime": "<string>"
  },
  "hibernate": true,
  "scaleToZero": {
    "enabled": true,
    "inactivityPeriodMinutes": 30
  },
  "postgresConfigurationParameters": {},
  "preloadLibraries": [
    "<string>"
  ]
}
'
{
  "id": "<string>",
  "name": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "region": "<string>",
  "publicAccess": true,
  "description": "<string>",
  "parentID": "<string>",
  "connectionString": "<string>"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

organizationID
string
required

Unique identifier of the organization containing the project

projectID
string
required

Unique identifier of the project containing the branch

branchID
string
required

Unique identifier of the branch to update

Body

application/json

Details that can be updated for an existing branch

name
string

New name for the branch

description
string

New description for the branch (max 50 characters)

replicas
integer<int32>

Number of database replicas to scale to

Required range: 0 <= x <= 4
storage
integer<int32>

Branch storage in GiB (gigabytes)

Required range: x <= 250
instanceType
string

New instance type for the branch

backupConfiguration
object

Details about the branch continuous backup configuration

hibernate
boolean

Enabled when the branch should be hibernated, disabled if it needs to be reactivated.

scaleToZero
object

Configuration for scaling branches to zero when not in use

postgresConfigurationParameters
object

Arbitrary PostgreSQL configuration parameters for the cluster

preloadLibraries
string[]

List of PostgreSQL extensions and libraries to preload

Response

Branch successfully updated

Basic metadata about a branch, used in response to create/update operations

id
string
required

Unique identifier for the branch

name
string
required

Human-readable name of the branch

createdAt
string<date-time>
required

Timestamp when the branch was created

updatedAt
string<date-time>
required

Timestamp when the branch was last updated

region
string
required

Geographic region where the branch is deployed

publicAccess
boolean
required

Whether the branch allows public access without authentication

description
string

Optional description of the branch purpose or contents

parentID
string | null

Identifier of the parent branch if this is a derived branch, null otherwise

connectionString
string | null

Database connection string for accessing this branch