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

# Upsert points

> Insert or update points in a collection. If a point with the given ID already exists, it is overwritten. All points in the request are inserted or updated atomically.




## OpenAPI

````yaml put /collections/{collection_name}/points
openapi: 3.0.3
info:
  title: Actian VectorAI DB - Points API
  description: Point CRUD operations for VectorAI DB.
  version: 1.0.0
  contact:
    name: Actian Corporation
    url: https://www.actian.com
servers:
  - url: http://localhost:6573
    description: Local development server (REST API)
  - url: https://api.vectorai.actian.com
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Points
    description: Point data operations
paths:
  /collections/{collection_name}/points:
    put:
      tags:
        - Points
      summary: Upsert points
      description: >
        Insert or update points in a collection. If a point with the given ID
        already exists, it is overwritten. All points in the request are
        inserted or updated atomically.
      operationId: upsert_points
      parameters:
        - name: collection_name
          in: path
          required: true
          schema:
            type: string
          example: my_collection
          description: The name of the collection to upsert points into.
        - name: wait
          in: query
          description: >-
            If `true`, the request blocks until all points are indexed. If
            `false`, returns immediately and indexing continues in the
            background. Defaults to `true`.
          required: false
          schema:
            type: boolean
            default: true
            example: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - points
              properties:
                points:
                  type: array
                  description: Array of point objects to insert or update.
                  items:
                    type: object
                    required:
                      - id
                      - vector
                    properties:
                      id:
                        oneOf:
                          - type: integer
                          - type: string
                        example: 1
                        description: >-
                          Unique identifier for the point. Accepts an integer or
                          a UUID string.
                      vector:
                        type: array
                        items:
                          type: number
                        example:
                          - 0.1
                          - 0.2
                          - 0.3
                        description: >-
                          The dense vector embedding for this point. The number
                          of dimensions must match the collection's configured
                          vector size.
                      payload:
                        type: object
                        example:
                          category: A
                          value: 100
                        description: >-
                          Optional JSON metadata associated with the point. Can
                          contain any valid JSON object with nested fields.
            examples:
              batch_upsert:
                summary: Batch upsert
                value:
                  points:
                    - id: 1
                      vector:
                        - 0.1
                        - 0.2
                        - 0.3
                        - 0.4
                      payload:
                        category: A
                        value: 10
                    - id: 2
                      vector:
                        - 0.5
                        - 0.6
                        - 0.7
                        - 0.8
                      payload:
                        category: B
                        value: 20
      responses:
        '200':
          description: Points upserted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  usage:
                    type: object
                    description: Resource usage information for this request.
                    properties:
                      hardware:
                        type: object
                        nullable: true
                        description: >-
                          Hardware resource counters for the operation,
                          including CPU, payload I/O, payload index I/O, and
                          vector I/O metrics.
                  time:
                    type: number
                    format: double
                    example: 0.058295368
                    description: Time spent to process this request, in seconds.
                  status:
                    type: string
                    example: ok
                    description: Operation status. Returns `ok` on success.
                  result:
                    type: object
                    description: Operation result containing the status of the upsert.
                    properties:
                      operation_id:
                        type: integer
                        example: 0
                        description: Unique identifier for the operation.
                      status:
                        type: string
                        example: Completed
                        description: >-
                          Status of the operation. Returns `Completed` when the
                          operation finishes successfully.
              example:
                usage:
                  hardware: null
                time: 0.058295368
                status: ok
                result:
                  operation_id: 0
                  status: Completed
        4XX:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: Python
          label: Batch upsert
          source: |
            from actian_vectorai_client import VectorAIClient, PointStruct
            import random

            with VectorAIClient("localhost:6574") as client:
                # Batch upsert multiple points
                points = [
                    PointStruct(
                        id=i,
                        vector=[random.gauss(0, 1) for _ in range(32)],
                        payload={"category": ["A", "B", "C"][i % 3], "value": i * 10}
                    )
                    for i in range(1, 21)
                ]
                result = client.points.upsert("my_collection", points)
                print(f"✓ Upserted {len(points)} points")
        - lang: Python
          label: Single point
          source: |
            from actian_vectorai_client import VectorAIClient

            with VectorAIClient("localhost:6574") as client:
                # Upsert single point (convenience method)
                result = client.points.upsert_single(
                    "my_collection",
                    id=100,
                    vector=[0.1, 0.2, 0.3, 0.4],
                    payload={"category": "special"}
                )
                print(f"✓ Upserted point 100")
        - lang: JavaScript
          label: Batch upsert
          source: |
            import { VectorAIClient } from '@actian/vectorai-client';

            const client = new VectorAIClient('localhost:6574');

            await client.points.upsert('my_collection', [
                { id: 1, vector: [0.1, 0.2, 0.3, 0.4], payload: { category: 'A', value: 10 } },
                { id: 2, vector: [0.5, 0.6, 0.7, 0.8], payload: { category: 'B', value: 20 } },
            ], { wait: true });
            console.log('Upserted 2 points');

            client.close();
        - lang: cURL
          label: Upsert points
          source: >
            curl -X PUT "http://localhost:6573/collections/my_collection/points"
            \
              -H "Content-Type: application/json" \
              -H 'Authorization: Bearer <admin-jwt-or-access-token>' \
              -d '{
                "points": [
                  {
                    "id": 1,
                    "vector": [0.1, 0.2, 0.3, 0.4],
                    "payload": {"category": "A", "value": 10}
                  },
                  {
                    "id": 2,
                    "vector": [0.5, 0.6, 0.7, 0.8],
                    "payload": {"category": "B", "value": 20}
                  }
                ]
              }'
components:
  schemas:
    ErrorResponse:
      type: object
      description: Error response returned when a request fails.
      properties:
        status:
          type: object
          description: Status object containing the error message.
          properties:
            error:
              type: string
              description: Human-readable error message describing what went wrong.
              example: Collection `my_collection` doesn't exist!
        time:
          type: number
          format: double
          description: Time spent to process this request, in seconds.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Admin JWT or access token for authenticating requests to VectorAI DB.

````

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