List uploaded directories
Interface Description
Read the direct child directories under an uploaded directory.
Endpoint
| Field | Value |
|---|---|
| Method | GET |
| Path | /openapi/v2/knowledge-bases/{knowledgeBaseId}/source-directories |
| Operation ID | listSourceDirectories |
| 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. |
parentDirectoryId | query | No | string | directory-handbook | Parent uploaded-directory ID. Omit it or use root to list top-level directories. |
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. |
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.
| Field | Required | Type | Description |
|---|---|---|---|
items | Yes | array<SourceDirectory> | 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": [
{
"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 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. |