Skip to main content
GET
/
api
/
v1
/
external
/
companies
/
{companyId}
/
policies
/
validate
Validate Policies (Batch)
curl --request GET \
  --url https://app.aiinsurance.io/api/v1/external/companies/{companyId}/policies/validate \
  --header 'Authorization: <api-key>'
{
  "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

Authorization
string
header
required

API key authentication. Include your API key in the Authorization header.

Path Parameters

companyId
string<uuid>
required

Company identifier

Query Parameters

policyVersions
string

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.

timeTravelBackToDate
string<date-time>

ISO 8601 timestamp. Validates the latest version of each policy that has at least one transaction created on or before this date. Policies with no transactions by this date are excluded.

Mutually exclusive with policyVersions.

checks
string

Comma-separated list of check names to run (e.g., contiguity,hashCorrectness). If omitted, all checks run. Unrecognized check names are silently ignored. If all provided names are unrecognized, all checks run (same as omitting the parameter). Check names are case-sensitive.

limit
integer
required

Maximum number of policies to return per page. Required for all requests, though it is ignored when policyVersions is provided.

Required range: x >= 1
offset
integer
default:0

Number of policies to skip before returning results. Defaults to 0. Ignored when policyVersions is provided.

Required range: x >= 0

Response

Paginated validation results

Paginated list of validation results for multiple policies.

items
object[]
required

Validation results for each policy in this page

totalCount
integer
required

Total number of policies matching the query (before pagination). Use with limit and offset to page through results.

Example:

47