# File Upload

> Upload files such as PDFs to be processed and added to the Knowledge Base as articles.

Upload files to be processed and added to the Knowledge Base as articles.

## Upload PDF

**Scope: write_all**

`POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/pdf`

Upload a PDF file. The content is extracted and added as an article.

**Shell**

```shell
curl -X POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/pdf \
  -H 'Authorization: Bearer <API_TOKEN>' \
  -F 'pdf_file=@document.pdf'
```

**Python**

```python
import requests

with open("document.pdf", "rb") as f:
    response = requests.post(
        url="https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/pdf",
        headers={"Authorization": "Bearer <API_TOKEN>"},
        files={"pdf_file": f},
    )
data = response.json()
```

**Response** `200 OK`

```json
{
  "status": "success",
  "message": "File processed successfully.",
  "article": {
    "id": 1234,
    "title": "document.pdf"
  }
}
```

| Field | Description |
|-------|-------------|
| `status` <br/> string | Processing status |
| `message` <br/> string | Human-readable result message |
| `article` <br/> object | The created article |

## Upload File

**Scope: write_all**

`POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/`

Upload a supported file (PDF, DOCX). The content is extracted and added as an article.

**Shell**

```shell
curl -X POST https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/ \
  -H 'Authorization: Bearer <API_TOKEN>' \
  -F 'file=@document.docx'
```

**Python**

```python
import requests

with open("document.docx", "rb") as f:
    response = requests.post(
        url="https://app.quickchat.ai/v1/api/knowledge_base/file_upload_api/",
        headers={"Authorization": "Bearer <API_TOKEN>"},
        files={"file": f},
    )
data = response.json()
```

**Response** `200 OK` — Same schema as [Upload PDF](/api-reference/knowledge-base/file-upload/#upload-pdf).

---
