Skip to content

List uploaded files ​

Interface Description ​

Read a paginated list of uploaded Markdown files and their processing status.

Endpoint ​

FieldValue
MethodGET
Path/openapi/v2/knowledge-bases/{knowledgeBaseId}/source-files
Operation IDlistKnowledgeBaseSourceFiles
AuthenticationBearer OpenAPI key

Parameters ​

NameLocationRequiredTypeExampleDescription
knowledgeBaseIdpathYesstringknowledge-base-11111111-1111-4111-8111-111111111111Knowledge-base identifier returned by knowledge-base APIs.
limitqueryNointeger50Maximum number of records to return. The deployment can enforce a lower limit.
cursorqueryNostringcursor_123Pagination token returned by the same endpoint for reading the next page.
directoryIdqueryNostringdirectory-handbookParent uploaded-directory identifier. Use root for files at the knowledge-base root.
pathQueryqueryNostringhandbook/guideCase-insensitive partial match against uploaded file paths.
sourceFileIdPrefixqueryNostringsource-file-11111111Uploaded-file ID prefix used to filter results.
statequeryNowaiting | processing | available | error | deletingavailableFilter by the uploaded file's current processing status.
blockingWorkKindqueryNoprepare | first_layer | content_projection | graphrag | relation_reconcile | knowledge_projection | activate | cleanupactivateFilter by the processing step currently preventing the document from becoming available.
generatedOutputStatusqueryNounavailable | previous_available | current_availablecurrent_availableFilter 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.

FieldRequiredTypeDescription
itemsYesarray<SourceResourceFile>Records returned on this page.
nextCursorYesstring | nullPagination 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 StatusError CodeExplanation
401UNAUTHORIZEDThe Bearer API key is missing, malformed, unknown, revoked, or deleted.
404NOT_FOUNDThe requested resource was not found.
422VALIDATION_ERRORThe request failed validation.
429RATE_LIMITEDThe request exceeded the configured rate limits.
500INTERNAL_ERRORThe API encountered an internal error.
503DATABASE_REPOSITORY_UNAVAILABLEThe data required by this operation is temporarily unavailable.

Next Steps ​