Skip to main content
POST
/
search
Create Search Index
curl --request POST \
  --url https://api.upstash.com/v2/search \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "mySearchIndex",
  "region": "eu-west-1",
  "type": "payg"
}
'
import requests

url = "https://api.upstash.com/v2/search"

payload = {
"name": "mySearchIndex",
"region": "eu-west-1",
"type": "payg"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'mySearchIndex', region: 'eu-west-1', type: 'payg'})
};

fetch('https://api.upstash.com/v2/search', 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.upstash.com/v2/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'mySearchIndex',
'region' => 'eu-west-1',
'type' => 'payg'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://api.upstash.com/v2/search"

payload := strings.NewReader("{\n \"name\": \"mySearchIndex\",\n \"region\": \"eu-west-1\",\n \"type\": \"payg\"\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))

}
HttpResponse<String> response = Unirest.post("https://api.upstash.com/v2/search")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"mySearchIndex\",\n \"region\": \"eu-west-1\",\n \"type\": \"payg\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.upstash.com/v2/search")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"mySearchIndex\",\n \"region\": \"eu-west-1\",\n \"type\": \"payg\"\n}"

response = http.request(request)
puts response.read_body
{
  "customer_id": "example@upstash.com",
  "id": "99a4c327-31f0-490f-a594-043ade84085a",
  "name": "mySearchIndex",
  "endpoint": "glowing-baboon-15797-us1",
  "type": "payg",
  "region": "us-central1",
  "vercel_email": "example@vercel.com",
  "token": "ZXhhbXBsZUB1cHN0YXNoLmNvbTpuYWJlcg==",
  "read_only_token": "ZXhhbXBsZUB1cHN0YXNoLmNvbTpuYWJlcg==",
  "max_vector_count": 2000000,
  "max_monthly_reranks": -1,
  "max_daily_updates": -1,
  "max_daily_queries": -1,
  "max_monthly_bandwidth": -1,
  "max_writes_per_second": 1000,
  "max_query_per_second": 1000,
  "max_reads_per_request": 100,
  "max_writes_per_request": 100,
  "creation_time": 1761200000,
  "input_enrichment_enabled": true,
  "throughput_vector": [
    {
      "x": "2025-10-23 20:54:00.000 +0000 UTC",
      "y": 0
    }
  ]
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
name
string
required

Name of the search index

Example:

"mySearchIndex"

region
enum<string>
required

Region of the index

Available options:
eu-west-1,
us-central1
Example:

"eu-west-1"

type
enum<string>
required

Index payment type. Currently 'free' and 'payg' are available.

Available options:
free,
payg,
fixed
Example:

"payg"

Response

200 - application/json

Index created successfully

customer_id
string

The associated ID of the owner of the index

Example:

"example@upstash.com"

id
string<uuid>

Unique ID of the index

Example:

"99a4c327-31f0-490f-a594-043ade84085a"

name
string

Name of the search index

Example:

"mySearchIndex"

endpoint
string

The REST endpoint of the index

Example:

"glowing-baboon-15797-us1"

type
enum<string>

The payment plan of the index

Available options:
free,
payg,
fixed
Example:

"payg"

region
enum<string>

The region where the index is currently deployed

Available options:
eu-west-1,
us-central1
Example:

"us-central1"

vercel_email
string

The email associated with Vercel integration, if any. Empty string otherwise.

Example:

"example@vercel.com"

token
string

The REST authentication token for the index

Example:

"ZXhhbXBsZUB1cHN0YXNoLmNvbTpuYWJlcg=="

read_only_token
string

The REST authentication read only token for the search index

Example:

"ZXhhbXBsZUB1cHN0YXNoLmNvbTpuYWJlcg=="

max_vector_count
integer

Maximum number of vectors allowed in the index

Example:

2000000

max_monthly_reranks
integer

Maximum monthly rerank operations (-1 for unlimited)

Example:

-1

max_daily_updates
integer

Maximum daily update operations (-1 for unlimited)

Example:

-1

max_daily_queries
integer

Maximum daily query operations (-1 for unlimited)

Example:

-1

max_monthly_bandwidth
integer

Maximum monthly bandwidth in bytes (-1 for unlimited)

Example:

-1

max_writes_per_second
integer

Maximum write operations per second (rate limit)

Example:

1000

max_query_per_second
integer

Maximum query operations per second (rate limit)

Example:

1000

max_reads_per_request
integer

Maximum number of reads allowed per request

Example:

100

max_writes_per_request
integer

Maximum number of writes allowed per request

Example:

100

creation_time
integer<int64>

Unix timestamp of creation

Example:

1761200000

input_enrichment_enabled
boolean

Whether input enrichment is enabled for this index

Example:

true

throughput_vector
object[]

Throughput metrics over time

Example:
[
{
"x": "2025-10-23 20:54:00.000 +0000 UTC",
"y": 0
}
]