> ## 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.

# Get Invoice Bill Review

> Returns the invoice's LATEST bill review — the run, its verdict, and
every finding it raised.

A bill review checks one invoice against the company's own bill review rules
and reports what it thinks is wrong with it. Runs are immutable records of
what was judged: this endpoint always answers with the most recent one, and
[starting a new review](/api-reference/financials/start-invoice-bill-review)
adds a run rather than editing this one.

**Poll this endpoint.** `status` is `queued` or `running` while the review is
under way and `succeeded` or `failed` once it is terminal. `passed` is the
verdict and is `null` until then — and stays `null` forever on a `failed`
run, which is why `error` is the field to read there rather than inferring a
verdict from an empty `findings` list.

**Staleness is yours to check.** `invoiceHeadJournalId` is the invoice
version this run judged, pinned when the review was started. Compare it with
the invoice's current `headJournalId`
([Get Invoice](/api-reference/financials/get-invoice)): if they differ, the
document has been edited since it was reviewed and the findings describe an
earlier version of it.

**Dismissals.** `dismissedAt` is set on a finding an operator has cleared in
the app. Dismissal is a stamp, never a delete, so a dismissed finding is
still returned — filter on the field if your integration only wants
outstanding ones. There is no API to dismiss.

`billReview` is `null` when the invoice exists but has never been
reviewed. An id that does not resolve for this company is a `404`.

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




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/bill-review
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}/financials/invoices/{invoiceId}/bill-review:
    get:
      tags:
        - Financials
      summary: Get Invoice Bill Review
      description: >
        Returns the invoice's LATEST bill review — the run, its verdict, and

        every finding it raised.


        A bill review checks one invoice against the company's own bill review
        rules

        and reports what it thinks is wrong with it. Runs are immutable records
        of

        what was judged: this endpoint always answers with the most recent one,
        and

        [starting a new
        review](/api-reference/financials/start-invoice-bill-review)

        adds a run rather than editing this one.


        **Poll this endpoint.** `status` is `queued` or `running` while the
        review is

        under way and `succeeded` or `failed` once it is terminal. `passed` is
        the

        verdict and is `null` until then — and stays `null` forever on a
        `failed`

        run, which is why `error` is the field to read there rather than
        inferring a

        verdict from an empty `findings` list.


        **Staleness is yours to check.** `invoiceHeadJournalId` is the invoice

        version this run judged, pinned when the review was started. Compare it
        with

        the invoice's current `headJournalId`

        ([Get Invoice](/api-reference/financials/get-invoice)): if they differ,
        the

        document has been edited since it was reviewed and the findings describe
        an

        earlier version of it.


        **Dismissals.** `dismissedAt` is set on a finding an operator has
        cleared in

        the app. Dismissal is a stamp, never a delete, so a dismissed finding is

        still returned — filter on the field if your integration only wants

        outstanding ones. There is no API to dismiss.


        `billReview` is `null` when the invoice exists but has never been

        reviewed. An id that does not resolve for this company is a `404`.


        **Required permission:** `company.payment:read`
      operationId: getFinancialsInvoiceBillReview
      parameters:
        - $ref: '#/components/parameters/companyId'
        - name: invoiceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Invoice identifier
      responses:
        '200':
          description: >-
            The invoice's latest bill review, or `null` if it has never been
            reviewed
          content:
            application/json:
              schema:
                type: object
                properties:
                  billReview:
                    $ref: '#/components/schemas/BillReview'
              examples:
                reviewed:
                  summary: A finished review that found something
                  value:
                    billReview:
                      runId: 994bfc11-8ff3-485a-89ff-7839c9bb6101
                      status: succeeded
                      trigger: manual
                      passed: false
                      invoiceHeadJournalId: 1b2c3d4e-5f60-4712-8823-94a5b6c7d8e9
                      error: null
                      createdAt: '2026-06-14T12:00:00.000Z'
                      finishedAt: '2026-06-14T12:00:14.000Z'
                      findings:
                        - id: 0f204eac-17e5-42bc-93b1-0dd2aea57baa
                          subject: lineItem:550e8400-e29b-41d4-a716-446655440300
                          severity: error
                          message: >-
                            Legal work is billed at $450/hr; this line item
                            bills it at $600/hr.
                          ruleId: 7c9e6679-7425-40de-944b-e07fc1f90ae7
                          dismissedAt: null
                running:
                  summary: A review still under way — no verdict yet
                  value:
                    billReview:
                      runId: 994bfc11-8ff3-485a-89ff-7839c9bb6101
                      status: running
                      trigger: manual
                      passed: null
                      invoiceHeadJournalId: 1b2c3d4e-5f60-4712-8823-94a5b6c7d8e9
                      error: null
                      createdAt: '2026-06-14T12:00:00.000Z'
                      finishedAt: null
                      findings: []
                neverReviewed:
                  summary: The invoice has never been reviewed
                  value:
                    billReview: null
        '400':
          description: Bad Request — a non-uuid `invoiceId`, or an unknown query parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not Found — no invoice with this id for this company
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invoiceNotFound:
                  summary: Invoice not found
                  value:
                    error:
                      code: NotFoundError
                      message: Invoice not found
                      userMessages:
                        - Invoice not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
  schemas:
    BillReview:
      type: object
      nullable: true
      description: >-
        An invoice's latest bill review — the run, its verdict, and the findings
        it raised. `null` when the invoice has never been reviewed.
      required:
        - runId
        - status
        - trigger
        - passed
        - invoiceHeadJournalId
        - error
        - createdAt
        - finishedAt
        - findings
      properties:
        runId:
          type: string
          format: uuid
          description: >-
            This run's id — what Start Invoice Bill Review returns and what you
            poll
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
          description: >-
            `queued` and `running` are non-terminal — keep polling. `succeeded`
            means the engine reached a verdict (read `passed`); `failed` means
            it did not (read `error`)
        trigger:
          type: string
          enum:
            - manual
            - bulk
            - after_parse
          description: >-
            What asked for this run: `manual` (one invoice — including every
            review started over this API), `bulk` (an in-app sweep of several),
            `after_parse` (automatically, when the invoice was parsed from a
            document)
        passed:
          type: boolean
          nullable: true
          description: >-
            The verdict — `true` when the invoice broke none of the company's
            rules. `null` until the run is terminal, and `null` forever on a
            `failed` run (which produced no verdict at all — do not read that as
            a pass)
        invoiceHeadJournalId:
          type: string
          format: uuid
          description: >-
            The invoice version this run judged, pinned when the review was
            started. If it differs from the invoice's current `headJournalId`,
            the document has been edited since and these findings describe an
            earlier version of it
        error:
          type: string
          nullable: true
          description: Why the run failed, when `status` is `failed`; otherwise `null`
        createdAt:
          type: string
          format: date-time
          description: When the run was created (when the review was asked for)
        finishedAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the run reached a terminal status; `null` while it is still
            under way
        findings:
          type: array
          description: >-
            What the review says is wrong with the invoice. Empty on a run that
            has not finished, on a passing invoice, and on a failed run
          items:
            type: object
            required:
              - id
              - subject
              - severity
              - message
              - ruleId
              - dismissedAt
            properties:
              id:
                type: string
                format: uuid
              subject:
                type: string
                description: >-
                  Which part of the invoice this is about — one of `memo`,
                  `dueDate`, `incurredDate`, `category`, `total`,
                  `lineItem:<lineItemId>`, `field:<fieldKey>` (a
                  tenant-configured field), or `fields` (the configured fields
                  as a set, e.g. one that is absent entirely)
                example: lineItem:550e8400-e29b-41d4-a716-446655440300
              severity:
                type: string
                enum:
                  - info
                  - warning
                  - error
              message:
                type: string
                description: What the review says, in prose, about this part of the invoice
              ruleId:
                type: string
                format: uuid
                nullable: true
                description: >-
                  The company bill review rule this finding was attributed to;
                  `null` when the engine named none
              dismissedAt:
                type: string
                format: date-time
                nullable: true
                description: >-
                  When an operator cleared this finding in the app, or `null`
                  while it is outstanding. Dismissal is a stamp, not a delete,
                  so dismissed findings are still returned — filter on this if
                  you only want outstanding ones
    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.

````