---
title: "Get branch details - Xata"
description: "Retrieves detailed information about a specific branch by its ID, including status, connection string, and configuration."
source: "https://xata.io/docs/api-reference/branches/get-branch-details"
---

Skip to main content

GET

/

organizations

/

{organizationID}

/

projects

/

{projectID}

/

branches

/

{branchID}

Get branch details

```
curl --request GET
  --url https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}
  --header 'Authorization: Bearer <token>'
```

```
import requests

url = "https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

```
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

```
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

```
HttpResponse<String> response = Unirest.get("https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```
require 'uri'
require 'net/http'

url = URI("https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```
{
  "id": "<string>",
  "name": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "region": "<string>",
  "status": {
    "status": "<string>",
    "instanceCount": 3,
    "instanceReadyCount": 2,
    "instances": [
      {
        "id": "<string>",
        "status": "<string>",
        "primary": true,
        "targetPrimary": true
      }
    ],
    "message": "<string>",
    "lifecycle": {
      "phase": "<string>",
      "reason": "<string>"
    }
  },
  "connectionString": "<string>",
  "publicAccess": true,
  "backupsEnabled": true,
  "scaleToZero": {
    "enabled": true,
    "inactivityPeriodMinutes": 30
  },
  "configuration": {
    "region": "<string>",
    "instanceType": "<string>",
    "image": "<string>",
    "replicas": 2,
    "storage": 123,
    "postgresConfigurationParameters": {},
    "preloadLibraries": [
      "<string>"
    ]
  },
  "description": "<string>",
  "parentID": "<string>",
  "backupConfiguration": {
    "retentionPeriod": 2,
    "backupTime": "<string>"
  }
}
```

```
{
  "message": "<string>",
  "id": "<string>"
}
```

```
{
  "message": "<string>",
  "id": "<string>"
}
```

```
{
  "message": "<string>",
  "id": "<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

Pattern: `[a-zA-Z0-9_-~:]+`

​

projectID

string

required

Unique identifier of the project containing the branch

​

branchID

string

required

Unique identifier of the branch to retrieve details for

#### Response

Branch details retrieved successfully

Detailed metadata about a branch, including its status and configuration

​

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

​

status

object

required

Detailed status information about a branch and its underlying database cluster

Show child attributes

​

connectionString

string | null

required

Database connection string for accessing this branch

​

publicAccess

boolean

required

Whether the branch allows public access without authentication

​

backupsEnabled

boolean

required

Whether the branch is in a region that supports backups

​

scaleToZero

object

required

Configuration for scaling branches to zero when not in use

Show child attributes

​

configuration

object

required

Configuration details for a database cluster backing a branch

Show child attributes

​

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

​

backupConfiguration

object

Details about the branch continuous backup configuration

Show child attributes

Was this page helpful?

[Previous](/docs/api-reference/branches/create-a-new-branch)

[Delete a branch](/docs/api-reference/branches/delete-a-branch)

[Next](/docs/api-reference/branches/delete-a-branch)
