Document Management SDK: Add Document Management to Your App with REST APIs and MCP

Document Management SDK Playground with API list, Drive view, and audit log, plus version, permission, locking, and search features

TL;DR

  • Thinkfree Document Management SDK is a REST-based document management API that covers files and folders, sharing and permissions, user and tenant management, and audit logs.
  • You can deploy it on your own infrastructure in on-premises, private cloud, or air-gapped environments, and try the API in the Playground before you install.
  • Users work in the Drive UI, applications call the REST APIs, and AI agents connect through the built-in MCP server. All three work on the same documents.

What Is Document Management SDK

Products that handle documents typically start by storing files in object storage. However, storage only holds files. It does not provide document management. Thinkfree Document Management SDK provides a document management layer through REST APIs, covering permissions, version management, sharing, and auditing.

Why This Matters

As a service grows, it needs more than file storage. You need permissions that control who can access each document and version history for restoring earlier versions. You also need file sharing, user and tenant management, metadata, and audit logs that record who did what. Building these capabilities in-house can require significant development resources.

With Document Management SDK, you can access these capabilities through a document management API instead of building them from scratch. Thinkfree Drive provides these APIs. By deploying Drive on top of your existing storage, you can manage document state and permissions without replacing your storage.

One Layer for Users, Code, and AI Agents

Document Management SDK lets people, application code, and AI agents manage documents through three paths. You do not need to build separate permission logic for your UI, backend automation, and AI integrations.

The more ways documents are accessed and modified, the more important consistency becomes. Document Management SDK applies the same permission, locking, and version management rules no matter who modifies a document or how.

Access Path
How it is used
Examples
Thinkfree Drive web UI
Users and admins manage documents through the Drive interface
Common drive operations (upload, sharing, version restore, and tenant settings)
REST API
The application backend calls the API, allowing end users to manage documents without leaving your product
Document management automation with code
MCP server
AI agents call tools with the permissions of the connected account
Searching documents, reading content, uploading files, and restoring previous versions

REST API Integration

Your product backend manages files, folders, sharing, and versions directly through the document management API. End users can manage documents within your product UI while Drive handles permissions and version management in the background.

MCP Server

Drive includes a built-in MCP server. When an MCP client such as the Claude app or Claude Code connects to it using OAuth 2.0 or an API Key, AI agents can invoke Drive features as tools.

As of November 2026, 50 tools are available:

  • 27 for user accounts (files, folders, sharing, version management, and more)
  • 23 for admin accounts (user accounts, API Key management, and more)
Thinkfree Drive settings with API Keys for Claude MCP next to Claude desktop's Developer settings showing Thinkfree Drive running as a local MCP server
Thinkfree Drive API Keys and Claude desktop running Thinkfree Drive as an MCP server

Same Permission Checks

Requests made through MCP go through the same permission checks as REST API requests. An agent connected through a user account can access only the documents available to that user. Agent tool calls are also recorded in the same audit logs and user logs as operations performed through the Drive UI or REST APIs.

Editor Handoff

Search and list tools return a preview link for each result. If the file format is supported by the web office editor and the calling account has editing permissions, the response also includes an edit link. Users can then open and review the documents an agent finds.

Key Features

Area
Capabilities
Files
Upload, download, preview, rename, move, copy, delete, and create new Office documents
Folders
Create and organize folder structures, view folder contents, and pin frequently used folders
Sharing
Share files with specific users, all users in a tenant, or through public links, with permissions managed for each sharing method
Versions, Locking
View and restore version history, lock and unlock resources
Users
Individual user drives, recent and starred items, trash, notifications, and personal settings
Administration
Tenant accounts, storage quotas, licenses, sign-in methods, branding, sharing policies, and SMTP settings
Audit logs
View tenant audit logs page by page or export a date range as CSV

Every request is authenticated using an API Key passed as a Bearer token. Responses follow a common format containing result, code, message, and data. Error responses also include errorCode. Use errorCode rather than message to handle errors, as the message text may vary depending on the language setting.

Document Management SDK also includes an MCP server. Tool calls made through MCP are subject to the same permission checks as REST API requests and are recorded in the same audit logs.

Try First, Then Install

Document Management SDK Playground with the Admin API audit log export endpoint open and the Drive Audit Log view filtered by user, event, channel, result, and period
Export audit logs as CSV from the Admin API tab and view them in Drive with channel filters

Test the API in your browser with the Playground before installing anything, then install a self-hosted Drive for development and production.

Playground (Cloud Drive)
Self-hosted
Purpose
Try the API without installing anything
Development and production
Getting started
Sign up for a Thinkfree Developers account (10 GB of storage included)
Install the image (Trial and Free Commercial licenses available)
Authentication
Developers API Key
API Key issued in Drive
Where documents are stored
Storage managed by Thinkfree
Customer's infrastructure (built-in storage, AWS S3, or S3-compatible storage)
Available features
Files, folders, versions, locking, and audit logs for evaluation (Some APIs are limited and MCP is not supported)
All REST APIs, the MCP server, and tenant and sharing policy management
Best for
Checking how the API works before adopting it
Running document management inside your product

Self-hosted Drive is available under the Free Commercial license, which allows commercial use at no cost. The license covers up to 20 MAC (Managed Account Count) and is valid for 180 days, with the option to extend it. Periodic online license verification is required. Only license status and usage statistics are transmitted during verification. Document content is never transmitted. See the pricing page for paid plans.

Using It with Document Editor SDK

Document Management SDK handles document storage and management. To open documents and control the editing interface within your product, add Document Editor SDK.

Integrating Document Editor SDK with Document Management SDK lets you open and edit Word, Spreadsheet, and Presentation files stored in Drive. Each time a document is saved, a new version is added to Drive.

Tutorial

Make API Calls with SDK Playground

You can try the document management API in the Playground without installing anything. Cloud Drive comes with your account as trial storage. MCP integration is available on a self-hosted Drive.

Prepare an API Key

Sign up for the Developer Console, and your Cloud Drive storage will be provisioned automatically. Generate an API Key in the Console.

Connect the Playground

Open the Management SDK Playground, enter your API Key, and click Connect. You can select either User API or Admin API. Once connected, the Drive UI appears on the right side of the screen.

Send a Request

Pick an API from the Try these first list and send a request. List your files, create a folder, or upload a file, and the result appears right away in Drive on the same screen.

In the Playground, APIs marked Limited are restricted or return some response values hidden. All of these APIs are available on a self-hosted Drive.

Upload Files and Restore Versions on a Self-hosted Drive

Run Drive and Office in a single container on a computer with Docker installed. To test with a Trial license, follow these steps.

Run the Container

				
					docker pull thinkfree/drive-single-node-trial:latest

docker run -d \
  --name thinkfree-drive-trial \
  -p 8080:8070 \
  -p 18080:18080 \
  thinkfree/drive-single-node-trial:latest

				
			

Once the container starts, Drive and Office take about two minutes to initialize. Then, open http://{HOST_IP}:18080/ in your browser to access Drive. Port 8080 is used by Office, which is already connected to Drive, so no additional configuration is required. Replace {HOST_IP} with the IP address of the computer running Docker.

Sign in

The Trial image includes super admin, tenant admin, and user accounts, each with its own API Key. Refer to the Set up Thinkfree Drive guide for the account details. These accounts and API Keys are for testing only. Replace them before using Drive in a production environment.

List Files

The API URL is your Drive address followed by the tenant ID and the API path. One Drive can host multiple tenants, so each request includes the tenant ID in its URL. In the Trial environment, the Drive address is http://{HOST_IP}:18080.

				
					curl -X GET "http://{HOST_IP}:18080/t/{tenant_id}/api/public/v1/resources?st=MY&ps=10" \
  -H "Authorization: Bearer {USER_API_KEY}"

				
			

Upload a File

Send the local file report.docx in the file field.

				
					curl -X POST "http://{HOST_IP}:18080/t/{tenant_id}/api/public/v1/files" \
  -H "Authorization: Bearer {USER_API_KEY}" \
  -F "file=@report.docx"

				
			

To upload into a specific folder, pass that folder’s ID as pfs (parent folder ID). If omitted, the file is uploaded to the root of your Drive. A successful upload returns a response like the following.

				
					{
  "result": true,
  "code": 201,
  "message": "Created",
  "data": { "resourceSeq": 283, "resourceName": "report.docx" }
}
				
			

resourceSeq is the unique ID assigned to the file by Drive. Use this ID to reference the file in subsequent steps. Open Drive in your browser to verify that the file has been uploaded.

Upload a New Version

To upload a new version of an existing file, set the save type (st) to version and specify the resourceSeq returned in the previous step as the target file ID (rs). If you upload a file with the same name without specifying these parameters, Drive uploads it as a separate file with a number appended to its name.

				
					curl -X POST "http://{HOST_IP}:18080/t/{tenant_id}/api/public/v1/files" \
  -H "Authorization: Bearer {USER_API_KEY}" \
  -F "file=@report.docx" \
  -F "st=version" \
  -F "rs=283"

				
			

List and Restore Version

The following request retrieves the file’s version history. Each entry includes the version number, file size, upload date, and the account that created the version. The current version is marked as CURRENT, while previous versions are marked as HISTORY.

				
					curl -X GET "http://{HOST_IP}:18080/t/{tenant_id}/api/public/v1/resources/283/versions?pi=1&ps=10" \
  -H "Authorization: Bearer {USER_API_KEY}"

				
			

You can also make any version in the list the current version. Replace {resourceVersionSeq} with the ID of the version you want to restore from the list response.

				
					curl -X POST "http://{HOST_IP}:18080/t/{tenant_id}/api/public/v1/resources/283/versions/{resourceVersionSeq}/restore" \
  -H "Authorization: Bearer {USER_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"ss": null}'

				
			

Requests that modify documents, such as file uploads and version restores, require an API Key with write permission (api:write). In production, keep API Keys on the server and out of browser code, URLs, and logs.

Check the Tool List with MCP

Send a request to the MCP server using the same API Key to retrieve the list of tools an agent can use.

				
					curl -X POST "http://{HOST_IP}:18080/t/{tenant_id}/mcp" \
  -H "Authorization: Bearer {USER_API_KEY}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'

				
			

Add the same endpoint as an MCP server in Claude Code or another MCP client to search and read Drive documents through conversation. OAuth-based connections require HTTPS access to Drive.

Next Steps

Try the document management API in the Playground, or install a self-hosted Drive to run it on your own infrastructure.

FAQ

Do I need to replace my existing storage?

No. With a self-hosted deployment, you can continue using your existing storage. Thinkfree Document Management SDK supports AWS S3 and S3-compatible storage, adding a document management layer for permissions, version management, locking, and auditing on top of your storage infrastructure.

Yes, both deployment options use the same Drive APIs. In the Playground, some APIs are limited or return some values hidden, and MCP is not supported. All of them are fully available on a self-hosted Drive.

Yes. A single self-hosted Drive installation can support multiple tenants. You can assign a separate tenant to each customer, allowing each tenant administrator to manage their own accounts and settings.

The super admin manages all tenants through the Superadmin Portal and can apply sharing and sign-in policies to all tenants at once or configure them separately for each tenant.

Tenant administrators can customize the browser title, service name, logos, and favicon. Branding can be configured separately for each tenant. Contact us for details about enterprise and OEM licensing options.

Supported authentication methods include Local Login, JWT Auto Authentication, and OIDC Login. Each tenant can also require two-factor authentication for regular users and restrict access based on country or IP address.

With a self-hosted deployment, documents stay within your infrastructure. The Free Commercial license requires periodic online verification, but it sends only license status and usage statistics. Document content is never transmitted.

Documents you upload while trying the Playground are stored in Cloud Drive, which Thinkfree operates. Thinkfree processes them only as needed to provide and maintain the service and does not make them visible to other users. Because the Playground is a trial environment, we recommend not uploading documents that contain sensitive information.

The MCP server operates with the permissions of the connected account. An agent connected through a user account can access only the documents available to that user. Administrator tools can be invoked only through an administrator account. Tools that modify documents run only on connections with write scope (mcp:write). Tool calls are recorded in the same audit logs as work done in the Drive UI or through the REST API.

Audit logs record logins, file access, sharing activities, permission changes, and administrative operations. You can retrieve audit logs through the API with pagination or export records for a specified period as CSV for external review. Each CSV export can cover up to 92 days. You can also filter audit logs by channel (Web, API, or MCP) to view only the operations performed by an agent through MCP.

Audit logs may contain personal data such as usernames, email addresses, and IP addresses. Set your own retention and disposal policies for this data.

Subscribe to the Thinkfree Newsletter

Stay current on Thinkfree product news and the trends shaping enterprise IT. No noise, just the updates that matter.

By submitting, you agree to our Privacy Policy to receive updates and news from Thinkfree Inc.

Like this post? Share with others!