Skip to main content

Overview

Welcome to the AI Insurance External API documentation. This API allows you to programmatically manage your insurance operations, including submissions, quotes, policies, and more. Current API Resources:
  • Submissions - Create and manage insurance submissions
  • Quotes - Generate and retrieve quote information
  • Notes - Attach comments and documentation to entities
  • Configuration - Access your company’s rating fields and coverage types
Coming Soon:
  • Policies
  • Events
  • Insureds
  • Financials

Getting Started

Base URL

All API endpoints are relative to your AI Insurance instance base URL:
https://app.aiinsurance.io

Authentication

All API requests require authentication using an API key. Include your API key in the request headers:
Authorization: ApiKey YOUR-API-KEY
To generate an API key, see Authentication.

API Resources

Submissions

Create and manage insurance submissions with complete policy and insured information.

Quotes

Generate and retrieve quote information for submissions.
  • List Quotes (GET /api/external/companies/{companyId}/quotes) - Retrieve complete quote details with all nested data
  • List Quote Info (GET /api/external/companies/{companyId}/quotes-info) - Retrieve lightweight quote information (faster)
  • Get Quote (GET /api/external/companies/{companyId}/quotes/{quoteId}) - Get detailed quote information by ID
See the Quotes section in the sidebar for interactive API documentation.

Configuration

Access your company’s configuration including rating fields, coverage types, and entity types.

Reference Documentation

Data Models

Complete reference for all data structures used in the API: See Data Models for complete reference.

Quick Start Example

Here’s a simple example to create a submission:
curl -X POST \
  "https://app.aiinsurance.io/api/external/companies/<YOUR-COMPANY-ID>/submissions" \
  -H "Authorization: ApiKey <YOUR-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My First Submission",
    "type": "new_business",
    "policy": {
      "policyNumber": "POL-001",
      "policyType": "O",
      "policyStartDate": "2024-01-01",
      "policyEndDate": "2025-01-01"
    }
  }'
See the Submissions Guide for detailed examples and tutorials.

Audit Logging

All external API calls are automatically logged for audit and debugging purposes. The audit log captures request details, response status, and timing information.

Batch ID for Request Correlation

When making multiple related API calls (e.g., creating several submissions as part of a batch import), you can include an optional batchId field in the request body of any mutation endpoint (POST, PUT, PATCH, DELETE). This allows you to correlate and query related requests later. Key points:
  • batchId is a pass-through field—it’s not validated or part of the request schema
  • Include it at the root level of your request body
  • The value is stored in the external_api_audit_log table (indexed for efficient querying)
  • Use any string value that helps you identify related requests (e.g., UUID, timestamp, job ID)

Example: Including batchId

# Create multiple submissions with the same batchId for correlation
BATCH_ID="import-2024-01-15-abc123"

curl -X POST \
  "https://app.aiinsurance.io/api/external/companies/<YOUR-COMPANY-ID>/submissions" \
  -H "Authorization: ApiKey <YOUR-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "batchId": "'"$BATCH_ID"'",
    "name": "Submission 1",
    "type": "new_business",
    "policy": {
      "policyNumber": "POL-001",
      "policyType": "O",
      "policyStartDate": "2024-01-01",
      "policyEndDate": "2025-01-01"
    }
  }'

curl -X POST \
  "https://app.aiinsurance.io/api/external/companies/<YOUR-COMPANY-ID>/submissions" \
  -H "Authorization: ApiKey <YOUR-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "batchId": "'"$BATCH_ID"'",
    "name": "Submission 2",
    "type": "new_business",
    "policy": {
      "policyNumber": "POL-002",
      "policyType": "O",
      "policyStartDate": "2024-01-01",
      "policyEndDate": "2025-01-01"
    }
  }'
This makes it easy to later query the audit log for all API calls associated with a specific batch operation.