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

# Upload

> Upload a file for knowledge extraction

Upload a file to Vrin for automatic text extraction, chunking, and fact extraction. Accepts multipart form data.

<ParamField header="Authorization" type="string" required>
  Bearer token. Example: `Bearer vrin_live_abc123`
</ParamField>

<ParamField body="file" type="file" required>
  The file to upload (multipart form field).
</ParamField>

<ParamField body="save_to_memory" type="string" default="true">
  If `"true"`, persist extracted knowledge to the knowledge base. Sent as a form field.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "upload_id": "upload_abc123",
    "filename": "report.pdf",
    "status": "processing",
    "message": "File uploaded and queued for processing"
  }
  ```
</ResponseExample>

### Check upload status

```
GET /upload/{upload_id}/status
```

<ResponseExample>
  ```json 200 theme={null}
  {
    "upload_id": "upload_abc123",
    "status": "completed",
    "filename": "report.pdf",
    "facts_extracted": 24,
    "chunks_created": 8
  }
  ```
</ResponseExample>

### Upload status values

| Status       | Description                      |
| ------------ | -------------------------------- |
| `processing` | File is being processed          |
| `completed`  | Processing finished successfully |
| `done`       | Alias for completed              |
| `failed`     | Processing failed                |

### Supported file types

| Format   | MIME Type         |
| -------- | ----------------- |
| PDF      | `application/pdf` |
| CSV      | `text/csv`        |
| Text     | `text/plain`      |
| Markdown | `text/markdown`   |

### cURL example

```bash theme={null}
curl -X POST https://api.vrin.cloud/upload \
  -H "Authorization: Bearer vrin_live_abc123" \
  -F "file=@report.pdf" \
  -F "save_to_memory=true"
```

### SDK usage

```python theme={null}
# Upload from file path
result = client.upload_file("report.pdf")

# Upload raw bytes
result = client.upload_bytes(pdf_bytes, "report.pdf")
```
