Send Bordereau Export Run to Google Drive
Delivers the file a succeeded bordereau export run produced to Google
Drive as a new Google Sheets spreadsheet — the Drive half of
POST /policies/bordereau/export-runs, replacing the retired
synchronous Google Sheets export endpoint.
The spreadsheet is created as the caller, in the Drive folder named by
folderId, using the googleOAuthToken supplied in the body — the token
is used once to create the spreadsheet and never persisted. The spreadsheet
is named bordereau-export-{runId} and carries one tab (bordereau) with
exactly the run’s CSV cells: the delivery changes the file format, never
the values. Each call creates a fresh spreadsheet; delivering the same run
twice creates two.
Only a succeeded run delivers. Every other status is a 404:
queued and running have no file yet, failed never produced one, and
expired means the file passed its retention horizon and was deleted. Poll
GET .../export-runs/{runId} to learn which — the poll stays readable
for every status — and start a new export when the run failed or expired.
Required permission: company.policy:read
Authorizations
User-principal OAuth 2.0 Bearer authentication. Send a user-scoped Auth0 access token (audience = the app API audience) as Authorization: Bearer <jwt>. The request resolves to the user's identity and is authorized by their Role on the {companyId} in the path — the same role-based permissions the web app enforces. This is the path the MCP connector uses to act on a user's behalf; endpoints that accept it list both BearerAuth and ApiKeyAuth.
Path Parameters
Company identifier
The run identifier returned by POST /policies/bordereau/export-runs. Runs are scoped to their company AND
their kind: a run id belonging to another company, or to an entity
export run rather than a bordereau one, returns 404, exactly as an id
that exists nowhere does.
Body
Google Drive folder ID in which to create the new spreadsheet.
1Google OAuth2 access token with write access to the target folder. The spreadsheet is created as this token's user, who owns the resulting file; the token is used once and never persisted.
1Response
The run's file was delivered as a new spreadsheet
Result of delivering a succeeded export run's file to Google Drive as a new spreadsheet.
Direct URL to the created Google Sheets spreadsheet, in the caller's Drive.
