Skip to content

Estimate recoveries

View as Markdown

POST https://towers-api.vinsa.dev/api/v1/recoveries

Send a Program and a year of Losses to estimate how proportional and excess-of-loss (XOL) Layers respond, how much falls to the cedant or reinsurer, and how much annual limit is left. The operation is stateless.

Estimates only. Every money figure is an Estimate for illustration and what-if analysis. Never use the figures for booking, technical accounts, settlement or bordereaux. Every response carries estimate: true.

Set up with your agent
Help me add Towers recovery estimates to this project.

1. Read the Towers setup skill at https://towers.vinsa.dev/.well-known/agent-skills/towers/SKILL.md and follow its steps in order.
2. Read https://towers.vinsa.dev/docs/api/recoveries.md. Call POST /recoveries from my server with my Program and Losses, and label every returned money figure as an Estimate for illustration and what-if.
3. Ask me for my Towers API key rather than making one up, and keep it in a server-side env file that is not committed.
4. When you are done, tell me what you changed and anything still waiting on me.

Use an API key and Content-Type: application/json.

Field Type Required Meaning
program Program yes Core Program with Contracts, Layers, Lines and Risks.
requestId, requestedAt string Caller metadata.
source object Required string system and optional string version.
viewpoint Viewpoint Defaults to whole. Use the reinsurer viewpoint for Our share Estimates.
losses Loss[] yes One or more Losses for one contract year.
openingPositions OpeningPosition[] Booked annual positions, one per Contract and Layer pair.
splitByLine boolean Set to true for per-Line recovery Estimates.
Field Type Required Meaning
lossId string yes Non-empty and unique within the request.
riskId string yes Identifies a Risk in the Program. An unknown id returns HTTP 400 with the Loss field path.
date string yes Valid ISO calendar date (YYYY-MM-DD).
amount number yes Finite, non-negative gross amount at 100%.
currency string yes Non-empty currency.
eventId string Non-empty caller reference grouping Losses into an Event.
Field Type Required Meaning
contractRef string yes Non-empty Contract reference.
layerRef string yes Non-empty Layer reference.
aadUsed number yes Finite, non-negative annual aggregate deductible used.
reinstatementsUsed integer yes Finite, non-negative count of reinstatement entries already started.
limitRemaining number yes Finite, non-negative remaining annual capacity.

A Loss without an eventId forms its own Event. The Engine applies Layers in ascending rank.

Default rank Layers Input grouping
1 Proportional (QSR, SPL, FAC) Each Loss individually.
2 Per-claim (CLM) and per-risk (RSK) XOL Each Loss for CLM, or each Risk’s total within the Event for RSK.
3 Per-event (EVT) XOL The Event total across Risks listing the Contract.
4 Aggregate (AGR) XOL The running year total across Risks listing the Contract.

A Contract’s inuringOrder overrides the default for every Layer in that Contract. It accepts any finite number. For example, 0.5 puts a Layer before default proportional cover, 1 puts it in the same step, and 2.5 puts it between per-risk and per-event XOL. Layers at the same rank start with the same earlier-step recoveries. Each Layer then applies its own protection and input grouping.

Each step subtracts earlier Layers’ recovery at 100% (toLayer), including the unplaced share. ALL and RET XOL subtract every earlier recovery. FGR only subtracts earlier XOL recoveries, including when a rank mixes XOL and proportional Layers in the same step. Proportional Layers also subtract all earlier recoveries when ranked after another step.

An occurrence recovers the input above lowerLimit, capped at layerAmount (or upperLimit − lowerLimit when the amount is omitted or null). An unlimited Layer has no occurrence cap. A combined per-risk or per-event recovery is allocated pro rata to the Losses by the amounts the Layer sees.

For AGR, the attachment and limit apply to the running total of net inputs for the year. In Event allocation order, add each Event’s matching inputs to the total and share the increase in the Layer’s recovery across its contributing Losses pro rata. The annual terms below then apply to that increase.

At 100% of a proportional Layer, toLayer is the Loss amount seen by the Layer multiplied by the cession fraction. Surplus bands are determined within the Risk’s effective currency and line of business, as in tower drawing. SI is the Risk’s sumInsured. The surplus retention is the lowest surplus attachment, and the surplus top is the highest surplus upper limit.

Cover Cession fraction
Quota share without surplus, or facultative outside the stack (participationShare / 100) × (100 − retainedShare) / 100. Each share defaults to zero.
Surplus clamp((min(SI, upperLimit) − lowerLimit) / SI, 0, 1). The band determines the fraction. Both share fields are descriptive.
Quota share with surplus (100 − retainedShare) / 100 × min(SI, surplus retention) / SI. The surplus retention determines the covered portion. participationShare is descriptive.
Facultative stacked above surplus (SI − surplus top) / SI for an unlimited FAC when SI exceeds the surplus top. Both share fields are descriptive for this band.

With a missing SI, an unlimited FAC uses the plain facultative formula even when the Risk has surplus. The Engine warns for surplus and quota share within the surplus retention when the Risk omits SI. Those Layers recover zero for the Risk. Proportional Layers use the cession fraction without occurrence or annual terms. Supplied annual terms produce warnings, and the proportional position has limitLeft: null and zero AAD and reinstatement fields.

Events use annual capacity in order of their earliest Loss. After applying XOL attachment and limit, the Engine applies these terms to each Event in order.

  1. Event limit. For a per-risk Layer, eventLimit caps the total across covered Risks in the Event. The reduction is shared pro rata across the Event’s in-layer amounts.
  2. Annual aggregate deductible (AAD). The amounts after the Event limit erode the remaining aad. Losses share the absorption pro rata. Amounts absorbed by the AAD stay in the cedant’s net retained and use neither annual capacity nor reinstatements.
  3. Aggregate limit. The annual cap shared across Risks is the supplied aggregateLimit, or (K + 1) × limit, where K is the reinstatement count. If an Event exhausts the remaining capacity, its allocations are reduced pro rata. An unlimited Layer without an explicit cap has null for both aggregateLimit and limitLeft.
  4. Reinstatements. Paid amounts use reinstatement entries in ascending number order. Each entry reinstates up to one Layer limit. Premium is charged on the first K × limit paid.

For the amount basis, the premium Estimate for each reinstated amount is rate% × premium × reinstated amount, divided by the Layer’s limit (layerAmount, else upperLimit − lowerLimit). For amount and time, multiply that Estimate by (expiry − lossDate + 1) / (expiry − inception + 1). Count calendar days inclusively, using each Loss’s own date. The Engine takes inception and expiry as a pair. It uses the complete Contract pair first, then the complete Program pair. With neither pair, it warns once per Layer and charges on amount only. For a Loss outside the period, it warns and clamps the time fraction to 1 before inception or 0 after expiry. The Loss date does not change its recovery. The Engine uses the Layer’s supplied premium, or zero with a warning when reinstatements are supplied without a premium. The Engine calculates the premium Estimate at 100% of the Layer in both viewpoints.

Each after position uses Event allocation order. Within each Event, Losses advance the position in date order, with equal dates keeping request order. The response lists Losses in request order.

The ceded amount is toLayer × placedOfWhole / 100. The share of whole matches the width drawn by /towers. A Layer without Lines cedes at its Order. With Lines, the Engine uses firm Signed shares at default precision or Written shares when signing is unavailable, capped at the Order. The Engine also uses this placed share for the ceded reinstatement premium Estimate. Each Layer’s retained amount is toLayer − ceded. A Loss’s net retained amount is gross less all ceded amounts. It includes the part outside cover.

Send your booked state so the Engine computes on top of it without contradicting figures you have already booked, and use the output only as an Estimate, never for booking.

To continue from a booked position, send the Losses that follow it and identify each Layer by its contractRef and layerRef. Duplicate positions for the same pair return HTTP 400. Unknown pairs and positions for proportional Layers warn and are ignored.

The remaining AAD starts at max(0, aad − aadUsed). The annual capacity starts at limitRemaining, capped at the effective aggregateLimit. The Engine warns when aadUsed or limitRemaining exceeds the corresponding Layer term.

The Engine subtracts the capped remaining capacity from the effective aggregate limit to derive paid-to-date. That determines which reinstatement entries have started and how far premium pricing has progressed in the current entry. If the derived count and the supplied count differ, the Engine warns and uses the remaining limit. An uncapped Layer keeps unlimited annual capacity and warns that paid-to-date starts at zero.

The after positions advance from the opening state. The Layer year recovery and reinstatement premium Estimates total only the submitted Losses. The premium Estimates in after start at zero and accumulate through that position. The Engine never adds back booked history.

For AGR Layers, the Engine applies the supplied AAD used and limit remaining. The request has no running subject total, so aggregate retention restarts from zero and the response reports a limitation. Event limits reset at each Event.

Split the year at an Event boundary. For each capped XOL Layer, take the final after in Event allocation order. Send aad − after.aadLeft as aadUsed, after.reinstatementsUsed as the count, and after.limitLeft as limitRemaining with the remaining Events.

This example uses two Events with the Loss amounts from the worked example below and adds an AAD and annual cap. The first Event erodes the AAD and consumes some capacity. The resumed run starts from that position and uses the rest of the capacity. Amounts are in millions.

Run Recovery Estimate at 100% AAD left Limit left
First Event 10.34 0.00 9.66
Second Event with opening position 9.66 0.00 0.00

The Engine calculates toLayer, including inuring, Event allocation, annual terms and opening positions, at 100% of the Layer in both viewpoints. In the reinsurer viewpoint, each Loss Layer and Layer year has an ourShare Estimate of toLayer × ourShareOfWhole / 100, using the same share that /towers draws and /placements reports. The Engine also applies that share to the 100% reinstatement premium Estimate. The Recovery and XOL premium share Estimates are null without an Order and zero when the Order is known and the Layer has none of Our Lines. Proportional Layers report zero premium at 100% and in the active viewpoint. The other viewpoint’s premium fields are null.

Risk and Program totals sum the Layer ourShare Estimates by effective Layer currency and skip null amounts. Gross Losses stay in their supplied currency. The Engine returns null cedant totals and one viewpoint-cedant-totals-unavailable limitation.

Set splitByLine: true to include LayerYear.byLine, a split of recovery amounts. In the whole viewpoint, the list has one { reinsurer, amount } entry per drawn firm order or signed Line. Each amount is a ceded Estimate based on the Line’s signed share of whole, or its written share of whole when signed share is unavailable. The Engine divides the Line share by the sum of all drawn Line shares and multiplies by the Layer’s ceded amount. The last Line takes the rounding remainder so the Estimates sum to the ceded total.

Indication, quoted and declined Lines are excluded. A Layer drawn at Order because it has no Lines or because the Lines overflow the Order returns byLine: [] and a split-by-line-no-lines limitation. If every Line is non-firm, the ceded Estimate is zero and the Engine returns byLine: [] without a limitation. When the flag is absent or false, the response omits byLine.

In the reinsurer viewpoint, the split lists Our drawn Lines, including matching indication and quoted Lines with nonzero shares. Each amount is toLayer × lineShareOfWhole / 100. The Engine uses the last Line to reconcile any rounding drift above 1e-9. A Layer with no drawable shares returns an empty list.

Field Type Meaning
estimate true All money figures are Estimates.
losses LossRecovery[] Loss results in request order.
layers LayerYear[] Results for supported Layers over the submitted Losses, in Program Contract and Layer order.
risks RiskRecovery[] Totals for each Risk.
program RecoveryTotals Totals for the Program.
warnings, limitations Issue[] Each Issue has a string code, string message and optional string path.
Field Type Meaning
lossId, riskId string Caller references.
eventId string or null Caller Event reference, if supplied.
layers LossLayer[] Applicable supported Layers and their positions after the Loss.
gross number Gross Loss amount.
recovered number or null Sum of ceded amounts in the whole viewpoint.
netRetained number or null Gross less recovered in the whole viewpoint.
Field Type Appears in Meaning
contractRef string Both Contract reference.
layerRef string or null Both Layer reference, if supplied.
toLayer number Both Recovery at 100% of the Layer.
ceded, retained number or null Both Placed and unplaced portions of toLayer. Both are null in the reinsurer viewpoint.
ourShare number or null Both Our share Estimate in the reinsurer viewpoint. Null in the whole viewpoint or when Order is missing.
after LayerPosition LossLayer Cumulative position after the Loss in Event allocation order.
aggregateLimit number or null LayerYear Effective annual limit.
reinstatementPremium number LayerYear Total reinstatement premium Estimate at 100% of the Layer for the submitted Losses.
reinstatementPremiumCeded number or null LayerYear Total reinstatement premium Estimate at the placed share in the whole viewpoint. Null in the reinsurer viewpoint.
reinstatementPremiumOurShare number or null LayerYear Total reinstatement premium Estimate at Our share of whole in the reinsurer viewpoint. Null in the whole viewpoint or for XOL without an Order. Zero with an Order and none of Our Lines, and zero for proportional Layers.
byLine LineRecovery[] LayerYear Optional list of drawn Lines and their recovery Estimates.
Field Type Meaning
reinsurer string Reinsurer on the drawn Line.
amount number Recovery Estimate for this Line over the submitted Losses.
Field Type Meaning
limitLeft number or null Annual limit less cumulative recovery at 100%. Null for unlimited annual capacity.
aadLeft number Remaining annual aggregate deductible after this Loss’s share of AAD absorption.
reinstatementsUsed number Count of entries whose capacity has started to be used. For example, reinstating 75 of a 150 limit starts one entry.
reinstatementPremiumDue number Cumulative reinstatement premium Estimate at 100% of the Layer for the submitted Losses through this position.
reinstatementPremiumDueCeded number or null Cumulative reinstatement premium Estimate at the placed share in the whole viewpoint. Null in the reinsurer viewpoint.
reinstatementPremiumDueOurShare number or null Cumulative reinstatement premium Estimate at Our share of whole in the reinsurer viewpoint. Null in the whole viewpoint or for XOL without an Order. Zero with an Order and none of Our Lines, and zero for proportional Layers.
Field Type Meaning
riskId string Risk reference on RiskRecovery only.
gross Money[] Gross totals by Loss currency. Each Money has currency (string) and amount (number).
recovered, netRetained Money[] or null Cedant totals per currency in the whole viewpoint.
ourShare Money[] Our share Estimates by effective Layer currency. Present in the reinsurer viewpoint.

A currency-mismatch warning points to the Loss currency and identifies the Layer in the message. That Layer recovers zero from the Loss. A losses-out-of-order warning indicates the Engine sorted the Losses by date before Event allocation. If a Loss’s estimated recovery exceeds gross, recovery-exceeds-loss points to the Loss and the Engine returns the full Estimate. Signing and overflow warnings in the whole viewpoint use the same codes as tower drawing. The reinsurer viewpoint uses the shared viewpoint warnings.

Warning When it appears
sum-insured-missing A proportional Layer needs SI to calculate its cession. The path points to the Risk’s sumInsured.
proportional-term-ignored A proportional Layer supplies aad, aggregateLimit, eventLimit or reinstatements. The path points to the ignored field. The core Event limit validation still applies.
loss-outside-period The Engine prices a time-basis reinstatement for a Loss dated before inception or after expiry. The path points to the Loss date.
reinstatement-period-missing An amount-and-time reinstatement has no complete Contract or Program period. The path points to a time-basis entry, once per Layer.
reinstatement-premium-missing The Layer supplies reinstatements without premium. The path points to the missing field.
opening-position-unknown-layer The Contract and Layer pair is unknown. The path points to the ignored opening position.
opening-position-proportional The opening position names a proportional Layer. The path points to the ignored position.
opening-position-aad-exceeded aadUsed exceeds the Layer AAD.
opening-position-limit-exceeded limitRemaining exceeds the effective aggregate limit.
opening-position-uncapped The Layer has unlimited annual capacity and paid-to-date starts at zero.
opening-position-inconsistent On a Layer with an annual cap, reinstatementsUsed differs from the count implied by the remaining limit.
Limitation When it appears
opening-position-agr-running-total An AGR Layer has an opening position. The aggregate retention restarts for the submitted Losses.
split-by-line-no-lines The split was requested and the Layer draws at Order without individual Lines. The path identifies the Layer.
viewpoint-cedant-totals-unavailable The request uses the reinsurer viewpoint. Reported once at viewpoint for the null cedant totals.
signing-unavailable Firm To stand Lines exceed the Order. The calculation uses the Order for the ceded share, matching the tower width.

Two Risks share a fully placed 45 xs 5 per-event Layer. Losses of 8.34 and 12 in the same Event produce an estimated 15.34 recovery, shared in proportion to each Loss. Figures are in millions. The example sets an explicit annual limit of 90. Swiss Re, Proportional and non-proportional reinsurance, Examples 8.1–8.4, pp. 22–23.

recoveries-request.json
{
"program": {
"contracts": [
{
"contractRef": "shared-xl",
"currency": "USD",
"layers": [
{
"layerRef": "45-xs-5",
"layerName": "45 xs 5",
"layerType": "XOL",
"accumulateBasis": "EVT",
"lowerLimit": 5,
"upperLimit": 50,
"isUnlimited": false,
"aggregateLimit": 90,
"lines": [
{
"reinsurer": "Example Re",
"status": "firm order",
"writtenShare": 100
}
]
}
]
}
],
"risks": [
{
"riskId": "X",
"contractRefs": [
"shared-xl"
]
},
{
"riskId": "Y",
"contractRefs": [
"shared-xl"
]
}
]
},
"losses": [
{
"lossId": "loss-x",
"riskId": "X",
"date": "2026-05-01",
"amount": 8.34,
"currency": "USD",
"eventId": "event-1"
},
{
"lossId": "loss-y",
"riskId": "Y",
"date": "2026-05-01",
"amount": 12,
"currency": "USD",
"eventId": "event-1"
}
]
}
recoveries-response.json
{
"estimate": true,
"losses": [
{
"lossId": "loss-x",
"riskId": "X",
"eventId": "event-1",
"layers": [
{
"contractRef": "shared-xl",
"layerRef": "45-xs-5",
"toLayer": 6.289852507374631,
"ceded": 6.289852507374631,
"retained": 0,
"ourShare": null,
"after": {
"limitLeft": 83.71014749262537,
"aadLeft": 0,
"reinstatementsUsed": 0,
"reinstatementPremiumDue": 0,
"reinstatementPremiumDueCeded": 0,
"reinstatementPremiumDueOurShare": null
}
}
],
"gross": 8.34,
"recovered": 6.289852507374631,
"netRetained": 2.050147492625369
},
{
"lossId": "loss-y",
"riskId": "Y",
"eventId": "event-1",
"layers": [
{
"contractRef": "shared-xl",
"layerRef": "45-xs-5",
"toLayer": 9.050147492625369,
"ceded": 9.050147492625369,
"retained": 0,
"ourShare": null,
"after": {
"limitLeft": 74.66,
"aadLeft": 0,
"reinstatementsUsed": 0,
"reinstatementPremiumDue": 0,
"reinstatementPremiumDueCeded": 0,
"reinstatementPremiumDueOurShare": null
}
}
],
"gross": 12,
"recovered": 9.050147492625369,
"netRetained": 2.949852507374631
}
],
"layers": [
{
"contractRef": "shared-xl",
"layerRef": "45-xs-5",
"toLayer": 15.34,
"ceded": 15.34,
"retained": 0,
"ourShare": null,
"aggregateLimit": 90,
"reinstatementPremium": 0,
"reinstatementPremiumCeded": 0,
"reinstatementPremiumOurShare": null
}
],
"risks": [
{
"riskId": "X",
"gross": [
{
"currency": "USD",
"amount": 8.34
}
],
"recovered": [
{
"currency": "USD",
"amount": 6.289852507374631
}
],
"netRetained": [
{
"currency": "USD",
"amount": 2.050147492625369
}
]
},
{
"riskId": "Y",
"gross": [
{
"currency": "USD",
"amount": 12
}
],
"recovered": [
{
"currency": "USD",
"amount": 9.050147492625369
}
],
"netRetained": [
{
"currency": "USD",
"amount": 2.949852507374631
}
]
}
],
"program": {
"gross": [
{
"currency": "USD",
"amount": 20.34
}
],
"recovered": [
{
"currency": "USD",
"amount": 15.34
}
],
"netRetained": [
{
"currency": "USD",
"amount": 5
}
]
},
"warnings": [],
"limitations": []
}

Set viewpoint to { "kind": "reinsurer", "reinsurer": "Example Re" }, give the Layer an explicit order: 100, and set Example Re’s signedShare to 25. The excerpt shows the 100% and Our share Estimates in USD millions. Cedant totals are null.

recoveries-reinsurer-figures.json
{
"losses": [
{
"lossId": "loss-x",
"toLayer": 6.289852507374631,
"ourShare": 1.5724631268436577
},
{
"lossId": "loss-y",
"toLayer": 9.050147492625369,
"ourShare": 2.262536873156342
}
],
"layerYear": {
"toLayer": 15.34,
"ourShare": 3.835
},
"program": {
"gross": [
{
"currency": "USD",
"amount": 20.34
}
],
"recovered": null,
"netRetained": null,
"ourShare": [
{
"currency": "USD",
"amount": 3.835
}
]
}
}

Worked example with surplus, working XL and cat XL

Section titled “Worked example with surplus, working XL and cat XL”

Four Risks share a surplus Layer of 700 xs 50, a per-risk XL Layer of 45 xs 5 and a catastrophe XL Layer of 42.5 xs 7.5. Each Layer is fully placed. All four Losses belong to the same Event. The Engine uses unrounded inputs. Swiss Re, Proportional and non-proportional reinsurance, Example 9, p. 24.

Recovery Estimates (millions)

Risk Sum insured Gross Surplus After surplus Working XL After working XL Cat XL Net retained
X 120 20.0000 11.6667 8.3333 3.3333 5.0000 1.8944 3.1056
Y 40 12.0000 0.0000 12.0000 7.0000 5.0000 1.8944 3.1056
U 10 0.2000 0.0000 0.2000 0.0000 0.2000 0.0758 0.1242
V 80 3.0000 1.1250 1.8750 0.0000 1.8750 0.7104 1.1646
Total — 35.2000 12.7917 22.4083 10.3333 12.0750 4.5750 7.5000

This abridged response shows annual Estimates for Cat XL 1, Cat XL 3, Aggregate XL, whole-account clash XL and the Program after replaying the 2026 Losses.

Download the Northshore request.

recoveries-northshore-response.json
{
"estimate": true,
"layers": [
{
"contractRef": "NSM-CAT",
"layerRef": "NSM-CAT-01",
"toLayer": 20000000,
"ceded": 20000000,
"retained": 0,
"reinstatementPremium": 1271232.8767123288,
"reinstatementPremiumCeded": 1271232.8767123288
},
{
"contractRef": "NSM-CAT",
"layerRef": "NSM-CAT-03",
"toLayer": 47500000,
"ceded": 14250000,
"retained": 33250000,
"reinstatementPremium": 2660000,
"reinstatementPremiumCeded": 798000
},
{
"contractRef": "NSM-AGG",
"layerRef": "NSM-AGG-01",
"toLayer": 2780000,
"ceded": 972999.9999999999,
"retained": 1807000,
"reinstatementPremium": 0,
"reinstatementPremiumCeded": 0
},
{
"contractRef": "NSM-CLASH",
"layerRef": "NSM-CLASH-01",
"toLayer": 6050000,
"ceded": 6050000,
"retained": 0,
"reinstatementPremium": 0,
"reinstatementPremiumCeded": 0
}
],
"program": {
"gross": [
{
"currency": "USD",
"amount": 288900000
}
],
"recovered": [
{
"currency": "USD",
"amount": 199393000
}
],
"netRetained": [
{
"currency": "USD",
"amount": 89507000
}
]
}
}