Policy Comparison API

parsing_statusstringYesCurrent parsing status (e.g., pending, completed)Overview

The Policy Comparison API compares old (current) and new (proposed) insurance policy documents side-by-side using AI-powered analysis. It extracts structured data from both policies and generates a detailed comparison including coverage changes, premium differences, driver/vehicle changes, and agent talking points.

Base URL

https://api.insurgrid.com/api/v1/agent

Authentication

All API requests require an API key passed in the request header.

Header
Value

X-API-Key

Your API key

Endpoints

Upload Policy Document

Upload a policy PDF document for comparison. Each file (old and new) must be uploaded separately.

POST /{agent_id}/policy/upload

Content-Type: multipart/form-data

Request

Field
Type
Required
Description

file

file

Yes

The policy PDF file to upload

entity_type

string

No

Type of policy document (default: declaration_page)

Response

Field
Type
Required
Description

id

string

Yes

Unique document identifier (UUID)

filename

string

Yes

Name of the uploaded file

entity_type

string

Yes

Type of the policy document

created_at

UTC datetime string

Yes

Creation time

Response (200 OK)


Create Policy Comparison

Create a comparison job between old and new policy documents. The comparison runs asynchronously in the background.

Content-Type: application/json

Request Body

Field
Type
Required
Description

prospect

string

Yes

Client/prospect name

old_policies

string[]

Yes

Array of document IDs for old/current policies

new_policies

string[]

Yes

Array of document IDs for new/proposed policies

cURL Example

JavaScript Example

Python Example

Response (200 OK)

List All Comparisons

List all policy comparisons for an agent.

Response (200 OK)

Response Schema

The comparison_result object contains three top-level sections:

current_or_old_policy Object

Full extraction of the old/current policy.

Field
Type
Description

policy

object

Provider, policy number, coverage period, premium, payment details

drivers

array

List of drivers with license, DOB, status, violations

vehicles

array

List of vehicles with VIN, make/model, coverages, premiums

discounts

array

Applied discounts with amounts

surcharges

array

Applied surcharges

new_policy Object

Full extraction of the new/proposed policy (same structure as above).

comparison Object

Detailed comparison between old and new policies.

Field
Type
Description

provider_changed

boolean

Whether the insurance provider changed

driver_changes

object

Added, removed, and changed drivers

vehicle_changes

object

Added, removed, replaced, and changed vehicles

premium_comparison

object

Annual, monthly, 6-month premium differences

coverage_changes_by_vehicle

array

Per-vehicle coverage and deductible changes

added_discounts

array

Discounts in new policy not in old

removed_discounts

array

Discounts in old policy not in new

savings

object

Total savings amount and description

key_changes

array

Summary of key differences

coverage_comparison_table

array

Tabular coverage comparison by vehicle

premium_difference_reasons

array

Reasons for premium changes

talking_points

array

Agent talking points for client conversations

premium_comparison Object

Field
Type
Description

annual.old

number

Old annual premium

annual.new

number

New annual premium

annual.difference

number

Premium difference

annual.percent_change

number

Percentage change

monthly.old

number

Old monthly payment

monthly.new

number

New monthly payment

monthly.difference

number

Monthly difference

six_month.old

number

Old 6-month premium

six_month.new

number

New 6-month premium

six_month.difference

number

6-month difference

per_vehicle_breakdown

array

Premium breakdown per vehicle

coverage_changes_by_vehicle Array Item

Field
Type
Description

vehicle_identifier

string

VIN or year/make/model

coverage_changes

array

Changed coverage types with old/new values

deductible_changes

array

Changed deductibles with old/new values

added_coverages

array

Coverages in new but not old policy

removed_coverages

array

Coverages in old but not new policy

missing_coverages

array

Coverages that should be considered

driver_changes Object

Field
Type
Description

added_drivers

array

Drivers in new policy only

removed_drivers

array

Drivers in old policy only

changed_drivers

array

Drivers with changed details

driver_count_change

object

Old count, new count, difference

vehicle_changes Object

Field
Type
Description

added_vehicles

array

Vehicles in new policy only

removed_vehicles

array

Vehicles in old policy only

replaced_vehicles

array

Vehicles swapped between policies

changed_vehicles

array

Vehicles with changed details

vehicle_count_change

object

Old count, new count, difference

How It Works

  1. Upload Documents — Upload both the old/current policy and new/proposed policy PDFs using the upload endpoint. Note the returned document_id for each.

  2. Create Comparison — Call the comparison endpoint with the prospect name and arrays of old and new document IDs. The API returns a comparison_id and begins processing in the background.

  3. AI Analysis — The system generates presigned URLs for all documents and sends them to Claude AI with a structured comparison prompt. Claude extracts data from both policies and generates a comprehensive comparison.

  4. Poll for Results — Use the status endpoint to check when processing is complete.

  5. Retrieve Results — Once completed, fetch the full comparison result with extracted policy data and detailed diff analysis.

  6. Real-time Updates — The API also sends real-time events via Pusher when comparison completes or errors, allowing for webhook-based notification instead of polling.

Error Responses

chevron-right400 Bad Requesthashtag

Missing or invalid files.

chevron-right401 Unauthorizedhashtag

Invalid or missing API key.

chevron-right413 Payload Too Largehashtag

Files exceed size limit (10MB per file).

chevron-right422 Unprocessable Entityhashtag

Could not extract data from the provided documents.

chevron-right429 Too Many Requestshashtag

Rate limit exceeded.

chevron-right500 Internal Server Errorhashtag

Rate Limits

Plan
Requests/minute
Requests/day

Free

5

50

Pro

30

1,000

Enterprise

Custom

Custom

Rate limit headers are included in all responses:

Supported Document Types

Type
Extensions
Notes

PDF

.pdf

Recommended. Supports text and scanned documents via OCR

Image

.jpg, .png

Single page documents only

Changelog

Version
Date
Changes

1.0.0

2024-11

Initial release

Support

  • Documentation: https://docs.insurgrid.com

  • Status Page: https://status.insurgrid.com

Last updated