Drive Folders

Start an asynchronous Drive inventory export

Changed on

Always enqueues a background job and returns a job_id, including when a cached inventory is available. Requires Drive to be enabled, the drive_folders_read OAuth scope (when using OAuth), and a firm administrator with unrestricted firm-wide Drive download access. Owners qualify; legacy administrators with download, client-group, consent, or own-project restrictions do not.

How to build a local backup or mirror

  1. Call this endpoint. Poll GET /drive/inventory_async_export/{job_id} every 5–15 seconds until completed, failed, or expired.
  2. Download the completed result's download_url and decompress the gzip JSON. Successfully decompress and parse the complete manifest before applying deletions. If this firm’s completed_at is already successfully processed, no work is needed.
  3. Compare files by attachment_id and folders by id. Build paths from each folder's parent_id and name; a null parent identifies a root. Names and paths are mutable and are not identifiers. Track IDs locally and handle duplicate, case-colliding, and filesystem-invalid names without overwriting files.
  4. Request fresh file URLs through POST /drive/download_urls for new or changed files, in batches of at most 500 IDs. Download just those files.
  5. Record failures for retry. Mark the snapshot successfully processed only when required actions finish. Never interpret a failed or partial export as deletions.
DifferenceLocal action
New attachment IDDownload
Changed checksumDownload replacement
Changed blob ID without comparable checksumsDownload replacement
Changed filename or folder IDRename/move
Missing attachment IDDelete only if configured as a mirror
Renamed or moved parent folderUpdate local directory and descendant paths
New empty folderCreate local directory

An accumulating backup retains missing files; a mirror removes them. A recreated attachment has a new identity, even if its content is the same. Checksum values may be null. Treat them as opaque change indicators, not security guarantees.

Caching and scope

The firm shares one completed inventory cached for 24 hours after generation. Reuse does not extend its lifetime. Every request still creates a job. More frequent requests may return the same snapshot and do not guarantee fresher data. The manifest contains folders and files; it contains no file contents or download URLs. This is a consistent read-replica snapshot and can lag recent writes. Scope is active files explicitly attached to Drive folders, including empty folders; it excludes trash and project/task/workpaper files merely displayed alongside Drive contents. The export does not lock or preserve file contents. Files can change or disappear after the snapshot; compare the blob_id returned by the download-URL endpoint and reconcile discrepancies with a later snapshot.

Example decompressed manifest:

{
  "folders": [
    {"id": 101, "parent_id": null, "name": "Drive"},
    {"id": 102, "parent_id": 101, "name": "Example Client"}
  ],
  "files": [
    {"attachment_id": 9001, "folder_id": 102, "blob_id": 8001,
     "filename": "Return.pdf", "checksum": "opaque-checksum", "byte_size": 123456}
  ]
}
post/drive/inventory_async_export

Request

  • Base URL
    https://app2.gettruss.io/api/v1
  • URL
    https://app2.gettruss.io/api/v1/drive/inventory_async_export
  • Auth
    HTTP bearer

Response

Export queued; poll the Location URL

job_idstring required
status'pending' required

Changes