> ## Documentation Index
> Fetch the complete documentation index at: https://docs.go.aiinsurance.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Download Bordereau CSV

> Downloads the bordereau report as a CSV file. Returns the same transaction-level
premium data as the [List Bordereau Rows](/api-reference/field-model/bordereau/list)
endpoint, serialized as RFC 4180 CSV with a `Content-Disposition: attachment` header.

By default the CSV includes the 12 fixed columns (Policy Number, Insured
Name, Transaction Action, Policy Version, Effective Date, Transaction
Timestamp, Policy Start Date, Policy End Date, Created At, Created By,
Policy Premium, Policy Premium Change).

To take full control of the column set — selecting, omitting, and
reordering the fixed columns, with field columns interleaved anywhere —
pass `columns`: an ordered array that completely describes the output.

Default limit is 50,000 rows (maximum 50,000).

**Required permission:** `company.policy:read`




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/bordereau/download
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://go.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/companies/{companyId}/policies/bordereau/download:
    get:
      tags:
        - Field Model Bordereau
      summary: Download Bordereau CSV
      description: >
        Downloads the bordereau report as a CSV file. Returns the same
        transaction-level

        premium data as the [List Bordereau
        Rows](/api-reference/field-model/bordereau/list)

        endpoint, serialized as RFC 4180 CSV with a `Content-Disposition:
        attachment` header.


        By default the CSV includes the 12 fixed columns (Policy Number, Insured

        Name, Transaction Action, Policy Version, Effective Date, Transaction

        Timestamp, Policy Start Date, Policy End Date, Created At, Created By,

        Policy Premium, Policy Premium Change).


        To take full control of the column set — selecting, omitting, and

        reordering the fixed columns, with field columns interleaved anywhere —

        pass `columns`: an ordered array that completely describes the output.


        Default limit is 50,000 rows (maximum 50,000).


        **Required permission:** `company.policy:read`
      operationId: exportBordereauCsv
      parameters:
        - $ref: '#/components/parameters/companyId'
        - name: periodStart
          in: query
          schema:
            type: string
            format: date-time
          description: >
            Inclusive lower bound on `transactionTimestamp`. Only transactions
            at or after

            this timestamp are included.
        - name: periodEnd
          in: query
          schema:
            type: string
            format: date-time
          description: >
            Exclusive upper bound on `transactionTimestamp`. Only transactions
            before

            this timestamp are included.
        - name: actions
          in: query
          schema:
            type: string
          description: >
            Comma-separated list of transaction actions to include.

            Valid values: `NEW_BUSINESS`, `ENDORSE`, `CANCEL`, `REINSTATE`,
            `RENEW`.

            Omit to include all actions.


            **Note:** Unrecognized action values are not rejected — they
            silently

            match zero rows. Double-check spelling if results are unexpectedly
            empty.
        - name: columns
          in: query
          schema:
            type: string
          description: >
            JSON-encoded ordered array of column specs (see
            `BordereauColumnSpec`)

            that COMPLETELY describes the output columns: fixed columns become

            selectable, omittable, and reorderable, and field columns

            (`{"kind":"field"}` entries — a dot-path into the policy's field
            data

            plus a display header, resolved per row as of the transaction's

            effective date) interleave anywhere. Omit for the default column set

            (the fixed 12).
          examples:
            reorderedWithField:
              summary: Reordered fixed keys with a field column interleaved
              value: >-
                [{"kind":"fixed","key":"effectiveDate"},{"kind":"field","path":"policyStatus","header":"Status"},{"kind":"fixed","key":"policyNumber"}]
            appendedFields:
              summary: The fixed 12 (spelled out) with field columns appended
              value: >-
                [{"kind":"fixed","key":"policyNumber"},{"kind":"fixed","key":"primaryInsuredName"},{"kind":"fixed","key":"transactionAction"},{"kind":"fixed","key":"policyVersion"},{"kind":"fixed","key":"effectiveDate"},{"kind":"fixed","key":"transactionTimestamp"},{"kind":"fixed","key":"policyStartDate"},{"kind":"fixed","key":"policyEndDate"},{"kind":"fixed","key":"createdAt"},{"kind":"fixed","key":"createdBy"},{"kind":"fixed","key":"policyPremium"},{"kind":"fixed","key":"policyPremiumChange"},{"kind":"field","path":"fullTermPricingInfo.taxes","header":"Taxes"}]
        - name: filters
          in: query
          schema:
            type: string
          description: >
            JSON-encoded array of policy filters (see `FieldModelV1ListFilter`).

            Restricts the export to transactions of the policies whose CURRENT

            segment matches every filter — the filter selects the policies, then
            all

            of each matching policy's transactions in the period are included.
            Omit

            to include every policy. Same field-filter model as the

            [Policy List](/api-reference/field-model/policies/list) `filters`

            parameter (field types `text`, `number`, `boolean`, `date`,
            `currency`,

            `optionSet`, `address`, `join`, and the list-cardinality types).
          examples:
            statusFilter:
              summary: Only policies whose current status is Active
              value: >-
                [{"fieldReferenceId":"policyStatus","fieldType":"optionSet","operator":"in","value":["active"]}]
        - name: sortBy
          in: query
          schema:
            type: string
            enum:
              - policyNumber
              - primaryInsuredName
              - effectiveDate
              - transactionTimestamp
              - createdAt
          description: Field to sort results by. Default `transactionTimestamp`.
        - name: sortDirection
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          description: Sort direction (default `desc`).
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50000
            default: 50000
          description: Maximum number of rows to include. Default and maximum 50,000.
        - name: offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of rows to skip before starting the export. Default 0.
      responses:
        '200':
          description: CSV file download
          headers:
            Content-Disposition:
              schema:
                type: string
              description: |
                Attachment header with the suggested filename.
                Example: `attachment; filename="bordereau-export-acme.csv"`
          content:
            text/csv:
              schema:
                type: string
              examples:
                csvOutput:
                  summary: CSV with two transactions
                  value: >
                    Policy Number,Insured Name,Transaction Action,Policy
                    Version,Effective Date,Transaction Timestamp,Policy Start
                    Date,Policy End Date,Created At,Created By,Policy
                    Premium,Policy Premium Change

                    POL-2025-001,Mercy General
                    Hospital,NEW_BUSINESS,1,2025-01-01,2025-01-15T10:30:00.000Z,2025-01-01,2026-01-01,2025-01-15T10:30:00.000Z,api-key|abc123,85000,85000

                    POL-2025-001,Mercy General
                    Hospital,ENDORSE,2,2025-06-01,2025-06-01T14:00:00.000Z,2025-01-01,2026-01-01,2025-06-01T14:00:00.000Z,api-key|abc123,102000,17000
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalidFieldColumnPath:
                  summary: columns field path is a malformed dot-path
                  value:
                    error:
                      code: ValidationError
                      message: >-
                        path must be a dot-separated field path (no empty,
                        leading, trailing, or doubled segments)
                      userMessages:
                        - >-
                          path must be a dot-separated field path (no empty,
                          leading, trailing, or doubled segments)
                limitExceeded:
                  summary: Limit exceeds maximum
                  value:
                    error:
                      code: INVALID_REQUEST
                      message: limit must not exceed 50000
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
  schemas:
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            userMessages:
              type: array
              description: >-
                Clean, verbatim-displayable messages — one entry per failure,
                free of error-code tags, field paths, and internal noise.
                Suitable for showing to end users as-is.
              items:
                type: string
              example:
                - Exposures of type 'company' require an address
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: AuthenticationError
                  message: API key authentication required
                  userMessages:
                    - API key authentication required
            invalidApiKey:
              summary: >-
                Invalid API key (e.g. unknown key, or a Bearer token used
                instead of an API key)
              value:
                error:
                  code: AuthenticationError
                  message: Invalid API key
                  userMessages:
                    - Invalid API key
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: AuthorizationError
                  message: User is not authorized to perform the requested action
                  userMessages:
                    - User is not authorized to perform the requested action
            companyMismatch:
              summary: A valid API key naming another company in the URL
              value:
                error:
                  code: AuthorizationError
                  message: API key is not scoped to the requested company
                  userMessages:
                    - API key is not scoped to the requested company
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: UncaughtActionError
                  message: Uncaught error occurred in <actionName>
                  userMessages:
                    - An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Send your raw API key as the `Authorization`
        header value with NO scheme prefix — `Authorization: YOUR-API-KEY`. Do
        NOT prefix it with `Bearer ` or `ApiKey `, and do not use an `X-API-Key`
        header; those are not accepted.

````