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
- Call this endpoint. Poll
GET /drive/inventory_async_export/{job_id}
every 5–15 seconds untilcompleted,failed, orexpired. - Download the
completedresult'sdownload_urland decompress the gzip JSON.
Successfully decompress and parse the complete manifest before applying deletions.
If this firm’scompleted_atis already successfully processed, no work is needed. - Compare files by
attachment_idand folders byid. Build paths from each
folder'sparent_idandname; 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. - Request fresh file URLs through
POST /drive/download_urlsfor new or
changed files, in batches of at most 500 IDs. Download just those files. - Record failures for retry. Mark the snapshot successfully processed only
when required actions finish. Never interpret a failed or partial export as deletions.
| Difference | Local action |
|---|---|
| New attachment ID | Download |
| Changed checksum | Download replacement |
| Changed blob ID without comparable checksums | Download replacement |
| Changed filename or folder ID | Rename/move |
| Missing attachment ID | Delete only if configured as a mirror |
| Renamed or moved parent folder | Update local directory and descendant paths |
| New empty folder | Create 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}
]
}
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
401Authentication required
403Requires unrestricted firm administrator access, enabled Drive and the read scope