> This page is for Unified.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Internal database

> How to sync and index company documents for internal search from file storage platforms using the Merge File Storage API.

---

#### Users authorize file storage access

Your user authorizes your application to access their file storage service (e.g., Google Drive, Dropbox) via an OAuth or similar authorization flow through Merge Link.

#### Fetch files and folders

Utilize [**GET** /Files](https://docs.merge.dev/filestorage/files/#files_list) and [**GET** /Folders](https://docs.merge.dev/filestorage/folders/#folders_list) to fetch all relevant documents and folders from the designated file storage platform associated with the company.

> **Note**
>
> Set up webhooks so that the latest file updates are being reflected.

#### Check user access to files

You may want to make sure other un-linked users can only see the files they have access to.
Use the query parameter `expand=permissions` with [**GET** /Files](https://docs.merge.dev/filestorage/files/#files_list) to see who has access to a file. Additionally, fetch user's email addresses in [**GET** /Users](https://docs.merge.dev/filestorage/users/#users_list) to match your product's users with the 3rd-party platform's users.

#### Database population

Populate the internal database with the fetched documents, ensuring comprehensive indexing and organization for efficient search capabilities.

#### Build search optimization and filters

Enhance your document search feature with optimized algorithms and filters to facilitate quick and accurate document retrieval based on various search parameters, such as file names, content keywords, and metadata. You can even leverage AI to help get answers to your employees with the documents' data.

#### Create a friendly UI search experience

Build the frontend of how you want the search user experience to be.
Employees can now easily find relevant documents and answers in an instant!

#### Build an internal document database with Merge

Integrate today or talk to our sales team to learn how Merge unlocks hundreds of integrations in days - not years.

\


Get a demo **

* [Webhooks](/merge-unified/reading-data/webhooks/merge-webhooks)

\
\
\