{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Alpha Multi-Currency Accounting API","version":"1.0.0","summary":"Premium, receipt, claim, statement and close accounting in FCY and ZAR.","description":"Decimal-safe, audited premium and claims accounting in foreign currency and rand.\n\n**Authentication.** Other systems use an API key (`Authorization: Bearer alpha_live_…` or `X-Api-Key: alpha_live_…`) or a Microsoft Entra access token for `api://<client id>/.default` (client credentials). An administrator registers each system on Administration → API clients and chooses what it may do. Keys and applications can prepare and read, but never approve, close a period, manage banks, users or keys, or use the Microsoft 365 endpoints.\n\n**Idempotency.** Every write needs an `Idempotency-Key` header (any unique string up to 200 characters). Sending the same key with the same body returns the first answer with `idempotencyReplayed: true` and creates nothing new; the same key with a different body is refused with 409 `IDEMPOTENCY_PAYLOAD_CONFLICT`.\n\n**Responses.** Success: `{ \"ok\": true, \"data\": …, \"correlationId\": \"…\" }`. Failure: `{ \"ok\": false, \"error\": { \"code\", \"message\", \"violations\": [{ \"fieldPath\", \"ruleCode\", \"message\" }] }, \"correlationId\" }`. Quote the correlation ID when asking for support. Money and rates are decimal strings, never numbers.\n\n**Paging.** Lists take `page` (from 1) and `pageSize` (1 to 100, default 25) and return `pagination: { page, pageSize, total, pages }`.\n\n**Rate limits.** Each API key and each client application may make 120 requests a minute unless an administrator sets another limit. Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (seconds). Over the limit the answer is 429 `RATE_LIMITED` with `Retry-After` in seconds."},"servers":[{"url":"https://alpha-multi-currency-accounting-4ul.vercel.app","description":"This server"}],"tags":[{"name":"Identity","description":"Who is calling and what they may do."},{"name":"Policies","description":"Policies, counterparties and accounts."},{"name":"Premiums","description":"Capture, validate and post premiums."},{"name":"Receipts","description":"Bank receipts and their allocation to premium lines."},{"name":"Remuneration","description":"Broker commission, fees and remittances."},{"name":"Claims","description":"Claims, reserve movements and payments."},{"name":"Statements","description":"Premium and claims statements."},{"name":"Approvals","description":"The maker-checker inbox. People only: keys and applications never approve."},{"name":"Close","description":"Month-end close runs."},{"name":"Register and audit","description":"The live register and the audit history."},{"name":"Reference data","description":"Lookups, bank profiles and rate providers."},{"name":"Imports","description":"Excel and CSV import batches."},{"name":"Reports","description":"Management reports and search."},{"name":"Microsoft 365","description":"SharePoint and OneDrive. Signed-in people only."},{"name":"Administration","description":"API clients, keys and the access log. Signed-in administrators only."},{"name":"Specification","description":"This document."}],"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"paths":{"/v1/openapi.json":{"get":{"operationId":"getOpenapiJson","tags":["Specification"],"summary":"This OpenAPI 3.1 document","responses":{"200":{"description":"The OpenAPI document, not wrapped in the envelope.","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[],"x-permissions":[],"x-api-key-access":true}},"/v1/openapi":{"get":{"operationId":"getOpenapi","tags":["Specification"],"summary":"This OpenAPI document inside the response envelope (kept for older callers)","responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}}},"security":[],"x-permissions":[],"x-api-key-access":true}},"/v1/me":{"get":{"operationId":"getMe","tags":["Identity"],"summary":"Who is calling, their roles and permissions","description":"Works for every kind of caller. Without credentials it answers with no user rather than 401.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]},{}],"x-permissions":[],"x-api-key-access":true}},"/v1/me/tours":{"get":{"operationId":"getMeTours","tags":["Identity"],"summary":"Guided tours the signed-in person has finished","description":"Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":[],"x-api-key-access":false}},"/v1/me/tours/{key}":{"put":{"operationId":"putMeToursKey","tags":["Identity"],"summary":"Record that a guided tour was finished or dismissed","description":"Not available to API keys or client applications.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutMeToursKeyRequest"}}}},"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":[],"x-api-key-access":false},"delete":{"operationId":"deleteMeToursKey","tags":["Identity"],"summary":"Forget a guided tour's state so it shows again","description":"Repeating it is harmless: data.forgotten says whether there was anything to forget. Not available to API keys or client applications.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":[],"x-api-key-access":false}},"/v1/policies":{"get":{"operationId":"getPolicies","tags":["Policies"],"summary":"List policies","description":"Permission: register:read.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z_]{2,40}$"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"legalEntityId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},{"name":"counterpartyId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["register:read"],"x-api-key-access":true},"post":{"operationId":"postPolicies","tags":["Policies"],"summary":"Create a policy with an existing or new counterparty and account","description":"Permission: policy:manage.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostPoliciesRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["policy:manage"],"x-api-key-access":true}},"/v1/policies/{policyId}":{"get":{"operationId":"getPoliciesPolicyId","tags":["Policies"],"summary":"One policy with its premiums and claims","description":"Permission: register:read.","parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["register:read"],"x-api-key-access":true}},"/v1/policies/{policyId}/premiums":{"post":{"operationId":"postPoliciesPolicyIdPremiums","tags":["Premiums"],"summary":"Capture or validate a premium for a policy","description":"Permission: premium:prepare.","parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostPoliciesPolicyIdPremiumsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["premium:prepare"],"x-api-key-access":true}},"/v1/premiums":{"get":{"operationId":"getPremiums","tags":["Premiums"],"summary":"List premiums","description":"Permission: premium:read.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"policyId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"dateFrom","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"dateTo","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"format","in":"query","required":false,"description":"json (the default) or a file export of every matching row.","schema":{"type":"string","enum":["json","xlsx"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["premium:read"],"x-api-key-access":true}},"/v1/premiums/{premiumId}":{"get":{"operationId":"getPremiumsPremiumId","tags":["Premiums"],"summary":"One premium with rate evidence and audit timeline","description":"Permission: premium:read.","parameters":[{"name":"premiumId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["premium:read"],"x-api-key-access":true},"patch":{"operationId":"patchPremiumsPremiumId","tags":["Premiums"],"summary":"Validate, withdraw, or approve and post a premium","description":"VALIDATE and WITHDRAW need premium:prepare. APPROVE_AND_POST needs premium:approve and a different person from the preparer, so keys and applications cannot use it. Permission: premium:prepare or premium:approve.","parameters":[{"name":"premiumId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchPremiumsPremiumIdRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["premium:prepare","premium:approve"],"x-api-key-access":true}},"/v1/premium-lines/open":{"get":{"operationId":"getPremiumLinesOpen","tags":["Receipts"],"summary":"Open premium lines a receipt can be allocated to","description":"Permission: receipt:prepare or premium:read.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"policyId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"productCode","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"coverCode","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["receipt:prepare","premium:read"],"x-api-key-access":true}},"/v1/receipts":{"get":{"operationId":"getReceipts","tags":["Receipts"],"summary":"List bank receipts","description":"Permission: receipt:read.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"dateFrom","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"dateTo","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"format","in":"query","required":false,"description":"json (the default) or a file export of every matching row.","schema":{"type":"string","enum":["json","xlsx"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["receipt:read"],"x-api-key-access":true},"post":{"operationId":"postReceipts","tags":["Receipts"],"summary":"Capture a bank receipt as a draft","description":"Permission: receipt:prepare.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostReceiptsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["receipt:prepare"],"x-api-key-access":true}},"/v1/receipts/{receiptId}":{"get":{"operationId":"getReceiptsReceiptId","tags":["Receipts"],"summary":"One receipt with its allocation and audit timeline","description":"Permission: receipt:read.","parameters":[{"name":"receiptId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["receipt:read"],"x-api-key-access":true}},"/v1/receipts/{receiptId}/allocations":{"post":{"operationId":"postReceiptsReceiptIdAllocations","tags":["Receipts"],"summary":"Save, validate or post a receipt allocation","description":"SAVE_DRAFT and VALIDATE need receipt:prepare. POST needs receipt:approve, so keys and applications cannot use it. Permission: receipt:prepare or receipt:approve.","parameters":[{"name":"receiptId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostReceiptsReceiptIdAllocationsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["receipt:prepare","receipt:approve"],"x-api-key-access":true}},"/v1/remuneration":{"post":{"operationId":"postRemuneration","tags":["Remuneration"],"summary":"Record commission and fee components for a premium","description":"Permission: remuneration:prepare.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRemunerationRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["remuneration:prepare"],"x-api-key-access":true}},"/v1/remittances":{"post":{"operationId":"postRemittances","tags":["Remuneration"],"summary":"Submit a ZAR remittance and record the insurer's acceptance","description":"Permission: remittance:approve. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRemittancesRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["remittance:approve"],"x-api-key-access":false}},"/v1/claims":{"get":{"operationId":"getClaims","tags":["Claims"],"summary":"List claims","description":"Permission: claim:read.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z_]{2,40}$"}},{"name":"claimClass","in":"query","required":false,"schema":{"type":"string","enum":["LIABILITY","OTHER"]}},{"name":"policyId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"dateFrom","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"dateTo","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"format","in":"query","required":false,"description":"json (the default) or a file export of every matching row.","schema":{"type":"string","enum":["json","xlsx"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["claim:read"],"x-api-key-access":true},"post":{"operationId":"postClaims","tags":["Claims"],"summary":"Register a claim with zero balances","description":"Permission: claim:register.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostClaimsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["claim:register"],"x-api-key-access":true}},"/v1/claims/{claimId}":{"get":{"operationId":"getClaimsClaimId","tags":["Claims"],"summary":"One claim with movements, payments, rate evidence and audit timeline","description":"Permission: claim:read.","parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["claim:read"],"x-api-key-access":true}},"/v1/claims/{claimId}/movements":{"post":{"operationId":"postClaimsClaimIdMovements","tags":["Claims"],"summary":"Save, validate or post a reserve movement","description":"POST needs claim:approve, so keys and applications can only save and validate. Permission: claim:prepare or claim:approve.","parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostClaimsClaimIdMovementsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["claim:prepare","claim:approve"],"x-api-key-access":true}},"/v1/claims/{claimId}/payments":{"post":{"operationId":"postClaimsClaimIdPayments","tags":["Claims"],"summary":"Save, validate or post a claim payment","description":"POST needs claim:approve, so keys and applications can only save and validate. Permission: claim:prepare or claim:approve.","parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostClaimsClaimIdPaymentsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["claim:prepare","claim:approve"],"x-api-key-access":true}},"/v1/statements":{"get":{"operationId":"getStatements","tags":["Statements"],"summary":"List statement drafts and issued versions","description":"Permission: statement:read.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},{"name":"statementType","in":"query","required":false,"schema":{"type":"string","enum":["PREMIUM_ACCOUNT","CLAIMS_ACCOUNT"]}},{"name":"dateFrom","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"dateTo","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:read"],"x-api-key-access":true}},"/v1/statements/{statementId}":{"get":{"operationId":"getStatementsStatementId","tags":["Statements"],"summary":"One statement with its versions","description":"Permission: statement:read.","parameters":[{"name":"statementId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:read"],"x-api-key-access":true}},"/v1/accounts/{accountId}/statements":{"post":{"operationId":"postAccountsAccountIdStatements","tags":["Statements"],"summary":"Preview a statement, or issue it","description":"PREVIEW needs statement:prepare. ISSUE needs statement:approve, so keys and applications can only preview. Permission: statement:prepare or statement:approve.","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostAccountsAccountIdStatementsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:prepare","statement:approve"],"x-api-key-access":true}},"/v1/statements/{statementId}/submit":{"post":{"operationId":"postStatementsStatementIdSubmit","tags":["Statements"],"summary":"Submit a previewed statement for approval","description":"Permission: statement:prepare.","parameters":[{"name":"statementId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostStatementsStatementIdSubmitRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:prepare"],"x-api-key-access":true}},"/v1/statements/{statementId}/withdraw":{"post":{"operationId":"postStatementsStatementIdWithdraw","tags":["Statements"],"summary":"Withdraw a submitted statement back to draft","description":"Permission: statement:prepare.","parameters":[{"name":"statementId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostStatementsStatementIdWithdrawRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:prepare"],"x-api-key-access":true}},"/v1/statements/{statementId}/versions/{version}/document":{"get":{"operationId":"getStatementsStatementIdVersionsVersionDocument","tags":["Statements"],"summary":"Download an issued statement PDF","description":"Permission: statement:read.","parameters":[{"name":"statementId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"version","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"The PDF, checked against its stored SHA-256.","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/X-Correlation-Id"}},"content":{"application/pdf":{"schema":{"type":"string","contentMediaType":"application/pdf"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:read"],"x-api-key-access":true}},"/v1/approvals":{"get":{"operationId":"getApprovals","tags":["Approvals"],"summary":"Items waiting for approval that the caller may see","description":"Permission: approvals:read.","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["premium","receipt","claim-movement","claim-payment","statement","close-run"]}},{"name":"mine","in":"query","required":false,"schema":{"type":"string","enum":["0","1","true","false"]}},{"name":"actionable","in":"query","required":false,"schema":{"type":"string","enum":["0","1","true","false"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["approvals:read"],"x-api-key-access":true}},"/v1/approvals/{type}/{id}/approve":{"post":{"operationId":"postApprovalsTypeIdApprove","tags":["Approvals"],"summary":"Approve and post or issue an item","description":"A receipt needs expectedPayloadHash. Nobody can approve an item they prepared. Permission: premium:approve or receipt:approve or claim:approve or statement:approve or period:close. Not available to API keys or client applications.","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostApprovalsTypeIdApproveRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["premium:approve","receipt:approve","claim:approve","statement:approve","period:close"],"x-api-key-access":false}},"/v1/approvals/{type}/{id}/reject":{"post":{"operationId":"postApprovalsTypeIdReject","tags":["Approvals"],"summary":"Reject an item with a reason","description":"Permission: premium:approve or receipt:approve or claim:approve or statement:approve or period:close. Not available to API keys or client applications.","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostApprovalsTypeIdRejectRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["premium:approve","receipt:approve","claim:approve","statement:approve","period:close"],"x-api-key-access":false}},"/v1/close-runs":{"get":{"operationId":"getCloseRuns","tags":["Close"],"summary":"List close runs","description":"Permission: period:prepare or period:close or audit:read.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"legalEntityId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["period:prepare","period:close","audit:read"],"x-api-key-access":true}},"/v1/close-runs/{closeRunId}":{"get":{"operationId":"getCloseRunsCloseRunId","tags":["Close"],"summary":"One close run with its items, snapshot hash and reconciliation","description":"Permission: period:prepare or period:close or audit:read.","parameters":[{"name":"closeRunId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["period:prepare","period:close","audit:read"],"x-api-key-access":true}},"/v1/accounting-periods/{period}/close":{"post":{"operationId":"postAccountingPeriodsPeriodClose","tags":["Close"],"summary":"Validate a month-end close, or validate and post it","description":"VALIDATE_ONLY needs period:prepare. VALIDATE_THEN_POST needs period:close, so keys and applications can only validate. Permission: period:prepare or period:close.","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostAccountingPeriodsPeriodCloseRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["period:prepare","period:close"],"x-api-key-access":true}},"/v1/register":{"get":{"operationId":"getRegister","tags":["Register and audit"],"summary":"Filter or export the live register","description":"Permission: register:read.","parameters":[{"name":"reference","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"policyId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:\\-/ ]*$"}},{"name":"productId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:\\-/ ]*$"}},{"name":"coverId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:\\-/ ]*$"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"transactionType","in":"query","required":false,"schema":{"type":"string"}},{"name":"eventType","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z][A-Z0-9_]{1,59}$"}},{"name":"dateFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"dateTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"format","in":"query","required":false,"description":"json (the default) or a file export of every matching row.","schema":{"type":"string","enum":["json","csv","xlsx"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}},"text/csv":{"schema":{"type":"string"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["register:read"],"x-api-key-access":true}},"/v1/audit-events":{"get":{"operationId":"getAuditEvents","tags":["Register and audit"],"summary":"Filter or export the audit history","description":"Permission: audit:read.","parameters":[{"name":"entityType","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"}},{"name":"entityId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"actorId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"action","in":"query","required":false,"schema":{"type":"string"}},{"name":"channel","in":"query","required":false,"schema":{"type":"string"}},{"name":"correlationId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"dateFrom","in":"query","required":false,"schema":{"type":"string"}},{"name":"dateTo","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"format","in":"query","required":false,"description":"json (the default) or a file export of every matching row.","schema":{"type":"string","enum":["json","csv","xlsx"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}},"text/csv":{"schema":{"type":"string"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["audit:read"],"x-api-key-access":true}},"/v1/entities/{entityType}/{entityId}/audit":{"get":{"operationId":"getEntitiesEntityTypeEntityIdAudit","tags":["Register and audit"],"summary":"Audit timeline of one record","description":"Open to anyone who may read the record itself.","parameters":[{"name":"entityType","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"entityId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"order","in":"query","required":false,"schema":{"default":"asc","type":"string","enum":["asc","desc"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":[],"x-api-key-access":true}},"/v1/lookups":{"get":{"operationId":"getLookups","tags":["Reference data"],"summary":"Legal entities, accounts, policies, products, currencies and periods","description":"Permission: register:read.","parameters":[{"name":"asOf","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["register:read"],"x-api-key-access":true}},"/v1/bank-profiles":{"get":{"operationId":"getBankProfiles","tags":["Reference data"],"summary":"Approved bank profiles","description":"Permission: register:read.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["register:read"],"x-api-key-access":true}},"/v1/rate-providers":{"get":{"operationId":"getRateProviders","tags":["Reference data"],"summary":"Approved exchange-rate providers","description":"Permission: register:read.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["register:read"],"x-api-key-access":true}},"/v1/imports":{"get":{"operationId":"getImports","tags":["Imports"],"summary":"List import batches the caller may see","description":"Permission: import:read or import:create.","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"entityType","in":"query","required":false,"schema":{"type":"string"}},{"name":"mine","in":"query","required":false,"schema":{"type":"string","enum":["0","1","true","false"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:read","import:create"],"x-api-key-access":true},"post":{"operationId":"postImports","tags":["Imports"],"summary":"Start an import batch","description":"Then send the rows, validate, commit and submit. Each step can be repeated safely. Permission: import:create.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostImportsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:create"],"x-api-key-access":true}},"/v1/imports/{id}":{"get":{"operationId":"getImportsId","tags":["Imports"],"summary":"One import batch with its row results and created records","description":"Permission: import:read or import:create.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":100000}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","enum":["VALID","INVALID","SKIPPED","COMMITTED","FAILED","SUBMITTED","NOT_SUBMITTED"]}}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:read","import:create"],"x-api-key-access":true}},"/v1/imports/{id}/rows":{"post":{"operationId":"postImportsIdRows","tags":["Imports"],"summary":"Send up to 500 rows of a batch, as text, for checking","description":"Send each chunk with its own Idempotency-Key. Every value is text exactly as in the file, for example \"1250.00\". Permission: import:create.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostImportsIdRowsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:create"],"x-api-key-access":true}},"/v1/imports/{id}/validate":{"post":{"operationId":"postImportsIdValidate","tags":["Imports"],"summary":"Check every row against the ledger again","description":"Permission: import:create.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:create"],"x-api-key-access":true}},"/v1/imports/{id}/commit":{"post":{"operationId":"postImportsIdCommit","tags":["Imports"],"summary":"Create draft records from valid rows (resumable)","description":"Creates at most maxGroups records per call, each in its own transaction. Call again until nothing is left; a record is never created twice. Permission: import:create.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostImportsIdCommitRequest"}}}},"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:create"],"x-api-key-access":true}},"/v1/imports/{id}/submit":{"post":{"operationId":"postImportsIdSubmit","tags":["Imports"],"summary":"Send the created drafts for approval","description":"A person approves each record; nothing is posted by the import. Permission: import:create.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostImportsIdSubmitRequest"}}}},"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:create"],"x-api-key-access":true}},"/v1/imports/{id}/cancel":{"post":{"operationId":"postImportsIdCancel","tags":["Imports"],"summary":"Cancel a batch that has not been committed","description":"Permission: import:create.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:create"],"x-api-key-access":true}},"/v1/imports/{id}/errors.xlsx":{"get":{"operationId":"getImportsIdErrorsXlsx","tags":["Imports"],"summary":"Download the rows with problems as a workbook","description":"Permission: import:read or import:create.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"An Excel workbook.","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/X-Correlation-Id"}},"content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:read","import:create"],"x-api-key-access":true}},"/v1/imports/templates/{file}":{"get":{"operationId":"getImportsTemplatesFile","tags":["Imports"],"summary":"Download an import template, for example premium.xlsx or premium.csv","description":"Permission: import:read or import:create.","parameters":[{"name":"file","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"An Excel workbook or a CSV file.","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/X-Correlation-Id"}},"content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:read","import:create"],"x-api-key-access":true}},"/v1/imports/{id}/graph-source":{"post":{"operationId":"postImportsIdGraphSource","tags":["Imports"],"summary":"Read a batch's file from SharePoint or OneDrive","description":"Permission: import:create. Not available to API keys or client applications.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostImportsIdGraphSourceRequest"}}}},"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["import:create"],"x-api-key-access":false}},"/v1/close-runs/{closeRunId}/report.xlsx":{"get":{"operationId":"getCloseRunsCloseRunIdReportXlsx","tags":["Close"],"summary":"Download the close-run report workbook","description":"Permission: period:prepare or period:close or audit:read.","parameters":[{"name":"closeRunId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"An Excel workbook with one sheet per report.","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/X-Correlation-Id"}},"content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["period:prepare","period:close","audit:read"],"x-api-key-access":true}},"/v1/rate-snapshots":{"post":{"operationId":"postRateSnapshots","tags":["Reference data"],"summary":"Fetch today's exchange rates now (once a day)","description":"Shares the daily job's run, so a second request on the same day reports the stored snapshot and fetches nothing. Permission: settings:manage. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["settings:manage"],"x-api-key-access":false}},"/v1/reports":{"get":{"operationId":"getReports","tags":["Reports"],"summary":"The management reports the caller may run","description":"Permission: register:read.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["register:read"],"x-api-key-access":true}},"/v1/reports/{report}":{"get":{"operationId":"getReportsReport","tags":["Reports"],"summary":"Run or export a management report","description":"Each report also needs the read permission of its data, and takes its own filters (see GET /v1/reports). Permission: register:read.","parameters":[{"name":"report","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"format","in":"query","required":false,"description":"json (the default) or a file export of every matching row.","schema":{"type":"string","enum":["json","csv","xlsx"]}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}},"text/csv":{"schema":{"type":"string"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","contentMediaType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"apiKeyAuth":[]},{"apiKeyHeader":[]},{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["register:read"],"x-api-key-access":true}},"/v1/search":{"get":{"operationId":"getSearch","tags":["Reports"],"summary":"Search records the caller may read","description":"Not available to API keys or client applications.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":[],"x-api-key-access":false}},"/v1/integrations/graph/status":{"get":{"operationId":"getIntegrationsGraphStatus","tags":["Microsoft 365"],"summary":"Whether SharePoint and OneDrive can be used, and why not","description":"Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":[],"x-api-key-access":false}},"/v1/integrations/graph/test":{"post":{"operationId":"postIntegrationsGraphTest","tags":["Microsoft 365"],"summary":"Test the Microsoft Graph connection","description":"Permission: integration:manage. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["integration:manage"],"x-api-key-access":false}},"/v1/integrations/graph/drives":{"get":{"operationId":"getIntegrationsGraphDrives","tags":["Microsoft 365"],"summary":"The signed-in person's OneDrive, or the libraries of a SharePoint site","description":"Permission: statement:read or register:read or audit:read or import:create or integration:manage. Not available to API keys or client applications.","parameters":[{"name":"siteId","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9-]+(?:\\.[A-Za-z0-9-]+)*,[0-9A-Fa-f-]{36},[0-9A-Fa-f-]{36}$"}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:read","register:read","audit:read","import:create","integration:manage"],"x-api-key-access":false}},"/v1/integrations/graph/sites":{"get":{"operationId":"getIntegrationsGraphSites","tags":["Microsoft 365"],"summary":"Search SharePoint sites","description":"Permission: statement:read or register:read or audit:read or import:create or integration:manage. Not available to API keys or client applications.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:read","register:read","audit:read","import:create","integration:manage"],"x-api-key-access":false}},"/v1/integrations/graph/drives/{driveId}/children":{"get":{"operationId":"getIntegrationsGraphDrivesDriveIdChildren","tags":["Microsoft 365"],"summary":"Folders and files in a drive folder","description":"Permission: statement:read or register:read or audit:read or import:create or integration:manage. Not available to API keys or client applications.","parameters":[{"name":"driveId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"itemId","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9!_-]{1,200}$"}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:read","register:read","audit:read","import:create","integration:manage"],"x-api-key-access":false}},"/v1/integrations/graph/publish":{"post":{"operationId":"postIntegrationsGraphPublish","tags":["Microsoft 365"],"summary":"Save a statement or export to SharePoint or OneDrive","description":"Permission: statement:read or register:read or audit:read or import:create or integration:manage. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostIntegrationsGraphPublishRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["statement:read","register:read","audit:read","import:create","integration:manage"],"x-api-key-access":false}},"/v1/integrations/graph/publications":{"get":{"operationId":"getIntegrationsGraphPublications","tags":["Microsoft 365"],"summary":"Recent saves to SharePoint and OneDrive, with failures","description":"Permission: integration:manage. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["integration:manage"],"x-api-key-access":false}},"/v1/integrations/graph/publications/{id}/retry":{"post":{"operationId":"postIntegrationsGraphPublicationsIdRetry","tags":["Microsoft 365"],"summary":"Try a failed save again","description":"Permission: integration:manage. Not available to API keys or client applications.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["integration:manage"],"x-api-key-access":false}},"/v1/integrations/graph/auto-publish":{"get":{"operationId":"getIntegrationsGraphAutoPublish","tags":["Microsoft 365"],"summary":"Settings for saving issued statements to SharePoint automatically","description":"Permission: integration:manage. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["integration:manage"],"x-api-key-access":false},"put":{"operationId":"putIntegrationsGraphAutoPublish","tags":["Microsoft 365"],"summary":"Change the automatic publishing settings","description":"Permission: integration:manage. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutIntegrationsGraphAutoPublishRequest"}}}},"responses":{"200":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["integration:manage"],"x-api-key-access":false}},"/v1/admin/api-clients":{"get":{"operationId":"getAdminApiClients","tags":["Administration"],"summary":"API clients with their keys and usage","description":"Permission: apikey:manage. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["apikey:manage"],"x-api-key-access":false},"post":{"operationId":"postAdminApiClients","tags":["Administration"],"summary":"Register an API client or a Microsoft Entra application","description":"Permission: apikey:manage. Not available to API keys or client applications.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostAdminApiClientsRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["apikey:manage"],"x-api-key-access":false}},"/v1/admin/api-clients/{clientId}":{"get":{"operationId":"getAdminApiClientsClientId","tags":["Administration"],"summary":"One API client with its keys and recent access","description":"Permission: apikey:manage. Not available to API keys or client applications.","parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["apikey:manage"],"x-api-key-access":false},"patch":{"operationId":"patchAdminApiClientsClientId","tags":["Administration"],"summary":"Change a client's permissions or rate limit, or switch it off or on","description":"Permission: apikey:manage. Not available to API keys or client applications.","parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchAdminApiClientsClientIdRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["apikey:manage"],"x-api-key-access":false}},"/v1/admin/api-clients/{clientId}/keys":{"post":{"operationId":"postAdminApiClientsClientIdKeys","tags":["Administration"],"summary":"Create an API key; the full key is in this response only","description":"Keys last 90 days unless expiresInDays says otherwise (at most 365). A client can hold two active keys, so a key is rotated by creating the new one, moving the caller over and revoking the old one. A repeated request with the same Idempotency-Key does not show the key again. Permission: apikey:manage. Not available to API keys or client applications.","parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostAdminApiClientsClientIdKeysRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["apikey:manage"],"x-api-key-access":false}},"/v1/admin/api-clients/{clientId}/keys/{keyId}/revoke":{"post":{"operationId":"postAdminApiClientsClientIdKeysKeyIdRevoke","tags":["Administration"],"summary":"Revoke an API key immediately","description":"Permission: apikey:manage. Not available to API keys or client applications.","parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostAdminApiClientsClientIdKeysKeyIdRevokeRequest"}}}},"responses":{"201":{"description":"Done. When an earlier request with the same Idempotency-Key and body is replayed, data.idempotencyReplayed is true and nothing new is created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["apikey:manage"],"x-api-key-access":false}},"/v1/admin/api-access-log":{"get":{"operationId":"getAdminApiAccessLog","tags":["Administration"],"summary":"Recent requests made with API keys and client applications","description":"Permission: apikey:manage. Not available to API keys or client applications.","parameters":[{"name":"clientId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"$ref":"#/components/parameters/CorrelationId"}],"responses":{"200":{"description":"Done.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"security":[{"entraBearer":[]},{"sessionCookie":[]}],"x-permissions":["apikey:manage"],"x-api-key-access":false}}},"components":{"securitySchemes":{"apiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"alpha_<live|test>_<key id>_<secret>","description":"An API key from an administrator, sent as a bearer token."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"The same API key in its own header."},"entraBearer":{"type":"oauth2","description":"A Microsoft Entra access token. Client applications use client credentials; the application must be registered as an API client.","flows":{"clientCredentials":{"tokenUrl":"https://login.microsoftonline.com/common/oauth2/v2.0/token","scopes":{"api://alpha-accounting-api/.default":"The application roles granted to the calling application."}}}},"sessionCookie":{"type":"apiKey","in":"cookie","name":"__Host-amca_session","description":"The browser session of a signed-in person. Not for other systems."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique string per intended change. Retries with the same key and body are replayed, not repeated.","schema":{"type":"string","minLength":1,"maxLength":200}},"CorrelationId":{"name":"X-Correlation-Id","in":"header","required":false,"description":"Your own reference for this request. It is written to our logs next to the correlation ID we return.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}},"headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key or client application.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"Seconds until the current 60-second window ends.","schema":{"type":"integer","minimum":0}},"X-Correlation-Id":{"description":"Our reference for this request.","schema":{"type":"string"}}},"schemas":{"Violation":{"type":"object","required":["fieldPath","ruleCode","message"],"properties":{"fieldPath":{"type":"string","description":"Dot path into the request body, with array indices, for example lines.1.coverCode."},"ruleCode":{"type":"string"},"message":{"type":"string"}}},"SuccessEnvelope":{"type":"object","required":["ok","data","correlationId"],"properties":{"ok":{"const":true},"data":{},"correlationId":{"type":"string"}}},"ErrorEnvelope":{"type":"object","required":["ok","error","correlationId"],"properties":{"ok":{"const":false},"error":{"type":"object","required":["code","message","violations"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"violations":{"type":"array","items":{"$ref":"#/components/schemas/Violation"}},"details":{"type":"object"}}},"correlationId":{"type":"string"}}},"PutMeToursKeyRequest":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":100000},"status":{"type":"string","enum":["COMPLETED","DISMISSED"]}},"required":["version","status"],"additionalProperties":false},"PostPoliciesRequest":{"type":"object","properties":{"policyNumber":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} ._/\\-?:(),'+&#]*$"},"legalEntityId":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"},"inceptionDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"contractualCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"counterparty":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"},"code":{"type":"string","pattern":"^[A-Z0-9][A-Z0-9_-]{0,39}$"},"name":{"type":"string","minLength":1,"maxLength":120},"type":{"type":"string","enum":["CLIENT","BROKER","INSURER"]}}},"account":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"},"accountNumber":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} ._/\\-?:(),'+&#]*$"},"name":{"type":"string","minLength":1,"maxLength":120},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}},"userComment":{"type":"string","maxLength":1000}},"required":["policyNumber","legalEntityId","inceptionDate","contractualCurrency","counterparty","account"]},"PostPoliciesPolicyIdPremiumsRequest":{"type":"object","properties":{"action":{"default":"SAVE_DRAFT","type":"string","enum":["SAVE_DRAFT","VALIDATE"]},"inceptionDate":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"userComment":{"type":"string","maxLength":1000},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"productCode":{"type":"string","minLength":1},"coverCode":{"type":"string","minLength":1},"grossAmountFcy":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"taxFcy":{"default":"0.00","type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["productCode","coverCode","grossAmountFcy"]}},"commission":{"type":"object","properties":{"rate":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"basis":{"type":"string"}},"required":["rate","basis"]},"binderFee":{"type":"object","properties":{"rate":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"basis":{"type":"string"}},"required":["rate","basis"]},"rateRequest":{"type":"object","properties":{"sourcePolicy":{"type":"string"}},"required":["sourcePolicy"]},"rateOverride":{"type":"object","properties":{"providerRate":{"type":"string","pattern":"^\\d{1,9}(\\.\\d{1,12})?$"},"quoteDirection":{"type":"string","enum":["ZAR_PER_FCY","FCY_PER_ZAR"]},"reason":{"type":"string","minLength":10,"maxLength":500},"evidenceUri":{"type":"string","minLength":3,"maxLength":500}},"required":["providerRate","quoteDirection","reason","evidenceUri"]}},"required":["inceptionDate","currency","lines","rateRequest"]},"PatchPremiumsPremiumIdRequest":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"APPROVE_AND_POST"},"comment":{"type":"string","minLength":1,"maxLength":1000}},"required":["action","comment"]},{"type":"object","properties":{"action":{"type":"string","const":"VALIDATE"},"comment":{"type":"string","maxLength":1000}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"WITHDRAW"},"comment":{"type":"string","maxLength":1000}},"required":["action"]}]},"PostReceiptsRequest":{"type":"object","properties":{"receiptDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"valueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"bankAmountFcy":{"type":"string","pattern":"^\\d{1,15}(\\.\\d{1,2})?$"},"bankReference":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} ._/\\-?:(),'+&#]*$"},"settlementMethod":{"type":"string","enum":["NET_OF_COMMISSION_AND_FEES","GROSS_RECEIPT"]},"userComment":{"type":"string","maxLength":1000}},"required":["receiptDate","valueDate","currency","bankAmountFcy","bankReference","settlementMethod"]},"PostReceiptsReceiptIdAllocationsRequest":{"type":"object","properties":{"action":{"default":"POST","type":"string","enum":["SAVE_DRAFT","VALIDATE","POST"]},"receiptDate":{"type":"string"},"valueDate":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"bankAmountFcy":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"bankReference":{"type":"string","minLength":1},"settlementMethod":{"type":"string","enum":["NET_OF_COMMISSION_AND_FEES","GROSS_RECEIPT"]},"userComment":{"type":"string","maxLength":1000},"allocations":{"minItems":1,"type":"array","items":{"type":"object","properties":{"policyId":{"type":"string","minLength":1},"productCode":{"type":"string","minLength":1},"coverCode":{"type":"string","minLength":1},"premiumLineId":{"type":"string","minLength":1},"grossFcy":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["policyId","productCode","coverCode","premiumLineId","grossFcy"]}},"rateRequest":{"type":"object","properties":{"date":{"type":"string"},"sourcePolicy":{"type":"string"}},"required":["sourcePolicy"]},"rateOverride":{"type":"object","properties":{"providerRate":{"type":"string","pattern":"^\\d{1,9}(\\.\\d{1,12})?$"},"quoteDirection":{"type":"string","enum":["ZAR_PER_FCY","FCY_PER_ZAR"]},"reason":{"type":"string","minLength":10,"maxLength":500},"evidenceUri":{"type":"string","minLength":3,"maxLength":500}},"required":["providerRate","quoteDirection","reason","evidenceUri"]}},"required":["receiptDate","valueDate","currency","bankAmountFcy","settlementMethod","allocations","rateRequest"]},"PostRemunerationRequest":{"type":"object","properties":{"premiumTransactionId":{"type":"string","minLength":1},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"requestDate":{"type":"string"},"userComment":{"type":"string","maxLength":1000},"components":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["BROKER_COMMISSION","BINDER_FEE","SURVEY_FEE","RISK_MANAGEMENT_FEE","OTHER_FEE"]},"rate":{"default":"0","type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"baseFcy":{"default":"0","type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"amountFcy":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"payeeId":{"type":"string"},"settlementMethod":{"default":"SEPARATE_PAYMENT","type":"string"},"settlementDirection":{"type":"string","enum":["BROKER_RETAINED","INSURER_PAYABLE","SEPARATE_PAYMENT","NO_CASH_EFFECT"]},"status":{"type":"string","enum":["UNALLOCATED","CALCULATED","REQUESTED","REMITTED","PAID","REVERSED"]},"remittedDate":{"type":"string"}},"required":["type","amountFcy","status"]}}},"required":["premiumTransactionId","currency","requestDate","components"]},"PostRemittancesRequest":{"type":"object","properties":{"premiumTransactionId":{"type":"string","minLength":1},"submittedZar":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"submittedAt":{"type":"string"},"rateEvidenceId":{"type":"string","minLength":1},"insurerAcceptedAt":{"type":"string"},"userComment":{"type":"string","minLength":1,"maxLength":1000}},"required":["premiumTransactionId","submittedZar","submittedAt","rateEvidenceId","userComment"]},"PostClaimsRequest":{"type":"object","properties":{"policyId":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"},"claimNumber":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} ._/\\-?:(),'+&#]*$"},"productCode":{"type":"string","minLength":1,"maxLength":40},"coverCode":{"type":"string","minLength":1,"maxLength":40},"claimClass":{"type":"string","enum":["LIABILITY","OTHER"]},"dateOfLoss":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"externalReference":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} ._/\\-?:(),'+&#]*$"},"userComment":{"type":"string","maxLength":1000}},"required":["policyId","claimNumber","productCode","coverCode","claimClass","dateOfLoss","dateReported","currency"]},"PostClaimsClaimIdMovementsRequest":{"type":"object","properties":{"action":{"default":"VALIDATE","type":"string","enum":["SAVE_DRAFT","VALIDATE","POST"]},"claimClass":{"type":"string","enum":["LIABILITY","OTHER"]},"dateOfLoss":{"type":"string"},"dateReported":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"userComment":{"type":"string","maxLength":1000},"movement":{"type":"object","properties":{"type":{"type":"string","enum":["RESERVE_SET","RESERVE_INCREASE","RESERVE_DECREASE","REVERSAL"]},"grossAmountFcy":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["type","grossAmountFcy"]},"rateRule":{"type":"string","const":"DERIVE_FROM_CLAIM_CLASS"},"rateOverride":{"type":"object","properties":{"providerRate":{"type":"string","pattern":"^\\d{1,9}(\\.\\d{1,12})?$"},"quoteDirection":{"type":"string","enum":["ZAR_PER_FCY","FCY_PER_ZAR"]},"reason":{"type":"string","minLength":10,"maxLength":500},"evidenceUri":{"type":"string","minLength":3,"maxLength":500}},"required":["providerRate","quoteDirection","reason","evidenceUri"]}},"required":["movement"]},"PostClaimsClaimIdPaymentsRequest":{"type":"object","properties":{"action":{"default":"VALIDATE","type":"string","enum":["SAVE_DRAFT","VALIDATE","POST"]},"paymentValueDate":{"type":"string"},"amountFcy":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"userComment":{"type":"string","minLength":1,"maxLength":1000},"productCode":{"type":"string","minLength":1},"coverCode":{"type":"string","minLength":1},"rateRequest":{"type":"object","properties":{"sourcePolicy":{"type":"string"}},"required":["sourcePolicy"]},"rateOverride":{"type":"object","properties":{"providerRate":{"type":"string","pattern":"^\\d{1,9}(\\.\\d{1,12})?$"},"quoteDirection":{"type":"string","enum":["ZAR_PER_FCY","FCY_PER_ZAR"]},"reason":{"type":"string","minLength":10,"maxLength":500},"evidenceUri":{"type":"string","minLength":3,"maxLength":500}},"required":["providerRate","quoteDirection","reason","evidenceUri"]}},"required":["paymentValueDate","amountFcy","userComment"]},"PostAccountsAccountIdStatementsRequest":{"type":"object","properties":{"action":{"default":"PREVIEW","type":"string","enum":["PREVIEW","ISSUE"]},"periodEnd":{"type":"string"},"statementType":{"type":"string","enum":["PREMIUM_ACCOUNT","CLAIMS_ACCOUNT"]},"originalCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"presentation":{"type":"string","enum":["ORIGINAL_FCY","USD","FCY_AND_USD"]},"recipientType":{"type":"string","enum":["CLIENT","BROKER","INSURER"]},"recipientId":{"type":"string","minLength":1},"usdRateRule":{"type":"string"},"includeAllocationDetail":{"type":"array","items":{"type":"string","enum":["PRODUCT","COVER"]}},"bankProfile":{"type":"object","properties":{"legalEntity":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["legalEntity","currency"]},"output":{"type":"string","const":"PDF"},"rateOverrides":{"maxItems":2,"type":"array","items":{"type":"object","properties":{"providerRate":{"type":"string","pattern":"^\\d{1,9}(\\.\\d{1,12})?$"},"quoteDirection":{"type":"string","enum":["ZAR_PER_FCY","FCY_PER_ZAR"]},"reason":{"type":"string","minLength":10,"maxLength":500},"evidenceUri":{"type":"string","minLength":3,"maxLength":500},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["providerRate","quoteDirection","reason","evidenceUri","currency"]}}},"required":["periodEnd","statementType","originalCurrency","presentation","recipientType","usdRateRule","includeAllocationDetail","bankProfile","output"]},"PostStatementsStatementIdSubmitRequest":{"type":"object","properties":{"comment":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},"PostStatementsStatementIdWithdrawRequest":{"type":"object","properties":{"comment":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},"PostApprovalsTypeIdApproveRequest":{"type":"object","properties":{"comment":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"expectedPayloadHash":{"type":"string","minLength":1,"maxLength":128}}},"PostApprovalsTypeIdRejectRequest":{"type":"object","properties":{"comment":{"type":"string","minLength":3,"maxLength":1000},"expectedPayloadHash":{"type":"string","minLength":1,"maxLength":128}},"required":["comment"]},"PostAccountingPeriodsPeriodCloseRequest":{"type":"object","properties":{"closingDate":{"type":"string"},"ratePolicy":{"type":"string"},"reports":{"minItems":1,"type":"array","items":{"type":"string"}},"postMode":{"default":"VALIDATE_ONLY","type":"string","enum":["VALIDATE_ONLY","VALIDATE_THEN_POST"]},"legalEntityId":{"type":"string","minLength":1,"maxLength":64},"rateOverrides":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"providerRate":{"type":"string","pattern":"^\\d{1,9}(\\.\\d{1,12})?$"},"quoteDirection":{"type":"string","enum":["ZAR_PER_FCY","FCY_PER_ZAR"]},"reason":{"type":"string","minLength":10,"maxLength":500},"evidenceUri":{"type":"string","minLength":3,"maxLength":500},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["providerRate","quoteDirection","reason","evidenceUri","currency"]}}},"required":["closingDate","ratePolicy","reports"]},"PostImportsRequest":{"type":"object","properties":{"entityType":{"type":"string"},"sourceKind":{"default":"API","type":"string","enum":["BROWSER_FILE","CLIPBOARD","GRAPH","API"]},"fileName":{"type":"string","minLength":1,"maxLength":255},"fileSize":{"type":"integer","minimum":0,"maximum":10485760},"sourceSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"templateVersion":{"type":"string","maxLength":20}},"required":["entityType"]},"PostImportsIdRowsRequest":{"type":"object","properties":{"mapping":{"type":"object","properties":{"fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,39}$"},"additionalProperties":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":49},"header":{"type":"string","maxLength":120}},"required":["index","header"]}},"headers":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":120}},"sheetName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}},"required":["fields","headers"]},"totalRows":{"type":"integer","minimum":1,"maximum":5000},"decimalSeparator":{"type":"string","enum":[".",","]},"rows":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":1,"maximum":1048576},"values":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,39}$"},"additionalProperties":{"type":"string","maxLength":1000}}},"required":["rowNumber","values"]}}},"required":["rows"]},"PostImportsIdCommitRequest":{"type":"object","properties":{"maxGroups":{"type":"integer","minimum":1,"maximum":100}}},"PostImportsIdSubmitRequest":{"type":"object","properties":{"maxGroups":{"type":"integer","minimum":1,"maximum":100}}},"PostImportsIdGraphSourceRequest":{"type":"object","properties":{"driveId":{"type":"string","pattern":"^[A-Za-z0-9!_-]{1,200}$"},"itemId":{"type":"string","pattern":"^[A-Za-z0-9!_-]{1,200}$"}},"required":["driveId","itemId"]},"PostIntegrationsGraphPublishRequest":{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"STATEMENT_VERSION"},"sourceId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"driveId":{"type":"string","pattern":"^[A-Za-z0-9!_-]{1,200}$"},"parentId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9!_-]{1,200}$"},{"type":"null"}]},"fileName":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^\"*:<>?/\\\\|#%]+$"}},"required":["sourceType","sourceId","driveId"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"EXPORT"},"exportSpec":{"type":"object","properties":{"kind":{"type":"string","enum":["register","audit-events"]},"format":{"default":"csv","type":"string","enum":["csv"]},"filters":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z]{1,40}$"},"additionalProperties":{"type":"string","maxLength":200}}},"required":["kind"]},"driveId":{"type":"string","pattern":"^[A-Za-z0-9!_-]{1,200}$"},"parentId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9!_-]{1,200}$"},{"type":"null"}]},"fileName":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^\"*:<>?/\\\\|#%]+$"}},"required":["sourceType","exportSpec","driveId"]}]},"PutIntegrationsGraphAutoPublishRequest":{"type":"object","properties":{"enabled":{"type":"boolean"},"siteId":{"default":"","type":"string","maxLength":300},"driveId":{"default":"","type":"string"},"folderPath":{"default":"","type":"string","maxLength":400}},"required":["enabled"]},"PostAdminApiClientsRequest":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":80},"description":{"type":"string","maxLength":500},"kind":{"type":"string","enum":["API_KEY","ENTRA_APP"]},"permissions":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"entraAppId":{"type":"string","maxLength":36},"rateLimitPerMinute":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]}},"required":["name","kind","permissions"]},"PatchAdminApiClientsClientIdRequest":{"type":"object","properties":{"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"permissions":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"status":{"type":"string","enum":["ACTIVE","DISABLED"]},"rateLimitPerMinute":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"reason":{"type":"string","minLength":3,"maxLength":500}}},"PostAdminApiClientsClientIdKeysRequest":{"type":"object","properties":{"expiresInDays":{"default":90,"type":"integer","minimum":1,"maximum":365}}},"PostAdminApiClientsClientIdKeysKeyIdRevokeRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]}},"responses":{"BadRequest":{"description":"The request could not be read (MALFORMED_REQUEST), or a write had no Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unauthenticated":{"description":"No usable credentials (AUTHENTICATION_REQUIRED), or the API key was not accepted (API_KEY_INVALID). The message never says which check failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Forbidden":{"description":"The caller may not do this (INSUFFICIENT_PERMISSION), maker-checker refused it, or a browser request came from another site (CSRF_ORIGIN_REJECTED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"NotFound":{"description":"No such record (RESOURCE_NOT_FOUND).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Conflict":{"description":"The record changed or is in the wrong state, or the Idempotency-Key was used with another body (IDEMPOTENCY_PAYLOAD_CONFLICT).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ValidationFailed":{"description":"A field or business rule failed (VALIDATION_FAILED or a specific code). violations[] names each field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"RateLimited":{"description":"Too many requests (RATE_LIMITED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"ServerError":{"description":"Something went wrong on our side (INTERNAL_ERROR), or the server is not configured yet (for example API_KEY_CONFIGURATION_ERROR).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}