Get uploaded file
Interface Description
Read the processing status and available actions for one uploaded Markdown file by sourceFileId.
Endpoint
| Field | Value |
|---|---|
| Method | GET |
| Path | /openapi/v2/knowledge-bases/{knowledgeBaseId}/source-files/{sourceFileId} |
| Operation ID | getKnowledgeBaseSourceFile |
| Authentication | Bearer OpenAPI key |
Parameters
| Name | Location | Required | Type | Example | Description |
|---|---|---|---|---|---|
knowledgeBaseId | path | Yes | string | knowledge-base-11111111-1111-4111-8111-111111111111 | Knowledge-base identifier returned by knowledge-base APIs. |
sourceFileId | path | Yes | string | source-file-11111111-1111-4111-8111-111111111111 | Uploaded-file identifier returned by upload or uploaded-file list APIs. |
Request Body
This operation has no request body.
Request Example
bash
curl -X GET "https://openapi.example.com/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/source-files/source-file-11111111-1111-4111-8111-111111111111" \
-H "Authorization: Bearer <openapi-key>"Successful Responses
200
Requested uploaded Markdown file and its current processing status.
| Field | Required | Type | Description |
|---|---|---|---|
sourceFile | Yes | object | Uploaded Markdown file returned by the request. |
Success Response Example
json
{
"sourceFile": {
"sourceFileId": "source-file-11111111-1111-4111-8111-111111111111",
"knowledgeBaseId": "knowledge-base-11111111-1111-4111-8111-111111111111",
"directoryId": "directory-11111111-1111-4111-8111-111111111111",
"name": "guide.md",
"relativePath": "handbook/guide.md",
"generatedPath": "pages/handbook/guide.md",
"contentType": "text/markdown; charset=utf-8",
"sizeBytes": 1024,
"resourceRevision": 1,
"contentRevision": 1,
"state": "available",
"workProgress": {
"required": 8,
"completed": 8,
"activeKinds": [],
"blockingKind": null,
"retryingKind": null
},
"failure": null,
"generatedOutputStatus": "current_available",
"actions": [
{
"kind": "open_generated_file",
"method": "GET",
"href": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/content?path=pages%2Fhandbook%2Fguide.md",
"scope": "source_file"
}
],
"links": {
"self": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/source-files/source-file-11111111-1111-4111-8111-111111111111",
"generatedContent": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/content?path=pages%2Fhandbook%2Fguide.md",
"search": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/search?query=guide.md"
},
"createdAt": "2026-06-17T00:00:00.000Z"
}
}Error Codes
The table below lists every error response documented for this operation.
| HTTP Status | Error Code | Explanation |
|---|---|---|
| 401 | UNAUTHORIZED | The Bearer API key is missing, malformed, unknown, revoked, or deleted. |
| 404 | NOT_FOUND | The requested resource was not found. |
| 429 | RATE_LIMITED | The request exceeded the configured rate limits. |
| 500 | INTERNAL_ERROR | The API encountered an internal error. |
| 503 | DATABASE_REPOSITORY_UNAVAILABLE | The data required by this operation is temporarily unavailable. |