Describe an Alias
curl --request GET \
--url https://{projectHost}/collections/{collectionName}/aliases/{aliasName} \
--header 'x-api-key: <api-key>'import requests
url = "https://{projectHost}/collections/{collectionName}/aliases/{aliasName}"
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}/aliases/{aliasName}', 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}/aliases/{aliasName}",
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}/aliases/{aliasName}"
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}/aliases/{aliasName}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{projectHost}/collections/{collectionName}/aliases/{aliasName}")
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{
"alias": {
"aliasId": "alias-id",
"aliasName": "latest",
"targetKind": "BRANCH",
"targetName": "main",
"targetId": "main-branch-id",
"aliasRevision": 1,
"dangling": false,
"indexConfigs": {
"title": {
"type": "text",
"analyzers": [
"english"
],
"description": "Book title as printed on the cover"
},
"category": {
"type": "keyword"
},
"id": {
"type": "keyword"
}
},
"createdAt": 1788336000000
}
}{
"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 an alias
Get an alias with the index schema it currently serves, read through to its target: a branch’s current version or a tag’s pinned version. Retargeting an alias across branches with different schemas is allowed and not checked by the server; this route shows which schema reads through the alias see. A dangling alias (its bound target identity is gone) still returns 200 with dangling true and null indexConfigs. A name that is not an alias returns 404.
GET
/
collections
/
{collectionName}
/
aliases
/
{aliasName}
Describe an Alias
curl --request GET \
--url https://{projectHost}/collections/{collectionName}/aliases/{aliasName} \
--header 'x-api-key: <api-key>'import requests
url = "https://{projectHost}/collections/{collectionName}/aliases/{aliasName}"
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}/aliases/{aliasName}', 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}/aliases/{aliasName}",
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}/aliases/{aliasName}"
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}/aliases/{aliasName}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{projectHost}/collections/{collectionName}/aliases/{aliasName}")
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{
"alias": {
"aliasId": "alias-id",
"aliasName": "latest",
"targetKind": "BRANCH",
"targetName": "main",
"targetId": "main-branch-id",
"aliasRevision": 1,
"dangling": false,
"indexConfigs": {
"title": {
"type": "text",
"analyzers": [
"english"
],
"description": "Book title as printed on the cover"
},
"category": {
"type": "keyword"
},
"id": {
"type": "keyword"
}
},
"createdAt": 1788336000000
}
}{
"message": "Authentication failed"
}{
"message": "Resource not found"
}{
"message": "Too many requests"
}{
"message": "Internal server error"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Path Parameters
Was this page helpful?