Synchronize Files and Folders

What you’ll build

A one-way sync from e.g. SharePoint / file shares into remberg:

  1. Create the folder structure in remberg.
  2. Upload files into the right folders.
  3. (Optional) Assign folders or files to assets.
  4. Detect changes and avoid duplicates using resolve + listing.

remberg stores items in a simple tree: folders can contain folders and files. Both are “file items” and share IDs you’ll use for nesting. You can also use the foldername and path as a unique identifier.

Related Endpoints

Files Get Files Create Resolve File

Step 1: Create folders (and subfolders)

Use POST /v1/files/folder to create folderss

Key fields:

  • name – folder name
  • parentIdoptional, to nest the folder inside another folder
  • isPublic – keep false (default)
  • assetTypes, assetNumbers – optional asset assignment on folder level

Example structure to mirror SharePoint:

Root (already exists / or a top-level folder you create)
 ├─ Maschinenhandbuch
 │   ├─ Elektrik
 │   └─ Mechanik
 └─ Prüfprotokolle
     └─ 2025

Flow:

  1. Create Maschinenhandbuch → get its id.
  2. Create Elektrik with parentId = id(Maschinenhandbuch).
  3. Create Mechanik with parentId = id(Maschinenhandbuch).
  4. Create Prüfprotokolle → get its id.
  5. Create 2025 with parentId = id(Prüfprotokolle).

Best practices for folder names (sync-friendly):

  • Keep names stable over time; treat them as part of your integration “key”.
  • Avoid special characters you can’t reliably round-trip across systems (/ \ : * ? " < > |).
  • Prefer short, meaningful categories over deep nesting (many Mittelstand trees get very deep).
  • If your source system has IDs (SharePoint library IDs etc.), store them on your side as metadata mapped to remberg folder IDs.
  • The full path to a file or folder can later be retrieved as an key as well.

Step 2: Upload files into a folder

Use POST /v1/files for file uploads.

This endpoint supports multipart/form-data uploads (perfect for PDFs). Provide:

  • the binary file(s)
  • parentId to place the file inside a folder
  • isPublic should remain false (default)

Typical sync pattern:

  1. For each source file, decide the target folder.
  2. Upload with parentId = id(targetFolder).
  3. Store returned remberg file id alongside your source file identifier.

Note: you can upload multiple files per request, but keep an eye on practical payload sizes and your own retry logic. We recommend to use remberg for files up to 100MB each.

The API is rate-limited to 5 requests per second.


Step 3 (optional): Assign to an asset

Assignment is not required for syncing, but useful to make documents show up on an asset e.g. as a manual.

Options:

  • Assign folder when creating it using assetTypes or assetNumbers. Everything you upload into that folder inherits the context in the UI. The assetNumber can be your internal reference for this asset or equipment.
  • Assign individual files similarly during upload (same fields exist on file creation).

Keep it optional in your integration: if you don’t have a reliable asset mapping yet, sync first, enrich later.


Step 4: Detect changes & avoid duplicates

To “synchronize” rather than blindly upload, you need a way to resolve whether a file already exists in remberg.

This can be done by periodically checking changed files. A webhook will be available later.

You have two tools:

4a) List what’s already there

GET /v1/files lets you list items, optionally scoped to a folder.

  • Use folderId to fetch contents of a known folder.
  • Use isFolder=true when you only want folders.
  • Use updatedAtFromto fetch changes since your last sync.

This is handy for:

  • initial folder ID discovery
  • periodic reconciliation runs

4b) Resolve existing files

GET /v1/files/resolve is intended to help match external file references to remberg items.

Recommended pattern:

  1. Before upload, call resolve with your external reference (e.g., SharePoint file ID or path).
  2. If resolve returns a remberg id, skip upload or update content based on timestamps.
  3. If no match: upload new.

If your sync supports updates, use:

  • PATCH /v1/files/{id}/content to replace the binary of an existing file.

Summary

  1. Create top-level folders with POST /v1/files/folder.
  2. Create nested folders by passing parentId.
  3. Resolve or list to find/confirm targets.
  4. Upload PDFs with POST /v1/files + parentId.
  5. Optional:Store mappings (sourceID ↔ rembergID) to make the next sync deterministic.
  6. On later runs: resolve → update/skip → upload if missing.