Skip to main content
POST
/
vectors
/
{index_id}
/
upsert
Upsert Vectors
curl --request POST \
  --url https://api.gravixlayer.com/v1/vectors/{index_id}/upsert \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "vectors": [
    {
      "id": "vec-001",
      "embedding": [
        0.1,
        0.2,
        0.3,
        0.4,
        0.5
      ],
      "metadata": {
        "category": "electronics"
      }
    },
    {
      "id": "vec-002",
      "embedding": [
        0.2,
        0.3,
        0.4,
        0.5,
        0.6
      ],
      "metadata": {
        "category": "books"
      }
    },
    {
      "embedding": [
        0.3,
        0.4,
        0.5,
        0.6,
        0.7
      ],
      "metadata": {
        "category": "clothing"
      },
      "delete_protection": true
    }
  ]
}'
{
  "ids": [
    "vec-001",
    "vec-002",
    "auto-generated-uuid-123"
  ],
  "count": 3
}

Authorizations

Authorization
string
header
required

API key authentication. Get your API key from the Gravix Layer Dashboard.

Path Parameters

index_id
string
required

The ID of the index to upsert vectors into

Body

application/json
vectors
object[]
required
Required array length: 1 - 1000 elements

Response

Vectors upserted successfully

ids
string[]
count
integer
I