{"openapi":"3.1.0","info":{"title":"assurs.ch — LAMal calculation and offer requests","version":"1.0.0","description":"The same 2027 OFSP calculation engine as assurs.ch. Calculate without contact data, display the returned criteria and prices, then ask for explicit client confirmation before submitting an offer request to Swiss Premium Insurance. This API does not conclude insurance contracts or email quotes to clients. An assistant needs an HTTP tool / configured integration to call these operations; public discovery alone does not grant tools."},"servers":[{"url":"https://api.assurs.ch/api/lamal/v1"}],"security":[],"paths":{"/places":{"get":{"x-openai-isConsequential":false,"x-mcp-annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"operationId":"resolveMunicipalities","summary":"Resolve a Swiss postcode before calculating.","parameters":[{"name":"postcode","in":"query","required":true,"schema":{"type":"string","pattern":"^[0-9]{4}$"}}],"responses":{"200":{"description":"Possible communes and whether a choice is needed. Empty locations means an unknown postcode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MunicipalityLookup"}}}},"400":{"$ref":"#/components/responses/LegacyBadRequest"},"413":{"$ref":"#/components/responses/LegacyPayloadTooLarge"},"415":{"$ref":"#/components/responses/LegacyUnsupportedMediaType"},"429":{"$ref":"#/components/responses/LegacyTooManyRequests"},"500":{"$ref":"#/components/responses/LegacyServerError"}}}},"/compare":{"post":{"x-openai-isConsequential":false,"x-mcp-annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"operationId":"calculateHousehold","summary":"Calculate up to ten offers with the website’s engine.","description":"Require tariff year, birth year, postcode, exact deductible, accident choice and care type; never guess. Resolve ambiguous communes first. No contact details or consent needed to calculate. Amounts are integer CHF centimes; net already deducts the environmental credit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComparisonRequest"},"example":{"year":2027,"members":[{"birthYear":1988,"postcode":"1955","bfs":"6022","franchise":2500,"accident":"OHN","careType":"TEL_DIG"}]}}}},"responses":{"200":{"description":"Calculated offers with verification data and a 24-hour submission token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HouseholdComparison"}}}},"400":{"$ref":"#/components/responses/LegacyBadRequest"},"413":{"$ref":"#/components/responses/LegacyPayloadTooLarge"},"415":{"$ref":"#/components/responses/LegacyUnsupportedMediaType"},"429":{"$ref":"#/components/responses/LegacyTooManyRequests"},"500":{"$ref":"#/components/responses/LegacyServerError"}}},"get":{"x-openai-isConsequential":false,"x-mcp-annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"operationId":"calculateIndividual","summary":"Calculate one person via an ordinary HTTP GET.","description":"Prefer POST for a household or to keep criteria out of URL/access logs. Same explicit criteria and results as POST.","parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","const":2027}},{"name":"birthYear","in":"query","required":true,"schema":{"type":"integer","minimum":1907,"maximum":2027}},{"name":"postcode","in":"query","required":true,"schema":{"type":"string","pattern":"^[0-9]{4}$"}},{"name":"bfs","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]{1,6}$","description":"Commune OFS, obligatoire uniquement si le NPA couvre des régions ou des modèles disponibles différents. Vérifier requiresCommune dans places(postcode)."}},{"name":"franchise","in":"query","required":true,"schema":{"type":"integer","enum":[0,100,200,300,400,500,600,1000,1500,2000,2500]}},{"name":"accident","in":"query","required":true,"schema":{"type":"string","enum":["MIT","OHN"],"description":"MIT : inclus ; OHN : exclu. Ne pas déduire ce choix de l’âge ou de la profession."}},{"name":"careType","in":"query","required":true,"schema":{"type":"string","enum":["any","BASE","PRAXIS","FLEX","TEL_DIG","PHARM"]}},{"name":"currentProduct","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]+\\|[^|]+$","maxLength":100,"description":"Clé renvoyée par searchReferences ; facultative."}},{"name":"currentPremium","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]{1,5}([.,][0-9]{1,2})?$","description":"CHF par mois, base seule, nette de redistribution, avant subsides. Remplace la référence calculée."}}],"responses":{"200":{"description":"Calculated individual offers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HouseholdComparison"}}}},"400":{"$ref":"#/components/responses/LegacyBadRequest"},"413":{"$ref":"#/components/responses/LegacyPayloadTooLarge"},"415":{"$ref":"#/components/responses/LegacyUnsupportedMediaType"},"429":{"$ref":"#/components/responses/LegacyTooManyRequests"},"500":{"$ref":"#/components/responses/LegacyServerError"}}}},"/offer-requests/test":{"post":{"x-openai-isConsequential":false,"x-mcp-annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"operationId":"testOfferRequestLegacy","summary":"Legacy camelCase test; prefer POST /api/v1/lamal/offer-requests/test. Never sends email.","security":[],"description":"Safe test with synthetic contact details and a real calculation token. No email, DNS contact validation, stored lead, entitlement or payment. Test remains available when real contact sending is disabled. A test reference is not a receipt for a real request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferRequest"}}}},"responses":{"200":{"description":"Validated only; no email sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTestReceipt"}}}},"400":{"$ref":"#/components/responses/LegacyBadRequest"},"409":{"$ref":"#/components/responses/LegacyConflict"},"413":{"$ref":"#/components/responses/LegacyPayloadTooLarge"},"415":{"$ref":"#/components/responses/LegacyUnsupportedMediaType"},"429":{"$ref":"#/components/responses/LegacyTooManyRequests"},"500":{"$ref":"#/components/responses/LegacyServerError"}}}},"/offer-requests":{"post":{"operationId":"submitOfferRequestLegacy","summary":"Legacy camelCase send; prefer POST /api/v1/lamal/offer-requests. Sends an email to SPI.","x-openai-isConsequential":true,"x-mcp-annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"security":[{},{"agentIntegrationKey":[]}],"description":"SEND ONLY AFTER EXPLICIT CLIENT CONFIRMATION of the selected offer, exact criteria, contact details and destination contact@sp-insurance.ch. Reuse the calculation token; one RFC 4122 requestId kept for every retry. Emails SPI only; accepted means provider acceptance, not inbox delivery or a quote.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferRequest"}}}},"responses":{"200":{"description":"Provider accepted this request; SPI will follow up. Repeated identical requestId is deduplicated for 24 hours within a running service and by the email provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyReceipt"}}}},"400":{"$ref":"#/components/responses/LegacyBadRequest"},"401":{"$ref":"#/components/responses/LegacyUnauthorized"},"409":{"$ref":"#/components/responses/LegacyConflict"},"413":{"$ref":"#/components/responses/LegacyPayloadTooLarge"},"415":{"$ref":"#/components/responses/LegacyUnsupportedMediaType"},"429":{"$ref":"#/components/responses/LegacyTooManyRequests"},"500":{"$ref":"#/components/responses/LegacyServerError"},"502":{"$ref":"#/components/responses/LegacyBadGateway"},"503":{"$ref":"#/components/responses/LegacyServiceUnavailable"}}}}},"components":{"securitySchemes":{"agentIntegrationKey":{"type":"http","scheme":"bearer","description":"Optional integration attribution in public mode; mandatory only in registered-only deployments. Never place in shared links or conversation prompts. Model identity remains self-declared."}},"schemas":{"ComparisonRequest":{"title":"SPI — comparaison LAMal 2027","type":"object","additionalProperties":false,"required":["year","members"],"properties":{"year":{"type":"integer","const":2027},"members":{"type":"array","minItems":1,"maxItems":12,"items":{"type":"object","additionalProperties":false,"required":["birthYear","postcode","franchise","accident","careType"],"properties":{"birthYear":{"type":"integer","minimum":1907,"maximum":2027},"postcode":{"type":"string","pattern":"^[0-9]{4}$"},"bfs":{"type":"string","pattern":"^[0-9]{1,6}$","description":"Commune OFS, obligatoire uniquement si le NPA couvre des régions ou des modèles disponibles différents. Vérifier requiresCommune dans places(postcode)."},"franchise":{"type":"integer","enum":[0,100,200,300,400,500,600,1000,1500,2000,2500]},"accident":{"type":"string","enum":["MIT","OHN"],"description":"MIT : inclus ; OHN : exclu. Ne pas déduire ce choix de l’âge ou de la profession."},"careType":{"type":"string","enum":["any","BASE","PRAXIS","FLEX","TEL_DIG","PHARM"]},"currentProduct":{"type":"string","pattern":"^[0-9]+\\|[^|]+$","maxLength":100,"description":"Clé renvoyée par searchReferences ; facultative."},"currentPremium":{"type":"string","pattern":"^[0-9]{1,5}([.,][0-9]{1,2})?$","description":"CHF par mois, base seule, nette de redistribution, avant subsides. Remplace la référence calculée."}}}}}},"Contact":{"type":"object","additionalProperties":false,"anyOf":[{"required":["email"]},{"required":["phone"]}],"description":"At least one valid contact method. Omit unknown fields; never invent a client name, email or phone.","properties":{"name":{"type":"string","minLength":0,"maxLength":120},"email":{"type":"string","minLength":3,"maxLength":160,"format":"email"},"phone":{"type":"string","minLength":8,"maxLength":30,"description":"Client telephone, 8–15 digits; optional spaces and + country code."},"message":{"type":"string","minLength":0,"maxLength":1500}}},"OfferRequest":{"type":"object","additionalProperties":false,"required":["requestId","comparison","comparisonToken","insurerId","language","contact","clientConsent"],"properties":{"requestId":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$","description":"Any RFC 4122 UUID (versions 1-8); reuse submission.request_id from the v2 quote, or generate one once per client-approved request. Reuse the same UUID and payload on retries; never generate a fresh ID after a timeout."},"comparison":{"$ref":"#/components/schemas/ComparisonRequest"},"comparisonToken":{"type":"string","minLength":1,"maxLength":1000,"description":"Copy submission.comparisonToken from a successful calculation. Valid 24 hours; bound to these exact criteria, prices and catalogue; survives restarts."},"insurerId":{"type":"integer","description":"insurerId of the offer explicitly selected by the client from the returned comparison."},"language":{"type":"string","enum":["fr","de","it","en","es","pt","zh"]},"contact":{"$ref":"#/components/schemas/Contact"},"clientConsent":{"type":"boolean","const":true,"description":"Only true after the client has explicitly confirmed sending their contact details, household criteria and selected offer to Swiss Premium Insurance for follow-up. Do not infer consent from a calculation request."},"subsidyRequested":{"type":"boolean","default":false},"agent":{"type":"string","enum":["chatgpt","claude","gemini","other"],"description":"Legacy self-declared name. Prefer agentContext for Muse, Codex, Claude Code and custom agents."},"agentContext":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9_ -]{1,40}$","description":"Agent name, lower-cased by the server (spaces become _; a literal <placeholder> counts as other). Known names: chatgpt, claude, gemini, grok, openclaw, muse, codex, claude_code, copilot, perplexity, mistral, coding_agent, other; any other short identifier is accepted."},"kind":{"type":"string","enum":["personal_assistant","conversational_assistant","coding_agent"],"description":"Optional. Accepted values: personal_assistant, conversational_assistant, coding_agent (personal_agent and chat_assistant are read as personal_assistant and conversational_assistant)."},"display_name":{"type":"string","minLength":1,"maxLength":80,"description":"Optional custom agent name, no client name or conversation content."},"displayName":{"type":"string","minLength":1,"maxLength":80,"description":"Optional custom agent name, no client name or conversation content."},"integration_id":{"type":"string","pattern":"^[a-zA-Z0-9._-]{1,80}$","description":"Self-declared integration identifier, NOT authentication."},"integrationId":{"type":"string","pattern":"^[a-zA-Z0-9._-]{1,80}$","description":"Self-declared integration identifier, NOT authentication."},"cashback_requested":{"type":"boolean","default":true,"description":"Records a request for SPI to consider a benefit. Not a claim, eligibility, approval, amount or payment promise. Does not change prices or ranking."},"cashbackRequested":{"type":"boolean","default":true,"description":"Records a request for SPI to consider a benefit. Not a claim, eligibility, approval, amount or payment promise. Does not change prices or ranking."}}}}},"LegacyError":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","const":false},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"choices":{"type":"array","items":{"type":"object"}}}}}}},"HouseholdComparison":{"type":"object","required":["ok","tariffYear","currency","amountUnit","offers","verification","submission"],"properties":{"ok":{"type":"boolean","const":true},"tariffYear":{"type":"integer"},"currency":{"type":"string","const":"CHF"},"amountUnit":{"type":"string","const":"centime"},"redistributionMonthlyCentsPerPerson":{"type":"integer","description":"Integer CHF centimes; divide by 100 for CHF."},"eligibleInsurerCount":{"type":"integer"},"knownReferenceCount":{"type":"integer"},"referenceMonthlyCents":{"type":["integer","null"],"description":"Integer CHF centimes; divide by 100 for CHF."},"offers":{"type":"array","maxItems":10,"items":{"type":"object","required":["rank","insurerId","insurerName","monthlyCents","annualCents","people"],"properties":{"rank":{"type":"integer"},"insurerId":{"type":"integer"},"insurerName":{"type":"string"},"monthlyCents":{"type":"integer","description":"Integer CHF centimes; divide by 100 for CHF."},"annualCents":{"type":"integer","description":"Integer CHF centimes; divide by 100 for CHF."},"monthlySavingCents":{"type":["integer","null"],"description":"Integer CHF centimes; divide by 100 for CHF."},"annualSavingCents":{"type":["integer","null"],"description":"Integer CHF centimes; divide by 100 for CHF."},"people":{"type":"array","items":{"type":"object","required":["memberIndex","productKey","monthlyGrossCents","monthlyNetCents"],"properties":{"memberIndex":{"type":"integer"},"productKey":{"type":"string"},"modelName":{"type":"string"},"careType":{"type":"string"},"careTypeLabel":{"type":"string"},"monthlyGrossCents":{"type":"integer","description":"Integer CHF centimes; divide by 100 for CHF."},"monthlyNetCents":{"type":"integer","description":"Integer CHF centimes; divide by 100 for CHF."},"referenceMonthlyCents":{"type":["integer","null"],"description":"Integer CHF centimes; divide by 100 for CHF."},"referenceKind":{"type":["string","null"]},"monthlySavingCents":{"type":["integer","null"],"description":"Integer CHF centimes; divide by 100 for CHF."}}}}}}},"limitations":{"type":"array","items":{"type":"string"}},"sources":{"type":"object"},"verification":{"type":"object","description":"Exact criteria, per-member OFSP lookup keys, source URLs and SHA-256 fingerprints, catalogue/module hashes and independent Python verifier.","properties":{"criteria":{"$ref":"#/components/schemas/ComparisonRequest"},"revision":{"type":"string"},"manifestUrl":{"type":"string"},"hashes":{"type":"object"},"sourceFiles":{"type":"array","items":{"type":"object"}},"members":{"type":"array","items":{"type":"object"}},"verifierUrl":{"type":"string"},"instructions":{"type":"string"}}},"submission":{"type":"object","required":["endpoint","comparisonToken","expiresAt","clientConsentRequired"],"properties":{"endpoint":{"type":"string"},"comparisonToken":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"clientConsentRequired":{"type":"boolean","const":true}}}}},"MunicipalityLookup":{"type":"object","properties":{"ok":{"type":"boolean"},"requiresCommune":{"type":"boolean"},"locations":{"type":"array","items":{"type":"object","properties":{"bfs":{"type":"string"},"commune":{"type":"string"},"canton":{"type":"string"},"region":{"type":"string"},"locality":{"type":"string"}}}}}},"LegacyTestReceipt":{"type":"object","properties":{"ok":{"const":true},"status":{"const":"validated_test"},"requestId":{"type":"string","format":"uuid"},"testMode":{"const":true},"emailSent":{"const":false},"paymentCreated":{"const":false}}},"LegacyReceipt":{"type":"object","required":["ok","status","requestId","recipient","message","acceptedAt","followUpBy","expectedContactChannel","correctionOrCancellation"],"properties":{"ok":{"type":"boolean","const":true},"status":{"type":"string","const":"accepted"},"requestId":{"type":"string","format":"uuid"},"recipient":{"type":"string","const":"contact@sp-insurance.ch"},"message":{"type":"string"},"acceptedAt":{"type":"string","format":"date-time"},"followUpBy":{"const":"Swiss Premium Insurance"},"expectedContactChannel":{"const":"email_or_phone"},"correctionOrCancellation":{"type":"string","format":"uri"}}}},"responses":{"LegacyBadRequest":{"description":"Malformed JSON, invalid criteria, unresolved commune, missing client consent or invalid contact. No email sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}}},"LegacyPayloadTooLarge":{"description":"Request body exceeds 24,000 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}}},"LegacyUnsupportedMediaType":{"description":"Use Content-Type: application/json.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}}},"LegacyTooManyRequests":{"description":"Rate limit reached. Respect Retry-After. Calculation limits are separate from the shared contact send quota.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}},"LegacyServerError":{"description":"Calculation temporarily unavailable; do not invent prices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}}},"LegacyConflict":{"description":"comparison_refresh_required: recalculate and obtain confirmation again if the selected offer changes; keep the original requestId for an unchanged retry. request_conflict: the same requestId has different content; do not silently resubmit with a new ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}}},"LegacyUnauthorized":{"description":"Invalid supplied Bearer key, or deployment configured for registered integrations only. Public mode requires no API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}}},"LegacyServiceUnavailable":{"description":"Agent submissions or email delivery disabled by the operator. Comparison remains available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}}},"LegacyBadGateway":{"description":"Delivery unconfirmed. Retry the same requestId and payload; do not claim success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"}}}}}}}
