If a vector value is included, it will overwrite the previous value. If `set_metadata` is included, only the specified metadata fields are modified, and if a specified metadata field does not exist, it is added.
For guidance and examples, see [Update data](/guides/manage-data-update-data).

:::code-group
```shell curl
# 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: 2026-07" \
  -d '{
        "id": "id-3",
        "values": [4.0, 2.0],
        "setMetadata": {"type": "comedy"},
        "namespace": "example-namespace"
      }'
```
:::

`POST /vectors/update`

:::code-group
```json title="200"
{
  "matchedRecords": 42
}
```

```json title="400"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```

```json title="4XX"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```

```json title="5XX"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```
:::

#### Authorizations

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `Api-Key` | `string` | - |  |

An API Key is required to call Pinecone APIs. Get yours from the [console](https://app.pinecone.io/).

#### Headers

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `X-Pinecone-Api-Version` | `string` | `2026-07` | Required date-based version header |

#### Body

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id?` | `string` | - | Vector's unique id. Required string length: 1 - 512. Example: example-vector-1 |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `values?` | `number[]` | - | Vector data. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `sparseValues?` | `object` | - | Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length. |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `indices` | `integer[]` | - | The indices of the sparse data. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `values` | `number[]` | - | The corresponding values of the sparse data, which must be with the same length as the indices. |
:::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `setMetadata?` | `object` | - | Metadata to set for the record. Field names may not begin with $, which is reserved for filter operators. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `namespace?` | `string` | - | The namespace containing the record to update. Example: example-namespace |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `filter?` | `object` | - |  |

A metadata filter expression. When updating metadata across records in a namespace, the update is applied to all records that match the filter. See [Understanding metadata](/guides/index-data-indexing-overview#metadata).

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `dryRun?` | `boolean` | `false` | If true, return the number of records that match the filter, but do not execute the update. Default is false. Example: false |

#### Response

`200` — A successful response.

The response for the `update` operation.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `matchedRecords?` | `integer` | - | The number of records that matched the filter (if a filter was provided). Example: 42 |

## Related pages

- [Search with a vector](./database-data-plane-query.md)
- [Search with text](./database-data-plane-search-records.md)
- [Upsert records](./database-data-plane-upsert.md)
- [Upsert text](./database-data-plane-upsert-records.md)
- [Fetch records](./database-data-plane-fetch.md)
- [Fetch records by metadata](./database-data-plane-fetch-by-metadata.md)
- [Delete records](./database-data-plane-delete.md)
- [List record IDs](./database-data-plane-list.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.
