Skip to main content

Files and extractions

With the Knowledge Hub permission, an app can work with the folders and files of the person using it, and with the data that Smart Extract obtains from each document.

For the concepts of folder, file and extraction, see Knowledge HubUser guide.

Folders​

QueryPath
Own foldersGET /knowledge-hub/directories/own
Shared foldersGET /knowledge-hub/directories/shared
SubfoldersThe same paths with ?parentId={folder}

When the app is opened from a folder, it receives folderId and does not need to ask. In other cases, offer a folder picker.

Extractions​

The data extracted from the documents in a folder is read page by page:

GET /knowledge-hub-api/documents/{folderId}/extractions?page=1&limit=100

The maximum is 100 per page. Each extraction includes the document's data and the result, with the shape defined in the folder's data schema.

Get a file​

The API never returns a file's content: it returns a temporary link.

GET /knowledge-hub/documents/{folderId}/files/{fileId}
{
"url": "https://…",
"expiresAt": "2026-10-21T20:19:34.391Z",
"fileName": "report.pdf",
"mimeType": "application/pdf",
"size": 71146758
}

Rules:

  • The link expires after 5 minutes. Request it right before using it and do not store it.
  • The link is opened without headers: the storage rejects requests that carry Authorization.
  • Do not assume a specific domain: each organization can have its own storage.
ToHow
Give the file to the userNavigate to the link from the user's click; the browser downloads it
Show an imageUse the link directly as the image source
Read the content (PDF viewer, analysis)Download it with a request without headers

Upload files​

POST /knowledge-hub/documents/{folderId}/files
Content-Type: multipart/form-data (field: files)
LimitValue
Size per file150 MB
Files per request6

Check both limits before sending, so you can warn the user up front. The platform may rename a file to avoid duplicates: the valid name is the one in the response.

After creating, modifying or deleting files, the app notifies the platform so it refreshes its lists. See Communicating with the platform.

Best practices​

Expired link

If the storage responds 403, the link has expired. Request a new one and retry once, without showing an error.

Remember the chosen folder

If the app remembers the last folder, it must check that it is still among the user's folders before using it.