List indexes
Use thelist_indexes operation to get a complete description of all indexes in a project:
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
index_list = pc.list_indexes()
print(index_list)
import { Pinecone } from '@pinecone-database/pinecone'
const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })
const indexList = await pc.listIndexes();
console.log(indexList);
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.model.*;
public class ListIndexesExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
IndexList indexList = pc.listIndexes();
System.out.println(indexList);
}
}
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func prettifyStruct(obj interface{}) string {
bytes, _ := json.MarshalIndent(obj, "", " ")
return string(bytes)
}
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idxs, err := pc.ListIndexes(ctx)
if err != nil {
log.Fatalf("Failed to list indexes: %v", err)
} else {
for _, index := range idxs {
fmt.Printf("index: %v\n", prettifyStruct(index))
}
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl -i -X GET "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10"
[{
"name": "docs-example-sparse",
"metric": "dotproduct",
"host": "docs-example-sparse-govk0nt.svc.aped-4627-b74a.pinecone.io",
"spec": {
"serverless": {
"cloud": "aws",
"region": "us-east-1"
}
},
"status": {
"ready": true,
"state": "Ready"
},
"vector_type": "sparse",
"dimension": null,
"deletion_protection": "disabled",
"tags": {
"environment": "development"
}
}, {
"name": "docs-example-dense",
"metric": "cosine",
"host": "docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io",
"spec": {
"serverless": {
"cloud": "aws",
"region": "us-east-1"
}
},
"status": {
"ready": true,
"state": "Ready"
},
"vector_type": "dense",
"dimension": 1536,
"deletion_protection": "disabled",
"tags": {
"environment": "development"
}
}]
{
indexes: [
{
name: 'docs-example-sparse',
dimension: undefined,
metric: 'dotproduct',
host: 'docs-example-sparse-govk0nt.svc.aped-4627-b74a.pinecone.io',
deletionProtection: 'disabled',
tags: { environment: 'development', example: 'tag' },
embed: undefined,
spec: { pod: undefined, serverless: { cloud: 'aws', region: 'us-east-1' } },
status: { ready: true, state: 'Ready' },
vectorType: 'sparse'
},
{
name: 'docs-example-dense',
dimension: 1536,
metric: 'cosine',
host: 'docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io',
deletionProtection: 'disabled',
tags: { environment: 'development', example: 'tag' },
embed: undefined,
spec: { pod: undefined, serverless: { cloud: 'aws', region: 'us-east-1' } },
status: { ready: true, state: 'Ready' },
vectorType: 'dense'
}
]
}
class IndexList {
indexes: [class IndexModel {
name: docs-example-sparse
dimension: null
metric: dotproduct
host: docs-example-sparse-govk0nt.svc.aped-4627-b74a.pinecone.io
deletionProtection: disabled
tags: {environment=development}
embed: null
spec: class IndexModelSpec {
pod: null
serverless: class ServerlessSpec {
cloud: aws
region: us-east-1
additionalProperties: null
}
additionalProperties: null
}
status: class IndexModelStatus {
ready: true
state: Ready
additionalProperties: null
}
vectorType: sparse
additionalProperties: null
}, class IndexModel {
name: docs-example-dense
dimension: 1536
metric: cosine
host: docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io
deletionProtection: disabled
tags: {environment=development}
embed: null
spec: class IndexModelSpec {
pod: null
serverless: class ServerlessSpec {
cloud: aws
region: us-east-1
additionalProperties: null
}
additionalProperties: null
}
status: class IndexModelStatus {
ready: true
state: Ready
additionalProperties: null
}
vectorType: dense
additionalProperties: null
}]
additionalProperties: null
}
index: {
"name": "docs-example-sparse",
"host": "docs-example-sparse-govk0nt.svc.aped-4627-b74a.pinecone.io",
"metric": "dotproduct",
"vector_type": "sparse",
"deletion_protection": "disabled",
"dimension": null,
"spec": {
"serverless": {
"cloud": "aws",
"region": "us-east-1"
}
},
"status": {
"ready": true,
"state": "Ready"
},
"tags": {
"environment": "development"
}
}
index: {
"name": "docs-example-dense",
"host": "docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io",
"metric": "cosine",
"vector_type": "dense",
"deletion_protection": "disabled",
"dimension": 1536,
"spec": {
"serverless": {
"cloud": "aws",
"region": "us-east-1"
}
},
"status": {
"ready": true,
"state": "Ready"
},
"tags": {
"environment": "development"
}
}
{
"indexes": [
{
"name": "docs-example-sparse",
"vector_type": "sparse",
"metric": "dotproduct",
"dimension": null,
"status": {
"ready": true,
"state": "Ready"
},
"host": "docs-example-sparse-govk0nt.svc.aped-4627-b74a.pinecone.io",
"spec": {
"serverless": {
"region": "us-east-1",
"cloud": "aws"
}
},
"deletion_protection": "disabled",
"tags": {
"environment": "development"
}
},
{
"name": "docs-example-dense",
"vector_type": "dense",
"metric": "cosine",
"dimension": 1536,
"status": {
"ready": true,
"state": "Ready"
},
"host": "docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io",
"spec": {
"serverless": {
"region": "us-east-1",
"cloud": "aws"
}
},
"deletion_protection": "disabled",
"tags": {
"environment": "development"
}
}
]
}
.names() helper function to iterate over the index names in the list_indexes() response, for example:
Python
from pinecone.grpc import PineconeGRPC as Pinecone
from pinecone import ServerlessSpec
for index_name in pc.list_indexes().names:
print(index_name)
Describe an index
Use thedescribe_index endpoint to get a complete description of a specific index:
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.describe_index(name="docs-example")
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });
await pc.describeIndex('docs-example');
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.model.*;
public class DescribeIndexExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOURE_API_KEY").build();
IndexModel indexModel = pc.describeIndex("docs-example");
System.out.println(indexModel);
}
}
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func prettifyStruct(obj interface{}) string {
bytes, _ := json.MarshalIndent(obj, "", " ")
return string(bytes)
}
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idx, err := pc.DescribeIndex(ctx, "docs-example")
if err != nil {
log.Fatalf("Failed to describe index \"%v\": %v", idx.Name, err)
} else {
fmt.Printf("index: %v\n", prettifyStruct(idx))
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl -i -X GET "https://api.pinecone.io/indexes/docs-example" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10"
{'deletion_protection': 'disabled',
'dimension': 1536,
'host': 'docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io',
'metric': 'cosine',
'name': 'docs-example-dense',
'spec': {'serverless': {'cloud': 'aws', 'region': 'us-east-1'}},
'status': {'ready': True, 'state': 'Ready'},
'tags': {'environment': 'development'},
'vector_type': 'dense'}
{
name: 'docs-example-dense',
dimension: 1536,
metric: 'cosine',
host: 'docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io',
deletionProtection: 'disabled',
tags: { environment: 'development', example: 'tag' },
embed: undefined,
spec: { pod: undefined, serverless: { cloud: 'aws', region: 'us-east-1' } },
status: { ready: true, state: 'Ready' },
vectorType: 'dense'
}
class IndexModel {
name: docs-example-dense
dimension: 1536
metric: cosine
host: docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io
deletionProtection: disabled
tags: {environment=development}
embed: null
spec: class IndexModelSpec {
pod: null
serverless: class ServerlessSpec {
cloud: aws
region: us-east-1
additionalProperties: null
}
additionalProperties: null
}
status: class IndexModelStatus {
ready: true
state: Ready
additionalProperties: null
}
vectorType: dense
additionalProperties: null
}
index: {
"name": "docs-example-dense",
"host": "docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io",
"metric": "cosine",
"vector_type": "dense",
"deletion_protection": "disabled",
"dimension": 1536,
"spec": {
"serverless": {
"cloud": "aws",
"region": "us-east-1"
}
},
"status": {
"ready": true,
"state": "Ready"
},
"tags": {
"environment": "development"
}
}
{
"name": "docs-example-dense",
"vector_type": "dense",
"metric": "cosine",
"dimension": 1536,
"status": {
"ready": true,
"state": "Ready"
},
"host": "docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io",
"spec": {
"serverless": {
"region": "us-east-1",
"cloud": "aws"
}
},
"deletion_protection": "disabled",
"tags": {
"environment": "development"
}
}
Do not target an index by name in production.When you target an index by name for data operations such as
upsert and query, the SDK gets the unique DNS host for the index using the describe_index operation. This is convenient for testing but should be avoided in production because describe_index uses a different API than data operations and therefore adds an additional network call and point of failure. Instead, you should get an index host once and cache it for reuse or specify the host directly.Delete an index
Use thedelete_index operation to delete an index and all of its associated resources.
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.delete_index(name="docs-example")
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'
const pc = new Pinecone({
apiKey: 'YOUR_API_KEY'
});
await pc.deleteIndex('docs-example');
import io.pinecone.clients.Pinecone;
public class DeleteIndexExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
pc.deleteIndex("docs-example");
}
}
package main
import (
"context"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
indexName := "docs-example"
err = pc.DeleteIndex(ctx, indexName)
if err != nil {
log.Fatalf("Failed to delete index: %v", err)
} else {
fmt.Println("Index \"%v\" deleted successfully", indexName)
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl -i -X DELETE "https://api.pinecone.io/indexes/docs-example" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10"
403 - FORBIDDEN status with the following error:
Deletion protection is enabled for this index. Disable deletion protection before retrying.
You can delete an index using the Pinecone console. For the index you want to delete, click the three dots to the right of the index name, then click Delete.
Associate an embedding model
Integrated inference lets you upsert and search without extra steps for embedding data and reranking results. To configure an existing serverless index for an embedding model, use theconfigure_index operation as follows:
- Set
embed.modelto one of Pinecone’s hosted embedding models. - Set
embed.field_mapto the name of the field in your source document that contains the data for embedding.
The
vector_type, metric, and dimension of the index must be supported by the specified embedding model.# pip install --upgrade pinecone
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.configure_index(
name="docs-example",
embed={
"model":"llama-text-embed-v2",
"field_map":{"text": "chunk_text"}
}
)
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });
await pc.configureIndex('docs-example', {
embed: {
model: 'llama-text-embed-v2',
fieldMap: { text: 'chunk_text' },
},
});
PINECONE_API_KEY="YOUR_API_KEY"
curl -s -X PATCH "https://api.pinecone.io/indexes/docs-example" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-d '{
"embed": {
"model": "llama-text-embed-v2",
"field_map": {
"text": "chunk_text"
}
}
}'
Configure deletion protection
This feature requires Pinecone API version
2024-07, Python SDK v5.0.0, Node.js SDK v3.0.0, Java SDK v2.0.0, or Go SDK v1.0.0 or later.Enable deletion protection
You can prevent an index and its data from accidental deleting when creating a new index or after its been created. In both cases, you set thedeletion_protection parameter to enabled.
Enabling deletion protection does not prevent namespace deletions.
# pip install "pinecone[grpc]"
# Serverless index
from pinecone.grpc import PineconeGRPC as Pinecone
from pinecone import ServerlessSpec
pc = Pinecone(api_key="YOUR_API_KEY")
pc.create_index(
name="docs-example",
dimension=1536,
metric="cosine",
spec=ServerlessSpec(
cloud="aws",
region="us-east-1"
),
deletion_protection="enabled"
)
// npm install @pinecone-database/pinecone
// Serverles index
import { Pinecone } from '@pinecone-database/pinecone'
const pc = new Pinecone({
apiKey: 'YOUR_API_KEY'
});
await pc.createIndex({
name: 'docs-example',
dimension: 1536,
metric: 'cosine',
spec: {
serverless: {
cloud: 'aws',
region: 'us-east-1'
}
},
deletionProtection: 'enabled',
});
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.model.IndexModel;
import org.openapitools.db_control.client.model.DeletionProtection;
// Serverless index
public class CreateServerlessIndexExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
pc.createServerlessIndex("docs-example", "cosine", 1536, "aws", "us-east-1", DeletionProtection.enabled);
}
}
package main
import (
"context"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// Serverless index
indexName := "docs-example"
vectorType := "dense"
dimension := int32(1536)
metric := pinecone.Cosine
deletionProtection := pinecone.DeletionProtectionDisabled
idx, err := pc.CreateServerlessIndex(ctx, &pinecone.CreateServerlessIndexRequest{
Name: indexName,
VectorType: &vectorType,
Dimension: &dimension,
Metric: &metric,
Cloud: pinecone.Aws,
Region: "us-east-1",
DeletionProtection: &deletionProtection,
Tags: &pinecone.IndexTags{ "environment": "development" },
})
if err != nil {
log.Fatalf("Failed to create serverless index: %v", err)
} else {
fmt.Printf("Successfully created serverless index: %v", idx.Name)
}
}
PINECONE_API_KEY="YOUR_API_KEY"
# Serverless index
curl -s "https://api.pinecone.io/indexes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-d '{
"name": "docs-example",
"dimension": 1536,
"metric": "cosine",
"spec": {
"serverless": {
"cloud": "aws",
"region": "us-east-1"
}
},
"deletion_protection": "enabled"
}'
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.configure_index(
name="docs-example",
deletion_protection="enabled"
)
import { Pinecone } from '@pinecone-database/pinecone';
const client = new Pinecone({ apiKey: 'YOUR_API_KEY' });
await client.configureIndex('docs-example', { deletionProtection: 'enabled' });
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.model.*;
public class ConfigureIndexExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
pc.configureServerlessIndex("docs-example", DeletionProtection.ENABLED);
}
}
package main
import (
"context"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idx, err := pc.ConfigureIndex(ctx, "docs-example", pinecone.ConfigureIndexParams{DeletionProtection: "enabled"})
if err != nil {
log.Fatalf("Failed to configure index \"%v\": %v", idx.Name, err)
} else {
fmt.Printf("Successfully configured index \"%v\"", idx.Name)
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl -s -X PATCH "https://api.pinecone.io/indexes/docs-example-curl" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-d '{
"deletion_protection": "enabled"
}'
403 - FORBIDDEN status with the following error:
Deletion protection is enabled for this index. Disable deletion protection before retrying.
Disable deletion protection
Before you can delete an index with deletion protection enabled, you must first disable deletion protection as follows:from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.configure_index(
name="docs-example",
deletion_protection="disabled"
)
import { Pinecone } from '@pinecone-database/pinecone';
const client = new Pinecone({ apiKey: 'YOUR_API_KEY' });
await client.configureIndex('docs-example', { deletionProtection: 'disabled' });
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.model.*;
public class ConfigureIndexExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
pc.configureServerlessIndex("docs-example", DeletionProtection.DISABLED);
}
}
package main
import (
"context"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idx, err := pc.ConfigureIndex(ctx, "docs-example", pinecone.ConfigureIndexParams{DeletionProtection: "disabled"})
if err != nil {
log.Fatalf("Failed to configure index \"%v\": %v", idx.Name, err)
} else {
fmt.Printf("Successfully configured index \"%v\"", idx.Name)
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl -s -X PATCH "https://api.pinecone.io/indexes/docs-example-curl" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-d '{
"deletion_protection": "disabled"
}'
Configure index tags
Tags are key-value pairs that you can use to categorize and identify the index.Add tags
To add tags to an index, use thetags parameter when creating a new index or configuring an existing index.
To add tags when creating a new index:
from pinecone.grpc import PineconeGRPC as Pinecone
from pinecone import ServerlessSpec
pc = Pinecone(api_key="YOUR_API_KEY")
pc.create_index(
name="docs-example",
dimension=1536,
metric="cosine",
spec=ServerlessSpec(
cloud="aws",
region="us-east-1"
),
deletion_protection="disabled",
tags={
"example": "tag",
"environment": "development"
}
)
import { Pinecone } from '@pinecone-database/pinecone'
const client = new Pinecone({ apiKey: 'YOUR_API_KEY' });
await pc.createIndex({
name: 'docs-example',
dimension: 1536,
metric: 'cosine',
spec: {
serverless: {
cloud: 'aws',
region: 'us-east-1'
}
},
deletionProtection: 'disabled',
tags: { example: 'tag', environment: 'development' },
});
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.model.IndexModel;
import org.openapitools.db_control.client.model.DeletionProtection;
import java.util.HashMap;
// Serverless index
public class CreateServerlessIndexExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
HashMap<String, String> tags = new HashMap<>();
tags.put("tag", "development");
pc.createServerlessIndex("docs-example", "cosine", 1536, "aws", "us-east-1", DeletionProtection.DISABLED, tags);
}
}
package main
import (
"context"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// Serverless index
idx, err := pc.CreateServerlessIndex(ctx, &pinecone.CreateServerlessIndexRequest{
Name: "docs-example",
Dimension: 1536,
Metric: pinecone.Cosine,
Cloud: pinecone.Aws,
Region: "us-east-1",
DeletionProtection: "disabled",
Tags: &pinecone.IndexTags{ "example": "tag", "environment": "development" },
})
if err != nil {
log.Fatalf("Failed to create serverless index: %v", err)
} else {
fmt.Printf("Successfully created serverless index: %v", idx.Name)
}
}
PINECONE_API_KEY="YOUR_API_KEY"
# Serverless index
curl -s "https://api.pinecone.io/indexes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-d '{
"name": "docs-example",
"dimension": 1536,
"metric": "cosine",
"spec": {
"serverless": {
"cloud": "aws",
"region": "us-east-1"
}
},
"tags": {
"example": "tag",
"environment": "development"
},
"deletion_protection": "disabled"
}'
You can add tags during index creation using the Pinecone console.
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.configure_index(
name="docs-example",
tags={
example: "tag",
environment: "development"
}
)
import { Pinecone } from '@pinecone-database/pinecone';
const client = new Pinecone({ apiKey: 'YOUR_API_KEY' });
await client.configureIndex('docs-example', { tags: { example: 'tag', environment: 'development' }});
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.model.*;
import java.util.HashMap;
public class ConfigureIndexExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
HashMap<String, String> tags = new HashMap<>();
tags.put("tag", "development");
pc.configureServerlessIndex("docs-example", DeletionProtection.ENABLED, tags);
}
}
package main
import (
"context"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idx, err := pc.ConfigureIndex(ctx,
"docs-example",
pinecone.ConfigureIndexParams{
Tags: pinecone.IndexTags{
"example": "tag",
"environment": "development",
},
},
)
if err != nil {
log.Fatalf("Failed to configure index \"%v\": %v", idx.Name, err)
} else {
fmt.Printf("Successfully configured index \"%v\"", idx.Name)
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl -s -X PATCH "https://api.pinecone.io/indexes/docs-example-curl" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-d '{
"tags": {
"example": "tag",
"environment": "development"
}
}'
You can add or update tags when configuring an existing index using the Pinecone console. Find the index to edit and click the ellipsis (…) menu > Add tags.
View tags
To view the tags of an index, list all indexes in a project or get information about a specific index.Remove tags
To remove a tag from an index, configure the index and use thetags parameter to send the tag key with an empty value ("").
The following example removes the example: tag tag from docs-example:
from pinecone.grpc import PineconeGRPC as Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.configure_index(
name="docs-example",
tags={"example": ""}
)
import { Pinecone } from '@pinecone-database/pinecone';
const client = new Pinecone({ apiKey: 'YOUR_API_KEY' });
await client.configureIndex('docs-example', { tags: { example: '' }});
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.model.*;
import java.util.HashMap;
public class ConfigureIndexExample {
public static void main(String[] args) {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
HashMap<String, String> tags = new HashMap<>();
tags.put("example", "");
pc.configureServerlessIndex("docs-example", DeletionProtection.ENABLED, tags);
}
}
package main
import (
"context"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idx, err := pc.ConfigureIndex(ctx,
"docs-example",
pinecone.ConfigureIndexParams{
Tags: pinecone.IndexTags{
"example": "",
},
},
)
if err != nil {
log.Fatalf("Failed to configure index \"%v\": %v", idx.Name, err)
} else {
fmt.Printf("Successfully configured index \"%v\"", idx.Name)
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl -s -X PATCH "https://api.pinecone.io/indexes/docs-example-curl" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-d '{
"tags": {
"example": ""
}
}'
You can remove tags from an index using the Pinecone console. Find the index to edit and click the ellipsis (…) menu > __ tags.
List backups for an index
Serverless indexes can be backed up. You can list all backups for a specific index, as in the following example:from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
index_backups = pc.list_backups(index_name="docs-example")
print(index_backups)
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })
const indexBackups = await pc.listBackups({ indexName: 'docs-example' });
console.log(indexBackups);
import io.pinecone.clients.Pinecone;
import org.openapitools.db_control.client.ApiException;
import org.openapitools.db_control.client.model.*;
public class CreateBackup {
public static void main(String[] args) throws ApiException {
Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
String indexName = "docs-example";
BackupList indexBackupList = pc.listIndexBackups(indexName);
System.out.println(indexBackupList);
}
}
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/v4/pinecone"
)
func prettifyStruct(obj interface{}) string {
bytes, _ := json.MarshalIndent(obj, "", " ")
return string(bytes)
}
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
indexName := "docs-example"
limit := 2
indexBackups, err := pc.ListBackups(ctx, &pinecone.ListBackupsParams{
Limit: &limit,
IndexName: &indexName,
})
if err != nil {
log.Fatalf("Failed to list backups: %v", err)
}
fmt.Printf(prettifyStruct(indexBackups))
}
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_NAME="docs-example"
curl -X GET "https://api.pinecone.io/indexes/$INDEX_NAME/backups" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-H "accept: application/json"
[{
"backup_id": "8c85e612-ed1c-4f97-9f8c-8194e07bcf71",
"source_index_name": "docs-example",
"source_index_id": "f73b36c9-faf5-4a2c-b1d6-4013d8b1cc74",
"status": "Ready",
"cloud": "aws",
"region": "us-east-1",
"tags": {},
"name": "example-backup",
"description": "Monthly backup of production index",
"dimension": 1024,
"record_count": 98,
"namespace_count": 3,
"size_bytes": 1069169,
"created_at": "2025-05-15T00:52:10.809305882Z"
}]
{
data: [
{
backupId: '8c85e612-ed1c-4f97-9f8c-8194e07bcf71',
sourceIndexName: 'docs-example',
sourceIndexId: 'f73b36c9-faf5-4a2c-b1d6-4013d8b1cc74',
name: 'example-backup',
description: 'Monthly backup of production index',
status: 'Ready',
cloud: 'aws',
region: 'us-east-1',
dimension: 1024,
metric: undefined,
recordCount: 98,
namespaceCount: 3,
sizeBytes: 1069169,
tags: {},
createdAt: '2025-05-14T16:37:25.625540Z'
}
],
pagination: undefined
}
class BackupList {
data: [class BackupModel {
backupId: 8c85e612-ed1c-4f97-9f8c-8194e07bcf71
sourceIndexName: docs-example
sourceIndexId: f73b36c9-faf5-4a2c-b1d6-4013d8b1cc74
name: example-backup
description: Monthly backup of production index
status: Initializing
cloud: aws
region: us-east-1
dimension: null
metric: null
recordCount: null
namespaceCount: null
sizeBytes: null
tags: {}
createdAt: 2025-05-16T19:46:26.248428Z
additionalProperties: null
}]
pagination: null
additionalProperties: null
}
{
"data": [
{
"backup_id": "bf2cda5d-b233-4a0a-aae9-b592780ad3ff",
"cloud": "aws",
"created_at": "2025-05-16T18:01:51.531129Z",
"description": "Monthly backup of production index",
"dimension": 0,
"name": "example-backup",
"namespace_count": 1,
"record_count": 96,
"region": "us-east-1",
"size_bytes": 86393,
"source_index_id": "bcb5b3c9-903e-4cb6-8b37-a6072aeb874f",
"source_index_name": "docs-example",
"status": "Ready",
"tags": {}
},
{
"backup_id": "e12269b0-a29b-4af0-9729-c7771dec03e3",
"cloud": "aws",
"created_at": "2025-05-14T17:00:45.803146Z",
"dimension": 0,
"name": "example-backup2",
"namespace_count": 1,
"record_count": 96,
"region": "us-east-1",
"size_bytes": 86393,
"source_index_id": "bcb5b3c9-903e-4cb6-8b37-a6072aeb874f",
"source_index_name": "docs-example",
"status": "Ready"
}
],
"pagination": {
"next": "eyJsaW1pdCI6Miwib2Zmc2V0IjoyfQ=="
}
}
{
"data":
[
{
"backup_id":"9947520e-d5a1-4418-a78d-9f464c9969da",
"source_index_id":"8433941a-dae7-43b5-ac2c-d3dab4a56b2b",
"source_index_name":"docs-example",
"tags":{},
"name":"example-backup",
"description":"Monthly backup of production index",
"status":"Pending",
"cloud":"aws",
"region":"us-east-1",
"dimension":1024,
"record_count":98,
"namespace_count":3,
"size_bytes":1069169,
"created_at":"2025-03-11T18:29:50.549505Z"
}
],
"pagination":null
}