Announcing our $20m Series A from GV (Google Ventures) and Workday Ventures
Read More
3
Contributors
Guillaume Lebedel
Engineering
João Miguel
Engineering
Morgan Williams
Design
August 2025

Unified Document API for Knowledge Bases and Storage

Working with documents from Notion, Google Drive, and SharePoint can be a chaotic experience. Differences in the API responses, auth flow, and edge cases - and none of them play nicely together. That's why we built the StackOne Unified API for Documents.

It provides a consistent way to fetch, upload, and manage content across knowledge bases and file storage systems, eliminating the usual integration headaches. It's secure, fast, and built to scale with you.

What’s new

  • Documents API - endpoints for files, folders, and drives.
  • @stackone/file-picker - a drop‑in React component to browse & select files/folders from connected providers.
  • File Picker for all the connectors
    • Use of native file picking experience of Google Drive, Sharepoint and OneDrive
    • StackOne-generated File Picker with 1st class UX for all other connectors that do not provide their own picker (Notion & Confluence)
  • Provider-agnostic - query files across providers with a single approach.
  • Consistent pagination & filtering - the unified API allows paginating on requests with multiple records.
  • Auth Managed via StackOne - end-user can authenticate through StackOne’s hub so you don’t need to handle all the different auth flows of each provider, we do it for you.

StackOne File Picker

The @stackone/file-picker SDK allows you to embed the picker.

Install

# NPM
npm install --save @stackone/file-picker
# Yarn
yarn add @stackone/file-picker

Usage

Initialize the picker, then call open() method. Handle the callbacks to know when files are selected or the flow is cancelled:

import { FilePicker } from '@stackone/file-picker';

export const FilePickerButton = () => {
  const [filePicker, setFilePicker] = useState<FilePicker | null> (null);

  useEffect(() => {
    const initializePicker = async () => {
      const { sessionToken } = await retrieveAPISessionToken();

      setFilePicker(new FilePicker({ sessionToken }));
    };

    initializePicker();
  }, []);

  const handleClick = useCallback(() => {
    filePicker?.open();
  }, [filePicker]);

  return (
    <button onClick={handleClick} disabled={!filePicker}>
      Open File Picker
    </button>
  );
};

To find more details about the File Picker component, navigate to the StackOne documentation.

Component API

The File Picker accepts multiple options for customization:

const options = {
    sessionToken = 'your-session-token',
    containerId = 'file-picker-container',
    baseUrl = '<https://app.stackone.com>',
    fields = ['name', 'path', 'driveId'],
    showBranding = false,
    folderSelectionEnabled = true,
    onFilesPicked = (files) => {
        console.log('Selected files:', files);
    },
    onOpen = () => {
            console.log('File picker opened');
        },
    onClose = () => {
        console.log('File picker closed');
    },
    onCancel = () => {
        console.log('File selection canceled');
    }
};

Unified Endpoints

The Unified Documents API ships with a clean, consistent set of endpoints - list, upload, and download - so you can work with files, folders, and drives across Notion, Confluence, Google Drive, and SharePoint without adapting for each provider’s quirks. For the complete list of endpoints, parameters, and other technical details, navigate to the API reference documentation.

Files

GET: /unified/documents/files - list
POST: /unified/documents/files/upload - upload

Folders

GET: /unified/documents/folders - list
GET: /unified/documents/folders/{id} - details

Drives

GET: /unified/documents/drives - list
GET: /unified/documents/drives/{id} - details

Questions or migration help? Reach out - we are happy to pair with your team on the rollout!

Join StackOne

Start saying yes to your customers

All the tools you need to build real-time integrations, at scale, with best-in-class security & privacy.
Get Started Now
Credits
|