Tags are key-value pairs that you can use to categorize and identify the index. This page shows you how to tag an index.
To add tags to an index, use the tags
parameter when creating a new index or when configuring an existing index.
To add tags when creating a new index:
PINECONE_API_KEY="YOUR_API_KEY"
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: 2024-10" \
-d '{
"name": "example-index",
"dimension": 1536,
"metric": "cosine",
"spec": {
"serverless": {
"cloud": "aws",
"region": "us-east-1"
}
},
"tags": {
"example": "tag",
"environment": "production"
},
"deletion_protection": "disabled"
}'
To add or update tags when configuring an existing index:
PINECONE_API_KEY="YOUR_API_KEY"
curl -s -X PATCH "https://api.pinecone.io/indexes/example-index" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-API-Version: 2024-10" \
-d '{
"tags": {
"example2": "tag2",
"environment": "testing"
}
}'
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.
To view the tags of an index, list all indexes in a project or get information about a specific index.
For example, to list all indexes in a project:
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: 2024-10"
{
"indexes": [
{
"name": "example-index1",
"metric": "cosine",
"dimension": 1536,
"status": {
"ready": true,
"state": "Ready"
},
"host": "example-index1-4mkljsz.svc.aped-4627-b74a.pinecone.io",
"spec": {
"serverless": {
"region": "us-east-1",
"cloud": "aws"
}
},
"tags": {
"example": "tag",
"environment": "production"
}
},
{
"name": "example-index2",
"metric": "cosine",
"dimension": 1536,
"status": {
"ready": true,
"state": "Ready"
},
"host": "example-index2-4mkljsz.svc.us-east-1-aws.pinecone.io",
"spec": {
"pod": {
"replicas": 1,
"shards": 1,
"pods": 1,
"pod_type": "p1.x1",
"environment": "us-east-1-aws"
}
},
"tags": {
"example2": "tag2",
"environment": "testing"
}
}
]
}
To remove tags from an index, use the tags
parameter with an empty dictionary {}
when configuring an existing index.
PINECONE_API_KEY="YOUR_API_KEY"
curl -s -X PATCH "https://api.pinecone.io/indexes/example-index" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-API-Version: 2024-10" \
-d '{
"tags": {}
}'
You can remove tags from an index using the Pinecone console. Find the index to edit and click the ellipsis (..) menu > Add tags.