---
title: "Update or insert a vector into a collection"
method: PUT
path: "/vectors/upsert"
tags: ["Vectors"]
---

# Update or insert a vector into a collection

`PUT /vectors/upsert`

## Request

- Base URL: `https://apipie.ai`
- URL: `https://apipie.ai/vectors/upsert`
- Auth: API key in header `Authorization`

Upserts a vector into the specified collection with metadata and data.

## Request body

- UpdateCollectionRequest
  - `collection_name` string
  - `vector_id` string
  - `metatag` string
  - `data` string
  - `embedding` number[]

## Response `200`

Vector upserted successfully

## Other responses

- `400`: Bad request
- `404`: Collection not found
- `500`: Internal server error

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
