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

# Bulk upsert data

Besides the upsert operation which has 6MB maximum payload size limit,
AIMP also supports bulk upsert operation to insert or update multiple documents up to 200MB at once.

First, get the required information to upload payload to object storage:

```bash theme={null}
AIMP_PROJECT_API_KEY="YOUR_API_KEY"

curl -i -X GET \
  "https://{baseUrl}/{apiVersion}/projects/{project_id}/indexes/{index_name}/docs/bulk-upsert" \
  -H 'content-type: application/json' \
  -H 'x-api-key: $AIMP_PROJECT_API_KEY'
```

The response will look like this:

```json theme={null}
{
  "url": "<string>",
  "type": "application/json",
  "httpMethod": "PUT",
  "objectKey": "<string>",
  "sizeLimitBytes": 209715200
}
```

Upload your documents as a one object using the provided URL
and call `bulk-upsert` API with the corresponding `objectKey` you've just uploaded:

```bash theme={null}
AIMP_PROJECT_API_KEY="YOUR_API_KEY"

curl -i -X POST \
  "https://{baseUrl}/{apiVersion}/projects/{project_id}/indexes/{index_name}/docs/bulk-upsert" \
  -H 'content-type: application/json' \
  -H 'x-api-key: $AIMP_PROJECT_API_KEY' \
  -d '{
    "objectKey": "<string>"
  }'
```
