Tags are key-value pairs that you can use to categorize and identify the index. This page shows you how to tag an index.

This feature requires Pinecone API version 2024-10 or later.

Add tags to 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:

curl
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: 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"
      }'

You can add tags during index creation using the Pinecone console.

To add or update tags when configuring an existing index:

curl
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.

View index 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:

curl
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"
            }
        }
    ]
}

You can view index tags using the Pinecone console.

Remove tags from an index

To remove a tag from an index, configure the index and use the tags parameter to send the tag key with an empty value ("").

The following example removes the example: tag tag:

curl
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": {
            "example": ""
        }
        }'

You can remove tags from an index using the Pinecone console. Find the index to edit and click the ellipsis (..) menu > __ tags.