> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-fix-issues-on-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Upsert Data

> This endpoint upserts (adds) the raw text data to given index after embedding it. You can also add metadata with the vector.

## Request

You can either upsert a single data, or multiple data in an array.

<ParamField body="id" type="string" required>
  The ID of the vector
</ParamField>

<ParamField body="data" type="string" required>
  The raw text data to embed and upsert.
</ParamField>

<ParamField body="metadata" type="Object">
  The metadata of the vector. This is used to make it easier to identify the
  vector on queries.
</ParamField>

## Response

<ResponseField name="Response" type="Object">
  Returns `"Success"` on successful upsert operation.
</ResponseField>

<RequestExample>
  ```sh curl
  curl https://better-dodo-20522-us1-vector.upstash.io/upsert-data \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -d '{"id": "id10",
    "data": "Upstash is a serverless data platform.",
    "metadata": { "key": "value" } }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK
  {
    "result" : "Success"
  }
  ```
</ResponseExample>
