> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vectoraidb.actian.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update payloads

> Modify payload metadata for existing points.

Use payload operations to update metadata without changing vectors. `set_payload` merges fields, `overwrite_payload` replaces the full payload, `delete_payload` removes selected keys, and `clear_payload` removes all payload data from matching points.

> [!NOTE]
>
> Before you begin, make sure the target points already exist in your collection. Payload operations can target explicit point IDs or a filter.

## Merge payload fields

Use `set_payload` to add or replace specific fields while preserving the rest of each point's payload.

```python Python theme={null}
from actian_vectorai import VectorAIClient

COLLECTION = "products"

with VectorAIClient("localhost:6574") as client:
    result = client.points.set_payload(
        COLLECTION,
        {"price": 899.99, "in_stock": True, "updated": True},
        ids=[1],
    )
    print(f"Updated payload: {result}")
```

```javascript JavaScript theme={null}
import { VectorAIClient } from '@actian/vectorai-client';

const COLLECTION = 'products';

async function main() {
  const client = new VectorAIClient('localhost:6574');
  try {
    const result = await client.points.setPayload(
      COLLECTION,
      { price: 899.99, inStock: true, updated: true },
      { ids: [1] },
    );
    console.log('Updated payload:', result);
  } finally {
    client.close();
  }
}

main().catch(console.error);
```

## Replace an entire payload

Use `overwrite_payload` when the new object should become the complete payload for the selected points.

```python Python theme={null}
from actian_vectorai import VectorAIClient

COLLECTION = "products"

with VectorAIClient("localhost:6574") as client:
    result = client.points.overwrite_payload(
        COLLECTION,
        {
            "name": "Gaming Laptop",
            "category": "electronics",
            "price": 1299.99,
        },
        ids=[1],
    )
    print(f"Replaced payload: {result}")
```

```javascript JavaScript theme={null}
import { VectorAIClient } from '@actian/vectorai-client';

const COLLECTION = 'products';

async function main() {
  const client = new VectorAIClient('localhost:6574');
  try {
    const result = await client.points.overwritePayload(
      COLLECTION,
      {
        name: 'Gaming Laptop',
        category: 'electronics',
        price: 1299.99,
      },
      { ids: [1] },
    );
    console.log('Replaced payload:', result);
  } finally {
    client.close();
  }
}

main().catch(console.error);
```

## Remove payload fields

Use `delete_payload` to remove selected keys while leaving other payload fields unchanged.

```python Python theme={null}
from actian_vectorai import VectorAIClient

COLLECTION = "products"

with VectorAIClient("localhost:6574") as client:
    result = client.points.delete_payload(
        COLLECTION,
        ["temporary_flag", "debug_info"],
        ids=[1, 2],
        strict=False,
    )
    print(f"Removed payload fields: {result}")
```

```javascript JavaScript theme={null}
import { VectorAIClient } from '@actian/vectorai-client';

const COLLECTION = 'products';

async function main() {
  const client = new VectorAIClient('localhost:6574');
  try {
    const result = await client.points.deletePayload(
      COLLECTION,
      ['temporary_flag', 'debug_info'],
      { ids: [1, 2], strict: false },
    );
    console.log('Removed payload fields:', result);
  } finally {
    client.close();
  }
}

main().catch(console.error);
```

## Clear all payload data

Use `clear_payload` when matching points should keep their vectors and IDs but have no payload metadata.

```python Python theme={null}
from actian_vectorai import VectorAIClient

COLLECTION = "products"

with VectorAIClient("localhost:6574") as client:
    result = client.points.clear_payload(COLLECTION, ids=[3])
    print(f"Cleared payload: {result}")
```

```javascript JavaScript theme={null}
import { VectorAIClient } from '@actian/vectorai-client';

const COLLECTION = 'products';

async function main() {
  const client = new VectorAIClient('localhost:6574');
  try {
    const result = await client.points.clearPayload(COLLECTION, { ids: [3] });
    console.log('Cleared payload:', result);
  } finally {
    client.close();
  }
}

main().catch(console.error);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.