Rename Index
This endpoint is used to change the name of an index.
1 min read
post/vector/index/{id}/rename
Request example
curl --request POST \
--url https://api.upstash.com/v2/vector/index/{id}/rename \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"name": "<string>"
}'import requests
url = "https://api.upstash.com/v2/vector/index/{id}/rename"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json",
}
payload = {
"name": "<string>"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)const response = await fetch('https://api.upstash.com/v2/vector/index/{id}/rename', {
method: 'POST',
headers: {
'Authorization': 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "<string>"
})
});
const data = await response.json();
console.log(data);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.upstash.com/v2/vector/index/{id}/rename',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"name": "<string>"
}',
CURLOPT_HTTPHEADER => [
'Authorization: Basic <encoded-value>',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://api.upstash.com/v2/vector/index/{id}/rename"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.upstash.com/v2/vector/index/{id}/rename"))
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"<string>\"\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());require 'uri'
require 'net/http'
url = URI('https://api.upstash.com/v2/vector/index/{id}/rename')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = url.scheme == 'https'
request = Net::HTTP::Post.new(url)
request['Authorization'] = 'Basic <encoded-value>'
request['Content-Type'] = 'application/json'
request.body = '{
"name": "<string>"
}'
response = http.request(request)
puts response.read_bodyResponse
"OK"post/vector/index/{id}/rename
Authorization
Basic authentication header of the form
Basic <encoded-value>, where <encoded-value> is the base64-encoded username:password.Path parameters
The unique ID of the index to be renamed
Body
application/jsonThe new name of the index
Responses
application/json
200
Index renamed successfully
Was this page helpful?