Skip to content

List uploaded directories ​

Interface Description ​

Read the direct child directories under an uploaded directory.

Endpoint ​

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

Parameters ​

NameLocationRequiredTypeExampleDescription
knowledgeBaseIdpathYesstringknowledge-base-11111111-1111-4111-8111-111111111111Knowledge-base identifier returned by knowledge-base APIs.
parentDirectoryIdqueryNostringdirectory-handbookParent uploaded-directory ID. Omit it or use root to list top-level directories.
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.

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-directories?parentDirectoryId=directory-handbook&limit=50" \
  -H "Authorization: Bearer <openapi-key>"

Successful Responses ​

200 ​

Requested page of direct child directories from the uploaded folder structure.

FieldRequiredTypeDescription
itemsYesarray<SourceDirectory>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": [
    {
      "directoryId": "directory-11111111-1111-4111-8111-111111111111",
      "knowledgeBaseId": "knowledge-base-11111111-1111-4111-8111-111111111111",
      "parentDirectoryId": "directory-handbook",
      "name": "onboarding",
      "relativePath": "handbook/onboarding",
      "generatedPath": "pages/handbook/onboarding",
      "depth": 2,
      "resourceRevision": 1,
      "directFileCount": 1,
      "descendantFileCount": 1,
      "mutable": true,
      "deletable": true,
      "deleting": false,
      "actions": {
        "self": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/source-directories/directory-11111111-1111-4111-8111-111111111111",
        "children": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/source-directories?parentDirectoryId=directory-11111111-1111-4111-8111-111111111111",
        "sourceFiles": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/source-files?directoryId=directory-11111111-1111-4111-8111-111111111111",
        "generatedTree": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/tree?parentPath=pages%2Fhandbook%2Fonboarding"
      },
      "createdAt": "2026-06-17T00:00:00.000Z",
      "updatedAt": "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 ​