Describe a Branch
curl --request GET \
--url https://{projectHost}/collections/{collectionName}/branches/{branchName} \
--header 'x-api-key: <api-key>'import requests
url = "https://{projectHost}/collections/{collectionName}/branches/{branchName}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://{projectHost}/collections/{collectionName}/branches/{branchName}', 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://{projectHost}/collections/{collectionName}/branches/{branchName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://{projectHost}/collections/{collectionName}/branches/{branchName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{projectHost}/collections/{collectionName}/branches/{branchName}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{projectHost}/collections/{collectionName}/branches/{branchName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"branch": {
"name": "candidate",
"parentBranch": {
"branchId": "main-branch-id",
"name": "main"
},
"createdAt": 1788336000000,
"headSnapshot": {
"snapshotId": "snapshot-id",
"snapshotCommittedAt": 1788335940000
},
"parentSnapshot": {
"snapshotId": "snapshot-id",
"snapshotCommittedAt": 1788335940000
},
"numDocs": 1000,
"dataUpdatedAt": 1788335940000,
"indexConfigs": {
"title": {
"type": "text",
"analyzers": [
"english"
],
"description": "Book title as printed on the cover"
},
"category": {
"type": "keyword"
},
"id": {
"type": "keyword"
}
}
}
}{
"message": "Authentication failed"
}{
"message": "Resource not found"
}{
"message": "Too many requests"
}{
"message": "Internal server error"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Branches, tags & aliases
Describe a branch
Get a branch with its index schema and data statistics. A branch owns its indexConfigs: a new branch inherits the source branch’s current version, the tag’s pinned version, or the origin snapshot’s version for an asOf branch, and later schema updates of other branches, including main, do not change it. A name that is not a branch returns 404.
GET
/
collections
/
{collectionName}
/
branches
/
{branchName}
Describe a Branch
curl --request GET \
--url https://{projectHost}/collections/{collectionName}/branches/{branchName} \
--header 'x-api-key: <api-key>'import requests
url = "https://{projectHost}/collections/{collectionName}/branches/{branchName}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://{projectHost}/collections/{collectionName}/branches/{branchName}', 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://{projectHost}/collections/{collectionName}/branches/{branchName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://{projectHost}/collections/{collectionName}/branches/{branchName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{projectHost}/collections/{collectionName}/branches/{branchName}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{projectHost}/collections/{collectionName}/branches/{branchName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"branch": {
"name": "candidate",
"parentBranch": {
"branchId": "main-branch-id",
"name": "main"
},
"createdAt": 1788336000000,
"headSnapshot": {
"snapshotId": "snapshot-id",
"snapshotCommittedAt": 1788335940000
},
"parentSnapshot": {
"snapshotId": "snapshot-id",
"snapshotCommittedAt": 1788335940000
},
"numDocs": 1000,
"dataUpdatedAt": 1788335940000,
"indexConfigs": {
"title": {
"type": "text",
"analyzers": [
"english"
],
"description": "Book title as printed on the cover"
},
"category": {
"type": "keyword"
},
"id": {
"type": "keyword"
}
}
}
}{
"message": "Authentication failed"
}{
"message": "Resource not found"
}{
"message": "Too many requests"
}{
"message": "Internal server error"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Was this page helpful?