> ## Documentation Index
> Fetch the complete documentation index at: https://actianvectorai-docs-low-effort-fixes.mintlify.site/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.
</Note>

## Merge payload fields

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

<CodeGroup>
  ```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);
  ```
</CodeGroup>

## Replace an entire payload

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

<CodeGroup>
  ```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);
  ```
</CodeGroup>

## Remove payload fields

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

<CodeGroup>
  ```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);
  ```
</CodeGroup>

## Clear all payload data

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

<CodeGroup>
  ```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);
  ```
</CodeGroup>
