Skip to main content
POST
/
v2
/
vector
/
index
/
{id}
/
setplan
curl -X POST \
  https://api.upstash.com/v2/vector/index/14841111-b834-4788-925c-04ab156d1123/setplan \
  -u 'EMAIL:API_KEY' \
  -d '{"target_plan":"fixed"}'
const axios = require('axios');

const postData = {
  target_plan: "fixed",
};

const config = {
  auth: {
    username: 'EMAIL',
    password: 'API_KEY',
  },
  headers: {
    'Content-Type': 'application/json',
  },
};

const url = 'https://api.upstash.com/v2/vector/index/14841111-b834-4788-925c-04ab156d1123/setplan';

axios.post(url, postData, config)
  .then((response) => {
    console.log('Plan set successfully:', response.data);
  })
  .catch((error) => {
    console.error('Error:', error);
  });

import requests

data = '{"target_plan":"fixed"}'

response = requests.post('https://api.upstash.com/v2/vector/index/14841111-b834-4788-925c-04ab156d1123/setplan', data=data, auth=('EMAIL', 'API_KEY'))
response.content
client := &http.Client{}
var data = strings.NewReader(`{
    "target_plan":"fixed",
}`)
req, err := http.NewRequest("POST", "https://api.upstash.com/v2/vector/index/14841111-b834-4788-925c-04ab156d1123/setplan", data)
if err != nil {
    log.Fatal(err)
}
req.SetBasicAuth("email", "api_key")
resp, err := client.Do(req)
if err != nil {
    log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
    log.Fatal(err)
}
fmt.Printf("%s\n", bodyText);
"OK"

Request Parameters

id
string
required
The unique ID of the index to be deleted.
target_plan
string
required
The new plan for the index.

Response Parameters

"OK" on successfull deletion operation.
curl -X POST \
  https://api.upstash.com/v2/vector/index/14841111-b834-4788-925c-04ab156d1123/setplan \
  -u 'EMAIL:API_KEY' \
  -d '{"target_plan":"fixed"}'
const axios = require('axios');

const postData = {
  target_plan: "fixed",
};

const config = {
  auth: {
    username: 'EMAIL',
    password: 'API_KEY',
  },
  headers: {
    'Content-Type': 'application/json',
  },
};

const url = 'https://api.upstash.com/v2/vector/index/14841111-b834-4788-925c-04ab156d1123/setplan';

axios.post(url, postData, config)
  .then((response) => {
    console.log('Plan set successfully:', response.data);
  })
  .catch((error) => {
    console.error('Error:', error);
  });

import requests

data = '{"target_plan":"fixed"}'

response = requests.post('https://api.upstash.com/v2/vector/index/14841111-b834-4788-925c-04ab156d1123/setplan', data=data, auth=('EMAIL', 'API_KEY'))
response.content
client := &http.Client{}
var data = strings.NewReader(`{
    "target_plan":"fixed",
}`)
req, err := http.NewRequest("POST", "https://api.upstash.com/v2/vector/index/14841111-b834-4788-925c-04ab156d1123/setplan", data)
if err != nil {
    log.Fatal(err)
}
req.SetBasicAuth("email", "api_key")
resp, err := client.Do(req)
if err != nil {
    log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
    log.Fatal(err)
}
fmt.Printf("%s\n", bodyText);
"OK"