Fix: add /v1/document/upload_info -> /api/v1/documents/upload back (#16264)

This commit is contained in:
Wang Qi
2026-06-23 17:47:55 +08:00
committed by GitHub
parent aba5d172bd
commit a4f325be24
2 changed files with 29 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ The following v0.24.0 REST API paths are deprecated. They remain available throu
| **POST** `/api/v1/sessions/related_questions` | **POST** `/api/v1/chat/recommandation` |
| **PUT** `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` | **PATCH** `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` |
| **GET** `/v1/system/healthz` | **GET** `/api/v1/system/healthz` |
| **POST** `/v1/document/upload_info` | **POST** `/api/v1/documents/upload` |
| **POST** `/api/v1/file/upload` | **POST** `/api/v1/files` |
| **POST** `/api/v1/file/create` | **POST** `/api/v1/files` |
| **GET** `/api/v1/file/list` | **GET** `/api/v1/files` |
@@ -6928,14 +6929,18 @@ Failure:
- Query:
- `url`: URL to crawl and convert to a runtime attachment (mutually exclusive with `file`).
```bash
##### Request example
Upload a local file:
```bash
curl --request POST \
--url http://{address}/api/v1/documents/upload \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--form 'file=@./test1.pdf'
```
Crawl a URL:
```bash
@@ -6950,7 +6955,7 @@ Upload a local file:
The file to upload. Mutually exclusive with `url`; either `file` or `url` must be provided.
- `url`: (*Query parameter*), `string`, *Optional*
A URL to crawl and store as an attachment. Mutually exclusive with `file`; either `url` or `file` must be provided.
#### Response
Success:
@@ -6960,7 +6965,7 @@ Crawl a URL:
"code": 0,
"data": {
"created_at": 1772451421.7924063,
"created_by": "be951084066611f18f5f00155d2f98f4",
"created_by": "be951084066611f18f5f00155d2f98f4",
"extension": "pdf",
"id": "2143a03d162c11f1b80f00155d334d02",
"mime_type": "application/pdf",