Skip to main content
POST
/
api
/
v1
/
external
/
companies
/
{companyId}
/
policies
/
bordereau
/
export
curl --request POST \
  --url https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/bordereau/export \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "spreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "googleOAuthToken": "ya29.a0AfH6SMA...",
  "periodStart": "2025-01-01T00:00:00.000Z",
  "periodEnd": "2025-07-01T00:00:00.000Z"
}
'
{
  "spreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "spreadsheetUrl": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms/edit",
  "rowCount": 247
}

Authorizations

Authorization
string
header
required

API key authentication. Include your API key in the Authorization header.

Path Parameters

companyId
string<uuid>
required

Company identifier

Body

application/json
googleOAuthToken
string
required

Google OAuth2 access token with write access to the target spreadsheet or folder.

spreadsheetId
string

ID of an existing Google Sheets spreadsheet to write into. Mutually exclusive with folderId — provide one or the other.

folderId
string

Google Drive folder ID in which to create a new spreadsheet. Mutually exclusive with spreadsheetId — provide one or the other.

spreadsheetName
string

Custom name for the created spreadsheet. Only used when folderId is provided. Defaults to "{companyShortName}-bordereau-export {UTC timestamp}".

periodStart
string<date-time>

Inclusive lower bound on transactionTimestamp. Only transactions at or after this timestamp are included.

periodEnd
string<date-time>

Exclusive upper bound on transactionTimestamp. Only transactions before this timestamp are included.

actions
enum<string>[]

Transaction actions to include. Omit to include all actions.

Available options:
NEW_BUSINESS,
ENDORSE,
CANCEL,
REINSTATE,
RENEW
additionalColumns
object[]

FullTerm custom object fields to transpose into additional columns. Each entry maps a field path to a column header.

sortBy
enum<string>

Field to sort results by. Default transactionTimestamp.

Available options:
policyNumber,
primaryInsuredName,
effectiveDate,
transactionTimestamp,
createdAt
sortDirection
enum<string>
default:desc

Sort direction (default desc).

Available options:
asc,
desc
limit
integer
default:50000

Maximum number of rows to export. Default and maximum 50,000.

Required range: 1 <= x <= 50000
offset
integer
default:0

Number of rows to skip before starting the export. Default 0.

Required range: x >= 0

Response

Bordereau exported to Google Sheets

Result of exporting bordereau data to Google Sheets.

spreadsheetId
string
required

The Google Sheets spreadsheet ID.

spreadsheetUrl
string<uri>
required

Direct URL to the Google Sheets spreadsheet.

rowCount
integer
required

Number of data rows written to the spreadsheet.