List direct child folders with the REST API
List only the direct child folders beneath one parent, interpret each folder row, and use the separate file-list endpoint when files are also required.
Last reviewed
The folder-children endpoint returns directories only. Use it to lazy-load one tree level; use the file-list endpoint when the caller also needs files.

Endpoint contract
Call GET /api/folders/children?workspace_id=wks_…&parent_id=fld_…. Omitting parent_id requests root folders. The response is {ok:true,folders:[…]} with direct children only and no pagination.
Each row provides id, name, parent_id, file_count, and has_children. Internal hidden-state columns are removed before serialization.
Steps
- Use a Read only or Full access key that permits REST, is not folder-anchored, and belongs to a role with
access_files. - Choose a known parent id from a trusted folder response, or deliberately omit the parameter for workspace root.
- Send the children request with
workspace_idand the optionalparent_id, then require HTTP 200 andok:true. - Confirm every returned row has the requested
parent_id, and usehas_childrento decide whether the interface should offer expansion. - Treat
file_countas folder-row metadata; do not expect file objects or a continuation field in this response. - When files are required, call
GET /api/files?workspace_id=wks_…&folder_id=fld_…and reconcile its separatefolders,files, and pagination data.
Access and privacy behavior
A missing workspace_id returns workspace_id is required. Lack of membership answers Not a member. A parent hidden from this requester returns 404 Folder not found, while a parent outside a human member’s confined subtree returns This folder is outside the folder you're confined to.
For a folder-confined human member, omitting parent_id resolves the listing root to that member’s anchor. This is different from an API-key folder anchor: an ordinary anchored credential is refused on REST and must use WebDAV or S3.
The endpoint does not return descendants recursively. Call it again for a returned id whose has_children value is truthy.
Expected result
The body contains only the visible folders immediately below the chosen parent. File retrieval, file pagination, and deeper expansion occur through their own explicit requests.

Related guides
Was this helpful?
Loading helpfulness results…
Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.
Questions and replies
Ask about the steps in this guide. Questions are reviewed before publication.
Keep account details, credentials and private files out of public questions. Use private support for those.
Loading questions…
Sign in to your Dosya account to ask a question.