Document folders
How the document library is organized: nested folders, and folders that fill themselves from a saved filter.
List folders
Returns folders with how many documents each holds and how many folders sit inside it. Pass album_parent=root for the top level and a folder id to walk down, which is how the tree is drawn a level at a time rather than all at once. A smart folder carries the saved filter it resolves in album_query_search.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
query Parameters
album_activealbum_createdalbum_descriptionalbum_idalbum_namealbum_parentalbum_updatedcursor^[A-Za-z0-9_-]+$full_text_searchlimitoffsetsort^-?[a-z0-9_]+$Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
List folders › Responses
Success
Create a folder
Creates a folder, which starts empty — put documents in it with POST /document-folders/{id}/files. Pass album_parent to nest it. A folder that fills itself from a saved filter is created through POST /document-folders/smart instead.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Create a folder › Request Body
album_namealbum_descriptionalbum_cover_filealbum_metadataalbum_aclalbum_activealbum_smartalbum_queryalbum_parentCreate a folder › Responses
Created
Get a folder
Returns the folder with its file and child counts, the path of folders above it, and — for a smart folder — the filter it resolves.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Get a folder › Responses
Success
Delete a folder
Removes the folder. The documents it held stay in the library, and folders inside it move to the top level.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Delete a folder › Responses
Success. No content.
Update a folder
Applies the album_-prefixed fields present in the body. Moving a folder under a new parent is a change to album_parent here; a move that would make a folder its own ancestor is refused. A smart folder's filter is changed through PATCH /document-folders/{id}/smart.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Update a folder › Request Body optional
album_namealbum_descriptionalbum_cover_filealbum_metadataalbum_aclalbum_parentUpdate a folder › Responses
Success
Add documents
Puts documents in the folder. A document may sit in more than one. Ids that match no document in the library are skipped rather than failing the request, so a partly stale selection still lands.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Add documents › Responses
Success
Remove documents
Takes the documents out of the folder and leaves them in the library.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Remove documents › Responses
Success
Update smart filters
Replaces the saved filter a smart folder resolves. Membership is recomputed on read, so the change is visible immediately and no documents are moved.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Update smart filters › Request Body optional
album_namealbum_descriptionquery_searchUpdate smart filters › Responses
Success
List folder membership
Returns which documents sit in which folder, without the document records themselves.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
query Parameters
af_albumaf_filecursor^[A-Za-z0-9_-]+$limitoffsetsort^-?[a-z0-9_]+$Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
List folder membership › Responses
Success
Create a smart folder
A smart folder is a saved filter rather than a fixed list: its contents are whatever currently matches, so documents join and leave it on their own as the library changes.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Create a smart folder › Request Body
album_namequery_searchalbum_descriptionCreate a smart folder › Responses
Created
Get folder statistics
How many folders the workspace has. For counts within one folder, read the folder itself — it carries its own document and child counts.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Get folder statistics › Responses
Success
