For guidance and examples, see [Update data](/guides/manage-data-update-data).

```python Python theme={null}
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key="YOUR_API_KEY")

# To get the unique host for an index, 
# see https://docs.pinecone.io/guides/manage-data/target-an-index
index = pc.Index(host="INDEX_HOST")

index.update(
	id="id-3", 
	values=[4.0, 2.0], 
	set_metadata={"genre": "comedy"},
	namespace="example-namespace"
)
```

```javascript JavaScript theme={null}
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'

const pc = new Pinecone({ apiKey: "YOUR_API_KEY" })

// To get the unique host for an index, 
// see https://docs.pinecone.io/guides/manage-data/target-an-index
const index = pc.index("INDEX_NAME", "INDEX_HOST")

await index.namespace('example-namespace').update({
  id: 'id-3',
  values: [4.0, 2.0],
  metadata: {
    genre: "comedy",
  },
});
```

```java Java theme={null}
import com.google.protobuf.Struct;
import com.google.protobuf.Value;
import io.pinecone.clients.Index;
import io.pinecone.configs.PineconeConfig;
import io.pinecone.configs.PineconeConnection;
import io.pinecone.proto.UpdateResponse;

import java.util.Arrays;
import java.util.List;

public class UpdateExample {
    public static void main(String[] args) {
        PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
        // To get the unique host for an index, 
        // see https://docs.pinecone.io/guides/manage-data/target-an-index
        config.setHost("INDEX_HOST");
        PineconeConnection connection = new PineconeConnection(config);
        Index index = new Index(connection, "INDEX_NAME");
        List<Float> values = Arrays.asList(4.0f, 2.0f);
		Struct metaData = Struct.newBuilder()
			.putFields("genre",
					Value.newBuilder().setStringValue("comedy").build())
			.build();
        UpdateResponse updateResponse = index.update("id-3", values, metaData, "example-namespace", null, null);
        System.out.println(updateResponse);
    }
}
```

```go Go theme={null}
package main

import (
    "context"
    "log"

    "github.com/pinecone-io/go-pinecone/v3/pinecone"
    "google.golang.org/protobuf/types/known/structpb"
)

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)
    }

    // To get the unique host for an index, 
    // see https://docs.pinecone.io/guides/manage-data/target-an-index
    idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST", Namespace: "example-namespace"})
    if err != nil {
        log.Fatalf("Failed to create IndexConnection for Host: %v", err)
  	}

    id := "id-3"

    metadataMap := map[string]interface{}{
        "genre": "comedy",
    }

    metadataFilter, err := structpb.NewStruct(metadataMap)
    if err != nil {
        log.Fatalf("Failed to create metadata map: %v", err)
    }

    err = idxConnection.UpdateVector(ctx, &pinecone.UpdateVectorRequest{
        Id:       id,
        Metadata: metadataFilter,
    })
    if err != nil {
        log.Fatalf("Failed to update vector with ID %v: %v", id, err)
    }
}
```

```csharp C# theme={null}
using Pinecone;

var pinecone = new PineconeClient("YOUR_API_KEY");

// To get the unique host for an index, 
// see https://docs.pinecone.io/guides/manage-data/target-an-index
var index = pinecone.Index(host: "INDEX_HOST");

var updateResponse = await index.UpdateAsync(new UpdateRequest {
    Id = "id-3",
    Values = new[] { 4.0f, 2.0f },
    SetMetadata = new Metadata { ["genre"] = "comedy" },
    Namespace = "example-namespace",
});
```

```shell curl theme={null}
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl "https://$INDEX_HOST/vectors/update" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-Api-Version: 2025-01" \
  -d '{
        "id": "id-3",
        "values": [4.0, 2.0],
        "setMetadata": {"type": "comedy"},
        "namespace": "example-namespace"
      }'
```

```json curl theme={null}
{}
```

`POST /vectors/update`

:::code-group
```bash title="cURL"
curl --request POST \
  --url https://{index_host}/vectors/update \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "example-vector-1",
  "values": [
    0.1,
    0.2,
    0.3,
    0.4,
    0.5,
    0.6,
    0.7,
    0.8
  ],
  "sparseValues": {
    "indices": [
      1,
      312,
      822,
      14,
      980
    ],
    "values": [
      0.1,
      0.2,
      0.3,
      0.4,
      0.5
    ]
  },
  "setMetadata": {
    "genre": "documentary",
    "year": 2019
  },
  "namespace": "example-namespace"
}'
```

```json title="200"
{}
```
:::

## Authorizations

- `Authorization` (header, string, required) — Bearer authentication header of the form `Bearer <token>`.

## Body

- `id` (body, string, required) — Vector's unique id.
- `values` (body, number\[]) — Vector data.
- `sparseValues` (body, object) — Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length.
- `setMetadata` (body, object) — Metadata to set for the vector.
- `namespace` (body, string) — The namespace containing the vector to update.

## Response

- `200` — A successful response.
- `400` — Bad request. The request body included invalid request parameters.
- `4XX` — An unexpected error response.
- `5XX` — An unexpected error response.

## Related pages

- [Search with a vector](./database-2026-07-data-plane-query.md)
- [Search with text](./database-2026-07-data-plane-search-records.md)
- [Upsert records](./database-2026-07-data-plane-upsert.md)
- [Upsert text](./database-2026-07-data-plane-upsert-records.md)
- [Fetch records](./database-2026-07-data-plane-fetch.md)
- [Fetch records by metadata](./database-2026-07-data-plane-fetch-by-metadata.md)
- [Update a record](./database-2026-07-data-plane-update.md)
- [Delete records](./database-2026-07-data-plane-delete.md)
- [List record IDs](./database-2026-07-data-plane-list.md)
- [Search with a vector](./database-2026-04-data-plane-query.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
