List uploaded files
Interface Description
Read a paginated list of uploaded Markdown files and their processing status.
Endpoint
| Field | Value |
|---|---|
| Method | GET |
| Path | /openapi/v2/knowledge-bases/{knowledgeBaseId}/source-files |
| Operation ID | listKnowledgeBaseSourceFiles |
| 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. |
limit | query | No | integer | 50 | Maximum number of records to return. The deployment can enforce a lower limit. |
cursor | query | No | string | cursor_123 | Pagination token returned by the same endpoint for reading the next page. |
directoryId | query | No | string | directory-handbook | Parent uploaded-directory identifier. Use root for files at the knowledge-base root. |
pathQuery | query | No | string | handbook/guide | Case-insensitive partial match against uploaded file paths. |
sourceFileIdPrefix | query | No | string | source-file-11111111 | Uploaded-file ID prefix used to filter results. |
state | query | No | waiting | processing | available | error | deleting | available | Filter by the uploaded file's current processing status. |
blockingWorkKind | query | No | prepare | first_layer | content_projection | graphrag | relation_reconcile | knowledge_projection | activate | cleanup | activate | Filter by the processing step currently preventing the document from becoming available. |
generatedOutputStatus | query | No | unavailable | previous_available | current_available | current_available | Filter by generated-content availability. |
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?limit=50&directoryId=directory-handbook" \
-H "Authorization: Bearer <openapi-key>"Successful Responses
200
Requested page of uploaded Markdown files and the token for reading the next page.
| Field | Required | Type | Description |
|---|---|---|---|
items | Yes | array<SourceResourceFile> | Records returned on this page. |
nextCursor | Yes | string | null | Pagination token returned by this endpoint. Reuse it only with the same endpoint and unchanged filters. If it is rejected, restart without a cursor. |
Success Response Example
json
{
"items": [
{
"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"
}
],
"nextCursor": null
}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. |
| 422 | VALIDATION_ERROR | The request failed validation. |
| 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. |