curl --request GET \
--url https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate \
--header 'Authorization: <api-key>'import requests
url = "https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"policyId": "550e8400-e29b-41d4-a716-446655440001",
"validatedAt": "2026-04-14T18:30:00.000Z",
"summary": {
"totalChecks": 8,
"passed": 8,
"failed": 0,
"skipped": 0
},
"results": [
{
"check": "contiguity",
"status": "pass",
"scope": "version:1"
},
{
"check": "versionSequentiality",
"status": "pass",
"scope": "policy"
}
]
},
{
"policyId": "550e8400-e29b-41d4-a716-446655440002",
"validatedAt": "2026-04-14T18:30:00.000Z",
"summary": {
"totalChecks": 13,
"passed": 12,
"failed": 1,
"skipped": 0
},
"results": [
{
"check": "hashCorrectness",
"status": "fail",
"scope": "version:2",
"message": "Segment 0 hash mismatch: stored a1b2c3d4e5f6, computed f6e5d4c3b2a1"
},
{
"check": "versionSequentiality",
"status": "pass",
"scope": "policy"
}
]
}
],
"totalCount": 47
}Validate Policies (Batch)
Runs data consistency checks against multiple policies in a single request and returns paginated results. This is a read-only diagnostic endpoint — no data is modified.
Three modes control which policies are validated (mutually exclusive):
- Explicit pairs (
policyVersions) — validate specific policy/version combinations. Pagination parameters are ignored. - Time travel (
timeTravelBackToDate) — validate the latest version of each policy as of a historical point in time. Paginated vialimit/offset. - Default (neither parameter) — validate the latest version of
all policies in the company. Paginated via
limit/offset.
The same eight checks from the single-policy validation endpoint
are available. Use the checks parameter to select a subset.
Available checks
| Check | Scope | What it validates |
|---|---|---|
contiguity | version | Segments form a contiguous date range with no gaps or overlaps |
fullTermInvariance | version | Billing and policy metadata fields are constant across all segments in a version |
hashCorrectness | version | Stored segment hash matches the computed hash of the segment data |
noDuplicateSegments | version | No adjacent segments have identical hashes |
transactionSegmentExistence | version | At least one segment exists for the version |
versionSequentiality | policy | Versions are sequential starting from 1 with no gaps |
cancelEarnedPremium | policy | Cancel transaction premium matches earned premium through the cancellation date |
cancelReinstatePremium | policy | Reinstate transaction premium matches the pre-cancel version premium |
Required permission: company.policy:read
curl --request GET \
--url https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate \
--header 'Authorization: <api-key>'import requests
url = "https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"policyId": "550e8400-e29b-41d4-a716-446655440001",
"validatedAt": "2026-04-14T18:30:00.000Z",
"summary": {
"totalChecks": 8,
"passed": 8,
"failed": 0,
"skipped": 0
},
"results": [
{
"check": "contiguity",
"status": "pass",
"scope": "version:1"
},
{
"check": "versionSequentiality",
"status": "pass",
"scope": "policy"
}
]
},
{
"policyId": "550e8400-e29b-41d4-a716-446655440002",
"validatedAt": "2026-04-14T18:30:00.000Z",
"summary": {
"totalChecks": 13,
"passed": 12,
"failed": 1,
"skipped": 0
},
"results": [
{
"check": "hashCorrectness",
"status": "fail",
"scope": "version:2",
"message": "Segment 0 hash mismatch: stored a1b2c3d4e5f6, computed f6e5d4c3b2a1"
},
{
"check": "versionSequentiality",
"status": "pass",
"scope": "policy"
}
]
}
],
"totalCount": 47
}Authorizations
Query Parameters
Comma-separated list of policyId:version pairs to validate.
Example: pol-abc:1,pol-def:2,pol-abc:3.
Each pair must have a non-empty policy ID and a positive integer version. Multiple versions of the same policy are allowed.
When provided, limit and offset are ignored — all requested
pairs are returned.
Mutually exclusive with timeTravelBackToDate.
Response
Paginated validation results
Was this page helpful?
