# Cloud storage: send finalised files to Google Drive and bring files into the hub

> Connect Google Drive, export a finalised report or pack as a versioned file under a folder per client, import files from the store into the document hub, and name the folders of a store that an agent may read.

Source: /help/en/documents/cloud-storage

A **cloud store** connected to your organisation receives the files you finalise and hands you the files it already holds. For exporting and importing the files you choose, the store is **Google Drive**. A **OneDrive** connection, which also covers the SharePoint libraries its account can open, is made together with a Microsoft 365 mailbox and reads only: agents read the folders you name in it and nothing is ever written to it. Dropbox and SmartVault arrive in a later release against the same connector. On the local stack a **stub** store stands in for them.

Where to find it: **Settings → Connections → Cloud storage** for the connections, where a click on a connection opens its own page; the **Export** button on a file in the document hub's preview panel; **Browse and import** on a connection.

## Connecting

**Connect Google Drive** opens Google's consent screen for the account you choose and comes back to the Cloud storage tab with the connection listed. The product asks only for the files it creates or you pick (the `drive.file` scope). The tokens are stored sealed: no page or API answer returns them. **Edit** names the account and the root folder (by default *My Drive*); a firm's connection keeps a **folder per client** under that root, named after the client.

Only owners and admins connect or disconnect a store; owners, admins and accountants export and import. **Disconnect** revokes the token with Google; the files already exported keep their external ids.

## Exporting a finalised file

Open a file in the document hub and click **Export**. Only a **finalised** file leaves the hub: a report you exported, a report published to the portal, a filing pack, a signed copy. A receipt, a statement or a plain upload is refused with *storage_not_final*; finalise it first. Inside a managed client the dialog offers the client's own stores and the managing firm's: on the firm's store the file lands in the client's folder.

Exporting the **same file again** writes a **new version** of the same Drive file, never a copy; the file's details show the store, the version and when it went. The hub's copy stays the record: the external file is a delivery.

## Importing

**Browse and import** on a connection lists the root folder; open a folder, tick the files and **Import**. Each file is copied into the hub under *Reports* (or the folder you choose) with origin *Cloud store* and the Drive file id, and is parsed like any upload. Importing the same Drive file again makes a second hub file.

## Mailboxes and what agents may read

The same tab holds the sources an agent may read: the **Mailboxes** card under the cloud stores, and the **Agents may read** column on each cloud store. Three words describe them:

- A **connection** is one mailbox or one cloud store that an owner or admin connected. Its tokens are stored sealed: no page and no API answer returns them.
- A **scope** says what may be read inside the connection. For a mailbox: the **Folders**, the **Senders** (addresses or domains), a **Since** date and **Attachments only**; an empty list means every folder or every sender. For a cloud store: the folders and a **Since** date under **What agents may read**.
- A **grant** lets one agent read one connection. Click the button in the **Agents may read** column (it reads *No agent* or the number of agents), then **Allow** beside an agent. **Stop** ends the grant, and that agent's next read is refused. The first row of the list is **The assistant**: allow it to let the AI assistant read the source for a member who may read incoming documents.

Nothing is read until a grant exists. A connection alone gives no agent anything, and an agent with a grant reads only inside the scope. Every read is recorded with the agent and its run. What an agent finds becomes a draft that a person accepts: nothing is posted, paid or sent by itself.

**Connect Microsoft 365** on the Mailboxes card opens Microsoft's consent screen and comes back with the mailbox listed; Gmail and IMAP mailboxes arrive in a later release. **Connect a mailbox** offers the test connection, *Stub (local stack)*, which needs no sign-in. Every 15 minutes each source is listed, and what is new inside its scope appears under **Purchases → Sources**; a mailbox reads *Not read yet* until its first listing. **Disconnect** drops a mailbox's tokens and ends every agent's grant on it; the items already read stay. The whole flow, from the connection to the drafts an agent files, is in [Mailbox and file sources](/help/en/incoming-invoices/mailbox-and-file-sources).

Mailboxes and file sources for agents belong to the Professional and Enterprise plans. On another plan the card and the column name the plan that carries them, for example *In Professional*. Only owners and admins connect a mailbox, set a scope or allow an agent.

## Folders an agent may read

A connected store gives an agent nothing by itself. You name the folders that may be read, and you allow the agent.

- **Where.** Click the store in the list to open its page. The **Scope** card holds **Folders** and **Since**; **Save scope** stores them. The same two fields are under **What agents may read** when you click the button in the **Agents may read** column.
- **Folders.** Name each folder by the id the store gives it, separated by commas. Only the files directly inside a named folder are read, not those of its subfolders. With no folder named, nothing in the store may be read.
- **Since.** With a date, only files changed on or after that day are listed.
- **Who may read.** On the **Agents allowed** card, click the button and **Allow** an agent, or **The assistant**. **Stop** ends the grant, and the next read is refused.
- **What happens then.** Every 15 minutes (or at the interval you set on the **Poll** card, up to 24 hours) the new files of those folders appear under **Purchases → Sources** as items. Filing an item copies the file into the hub and reads it: a bill becomes a draft bill, a receipt a draft expense, anything else a hub document with the source *Cloud store*. Nothing is accepted or posted by itself.
- **Narrowing the scope.** When you take a folder out of the scope, the items that were listed from it are refused as well (`source_out_of_scope`).
- **Who read what.** The **Reads** card of the connection lists every listing, read and filing with who did it and when.
- **Which stores can be read.** A OneDrive connection and the test store. A Google Drive connection exports and imports the files you choose and has no reading side for agents in this release: leave its folders empty.

Folders an agent may read belong to the Professional and Enterprise plans, and only owners and admins set a scope or allow an agent.

## Through the API and an assistant

`GET` and `POST /storage/connections`, `GET /storage/connections/{id}/files`, `POST /storage/connections/{id}/export` and `/import`, `DELETE /storage/connections/{id}`; the MCP tools `export_to_storage` and `list_storage_connections`. Google Drive connects only through the app's OAuth flow; the API creates the stub connection of the local stack.

Mailboxes and grants: `GET` and `POST /connections/mailboxes`, `DELETE /connections/mailboxes/{id}`, `GET` and `POST /connections/source-grants`, `DELETE /connections/source-grants/{id}` and `GET /sources/items` (what the sources found); the MCP tools `list_mailbox_connections` and `list_source_items` read them. One connection with its scope, its grants and its poll is `GET /connections/{kind}/{id}` (kind `mailbox` or `store`); the routes and tools that read, file, hold and ignore an item are listed in [Mailbox and file sources](/help/en/incoming-invoices/mailbox-and-file-sources). A person connects a mailbox and allows an agent, in the app or over REST as an owner or admin: an assistant has no tool for either, and no route accepts a token.
