# Add Collection File

`POST https://api.vultrinference.com/v1/vector_store/{id}/files`

Adds a file to a vector store collection.

## Path parameters

- `id` (string, required): The ID of the vector store collection.

## Body (multipart/form-data)

- `file` (string (binary), required): The file object to be uploaded to the vector store collection.

## Responses

- `201`: OK (add-vector-store-file-response-payload)
- `400`: Bad Request, including a request that failed validation (the message names the rejected field) and a collection, item or file that does not exist. The body is the error envelope. (error-payload)
- `401`: The API key is missing, unknown or not active. Send it as Authorization: Bearer <key>. (error-payload)
- `413`: The upload is over 100 MB (error-payload)

## Example

```bash
curl https://api.vultrinference.com/v1/vector_store/{id}/files \
  -H "Authorization: Bearer $VULTR_INFERENCE_API_KEY" \
  -F "file=@file.pdf"
```

```python
import os
import requests

response = requests.post(
    "https://api.vultrinference.com/v1/vector_store/{id}/files",
    headers={"Authorization": f"Bearer {os.environ['VULTR_INFERENCE_API_KEY']}"},
    files={"file": open("file.pdf", "rb")},
)
print(response.json())
```

```javascript
import { openAsBlob } from "node:fs";

const form = new FormData();
form.append("file", await openAsBlob("file.pdf"), "file.pdf");

const response = await fetch("https://api.vultrinference.com/v1/vector_store/{id}/files", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VULTR_INFERENCE_API_KEY}`,
  },
  body: form,
});
console.log(await response.json());
```
