curl --request POST \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/financials/events/{eventId}/import \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"invoices": [
{
"actionId": "3a5b7c9d-1e2f-4a4b-6c8d-7e9f0a1b2c3d",
"categoryId": "550e8400-e29b-41d4-a716-446655440101",
"incurredDate": "2026-06-01",
"memo": "Imported loss",
"lineItems": [
{
"lineItemId": "550e8400-e29b-41d4-a716-446655440301",
"lineItemTypeId": "550e8400-e29b-41d4-a716-446655440111",
"amountCents": 250000
}
],
"payee": "550e8400-e29b-41d4-a716-446655440210"
}
],
"reserves": [
{
"actionId": "4b6c8d0e-2f3a-4b5c-7d9e-8f0a1b2c3d4e",
"categoryId": "550e8400-e29b-41d4-a716-446655440101",
"expectedTotalCents": 1200000,
"reserveDate": "2026-06-01"
}
]
}
'{
"journalIds": [
"5c7d9e1f-3a4b-4c6d-8e0f-9a1b2c3d4e5f",
"3a5b7c9d-1e2f-4a4b-6c8d-7e9f0a1b2c3d",
"4b6c8d0e-2f3a-4b5c-7d9e-8f0a1b2c3d4e"
],
"invoices": [
{
"id": "550e8400-e29b-41d4-a716-446655440701",
"invoiceNumber": "INV-441202-118",
"categoryId": "550e8400-e29b-41d4-a716-446655440101",
"status": "owed",
"linkedEvent": {
"id": "550e8400-e29b-41d4-a716-446655440200",
"displayName": "Claim #1042"
},
"linkedPolicy": null,
"linkedPayee": {
"id": "550e8400-e29b-41d4-a716-446655440210",
"entityType": "Organization",
"displayName": "Smith & Loeb LLP"
},
"incurredDate": "2026-06-01",
"dueDate": null,
"memo": "Imported loss",
"fieldData": null,
"lineItems": [
{
"lineItemId": "550e8400-e29b-41d4-a716-446655440301",
"lineItemTypeId": "550e8400-e29b-41d4-a716-446655440111",
"memo": null,
"amountCents": 250000
}
],
"totalAmountCents": 250000,
"amountPaidCents": 0,
"balanceDueCents": 250000,
"draftAmountPaidCents": null,
"paidDate": null,
"lastPaymentDate": null,
"approved": false,
"approvedAt": null,
"voidedAt": null,
"deletedAt": null,
"createdAt": "2026-06-01T10:30:00.000Z",
"updatedAt": "2026-06-01T10:30:00.000Z",
"headJournalId": "3a5b7c9d-1e2f-4a4b-6c8d-7e9f0a1b2c3d"
}
],
"reserves": [
{
"categoryId": "550e8400-e29b-41d4-a716-446655440101",
"expectedTotalCents": 1200000
}
]
}Import Event Financials
Wholesale refresh of one event’s financials, in ONE transaction — the
import composition: sweep (delete every non-deleted invoice currently
linked to the event — voided included), then create the new slate of
invoices (each linked to the path event, optional per-invoice payee),
then set the expected total per reserved category. An empty request
(invoices: [], reserves: []) clears the event’s invoices.
Importing replaces, it does not append. The request is the full, authoritative set of the event’s invoices and reserve expectations.
Idempotency — client-authored ids per action. Every create and every
reserve set carries its own client-minted actionId (all unique in one
request); sweep deletes mint their own. The composition commits
atomically, so ANY of your ids already journaled proves the whole prior
run committed: the retry short-circuits to your ids plus refreshed read
state, re-applying nothing. A mix of journaled and fresh ids is
409 ACTION_ID_REUSED (ids reused across different runs).
No If-Match — the composition locks every touched aggregate.
Member-action preconditions surface as 422 with the standard stable
codes (e.g. UNKNOWN_ID, DEPRECATED_CONFIG, NOT_RESERVED_CATEGORY,
FUTURE_DATE, LINK_TARGET_MISSING); preconditions fail closed — the
whole import rolls back. An expected total is UNCONSTRAINED: the
composed reserves.set may land a scope’s expected total below its
paid-to-date — a legal state whose remaining reserve reads negative
(see Set Reserves).
Attachments are sidecar — upload documents through the platform files API; this endpoint takes none.
Required permission: financials.import
curl --request POST \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/financials/events/{eventId}/import \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"invoices": [
{
"actionId": "3a5b7c9d-1e2f-4a4b-6c8d-7e9f0a1b2c3d",
"categoryId": "550e8400-e29b-41d4-a716-446655440101",
"incurredDate": "2026-06-01",
"memo": "Imported loss",
"lineItems": [
{
"lineItemId": "550e8400-e29b-41d4-a716-446655440301",
"lineItemTypeId": "550e8400-e29b-41d4-a716-446655440111",
"amountCents": 250000
}
],
"payee": "550e8400-e29b-41d4-a716-446655440210"
}
],
"reserves": [
{
"actionId": "4b6c8d0e-2f3a-4b5c-7d9e-8f0a1b2c3d4e",
"categoryId": "550e8400-e29b-41d4-a716-446655440101",
"expectedTotalCents": 1200000,
"reserveDate": "2026-06-01"
}
]
}
'{
"journalIds": [
"5c7d9e1f-3a4b-4c6d-8e0f-9a1b2c3d4e5f",
"3a5b7c9d-1e2f-4a4b-6c8d-7e9f0a1b2c3d",
"4b6c8d0e-2f3a-4b5c-7d9e-8f0a1b2c3d4e"
],
"invoices": [
{
"id": "550e8400-e29b-41d4-a716-446655440701",
"invoiceNumber": "INV-441202-118",
"categoryId": "550e8400-e29b-41d4-a716-446655440101",
"status": "owed",
"linkedEvent": {
"id": "550e8400-e29b-41d4-a716-446655440200",
"displayName": "Claim #1042"
},
"linkedPolicy": null,
"linkedPayee": {
"id": "550e8400-e29b-41d4-a716-446655440210",
"entityType": "Organization",
"displayName": "Smith & Loeb LLP"
},
"incurredDate": "2026-06-01",
"dueDate": null,
"memo": "Imported loss",
"fieldData": null,
"lineItems": [
{
"lineItemId": "550e8400-e29b-41d4-a716-446655440301",
"lineItemTypeId": "550e8400-e29b-41d4-a716-446655440111",
"memo": null,
"amountCents": 250000
}
],
"totalAmountCents": 250000,
"amountPaidCents": 0,
"balanceDueCents": 250000,
"draftAmountPaidCents": null,
"paidDate": null,
"lastPaymentDate": null,
"approved": false,
"approvedAt": null,
"voidedAt": null,
"deletedAt": null,
"createdAt": "2026-06-01T10:30:00.000Z",
"updatedAt": "2026-06-01T10:30:00.000Z",
"headJournalId": "3a5b7c9d-1e2f-4a4b-6c8d-7e9f0a1b2c3d"
}
],
"reserves": [
{
"categoryId": "550e8400-e29b-41d4-a716-446655440101",
"expectedTotalCents": 1200000
}
]
}Authorizations
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.
Path Parameters
Company identifier
Event identifier — an unknown event is 404
Body
The event's new invoice slate, created in order — each linked to the path event
Show child attributes
Show child attributes
The expected total per reserved category — at most one entry per category
Show child attributes
Show child attributes
Optional display label for the source system's author (e.g. the integrator-side user). Stamped as the journal record's display attribution; the acting principal stays the External API service user, so a label can never impersonate an in-app user. Ignored on idempotent replays
1 - 255Response
A fresh run returns EVERY emitted journal id in execution order (sweep — companions included — then creates, then sets); a short-circuited retry returns the client-authored ids. Either way: the created invoices' current rows and each set scope's refreshed expected total
Every emitted journal id in execution order (client-authored ids only, on a replayed retry)
The created invoices' current rows, in request order
Show child attributes
Show child attributes
Each set scope's refreshed expected total
Show child attributes
Show child attributes
