{"openapi":"3.1.0","info":{"title":"Tenuta IQ API","version":"1.0.0-draft","summary":"Lease administration and portfolio intelligence for retail and commercial property, worldwide.","description":"# Integration guide\n\nThe Tenuta IQ API is the same contract our web and mobile apps use. Everything a user can do, an integration can do, subject to the same roles and scopes.\n\n## Base URLs\nEach customer account lives in one **regional cell**. Use the base URL for your cell (shown in Settings › API). Requests to the wrong cell return `404 account_not_in_cell`.\n\n## Authentication\nTwo options, both sent as `Authorization: Bearer <token>`:\n* **API keys** for server-to-server integrations. Create them in Settings › API keys. A key belongs to an *integration membership* with a role and scope, and can be restricted to capabilities (for example `leases:read`, `reports:run`, `billing:read`). Keys start with `liq_live_` or `liq_test_`.\n* **OAuth 2.0 client credentials** for partner platforms acting on behalf of many accounts. Tokens expire in 60 minutes.\n\n## Conventions\n* All timestamps are RFC 3339 UTC; all dates are `YYYY-MM-DD` in the lease's local calendar.\n* **Money** is always `{ amount, currency }` with ISO 4217 codes and amounts as decimal strings (`\"616200.00\"`). Nothing is silently converted; conversions are explicit via `fx` fields or the reports endpoint.\n* **Areas** carry `value`, `unit` (`sqm`, `sqft`, `tsubo`, `ping`) and `standard` (`IPMS3`, `PCA_NLA`, `RICS_NIA`, `BOMA_RSF`, ...). A canonical `sqm` is always returned alongside.\n* **Jurisdictions** are ISO 3166-1 / 3166-2 codes (`AU-QLD`, `GB-ENG`, `SG`, `US-NY`).\n* **Pagination** is cursor based: pass `limit` (max 200) and `cursor` from the previous `meta.next_cursor`.\n* **Filtering**: list endpoints accept `filter[field]=value` and `filter[field][op]=value` with ops `eq`, `in`, `gte`, `lte`, `contains`. **Sorting**: `sort=-expiry_date,reference`. **Sparse fields**: `fields=id,reference,expiry_date`. **Expansion**: `expand=tenant,property,rent_schedule`.\n* **Idempotency**: every `POST` accepts `Idempotency-Key` (UUID). Replays within 24 hours return the original response with `Idempotent-Replayed: true`.\n* **Concurrency**: resources return `ETag`; send `If-Match` on `PUT`/`PATCH` to avoid lost updates (`412 precondition_failed`).\n* **Errors** use RFC 9457 problem details (`application/problem+json`) with a stable `code`.\n* **Rate limits**: 600 requests/minute per key; headers `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `Retry-After`.\n* **Versioning**: the path carries the major version (`/v1`). Additive changes ship without a bump; breaking changes get `/v2` with a 12-month overlap. Use `Lease-IQ-Version: 2026-09-01` to pin response shapes.\n\n## Commands vs. edits\nState changes that mean something in the domain are explicit sub-resource commands (`/commit`, `/apply`, `/exercise`, `/close`, `/terminate`) and raise domain events. Plain `PATCH` is for correcting attributes and never changes lifecycle state.\n\n## Webhooks\nSubscribe to domain events with `POST /webhooks`. Deliveries are signed (`Lease-IQ-Signature: t=<unix>,v1=<hmac-sha256>`) over `t + \".\" + body` using your endpoint secret, retried with exponential backoff for 72 hours, and listable via `/webhooks/{id}/deliveries`.\n\n## Sandbox\nEvery account has a sandbox cell with seeded demo data (`liq_test_` keys). Sandbox never sends email or touches Stripe.\n","contact":{"name":"Tenuta IQ integrations","email":"api@tenutaiq.com"},"license":{"name":"Proprietary","url":"https://www.tenutaiq.com/en/legal/terms"},"x-logo":{"altText":"Tenuta IQ"}},"servers":[{"url":"https://api.au.tenutaiq.com/v1","description":"Australia cell (Sydney)"},{"url":"https://api.ap.tenutaiq.com/v1","description":"Asia Pacific cell (Singapore)"},{"url":"https://api.uk.tenutaiq.com/v1","description":"United Kingdom cell (London)"},{"url":"https://api.eu.tenutaiq.com/v1","description":"European Union cell (Frankfurt)"},{"url":"https://api.us.tenutaiq.com/v1","description":"North America cell (US East)"},{"url":"https://sandbox.tenutaiq.com/v1","description":"Sandbox (seeded demo data, all regions)"}],"tags":[{"name":"Account & directory","description":"Discover your cell, account and the identity behind a token."},{"name":"Portfolios"},{"name":"Properties & premises"},{"name":"Custom fields","description":"Typed fields the account defines on leases and properties. Values are read and written as `custom` on the record."},{"name":"Parties"},{"name":"Leases","description":"The lease aggregate and its sub-resources."},{"name":"Rent reviews"},{"name":"Options"},{"name":"Critical dates & tasks"},{"name":"Outgoings & recoveries"},{"name":"Documents & extraction"},{"name":"Compliance","description":"Jurisdictions and versioned rule packs."},{"name":"Reference data","description":"Currencies, FX rates, index series, measurement standards."},{"name":"Reports & dashboards"},{"name":"Lease accounting","description":"IFRS 16 / ASC 842 / AASB 16 schedules, journals and disclosures (occupier side)."},{"name":"Ledger & trust accounting","description":"Charge runs, invoices, receipts, arrears, trust reconciliation and ledger connections."},{"name":"Sites & franchise","description":"Occupier model, site network, franchise agreements, sales feeds, co-terminous management."},{"name":"Certifications","description":"Licences, accreditations and certificates a property, site, tenant or party must hold, with templates by permitted use."},{"name":"Owner portal","description":"Landlord-as-client endpoints for managing agents (statements, approvals)."},{"name":"Tenant portal","description":"Endpoints used by the tenant-facing portal (tenant tokens)."},{"name":"Maintenance & work orders"},{"name":"Leasing deals","description":"Vacancy and renewal pipeline with deal economics."},{"name":"Market data"},{"name":"Integrations","description":"Catalogue, connections, e-signature, API keys."},{"name":"Billing"},{"name":"Webhooks"},{"name":"Audit"},{"name":"Bulk import"},{"name":"Sales and turnover","description":"Sales reporting by retail tenants (portal, spreadsheet import, POS feed) and turnover rent: breakpoints, lease-year accrual, occupancy cost ratio, missing periods. Idempotent on (lease, period)."},{"name":"Assets","description":"Physical asset register per property or site: condition, expected life, replacement cost, service schedule, linked certifications and work orders, capex forecast."},{"name":"Portfolio intelligence","description":"The first read of the portfolio: summary numbers, the expiration runway, priority signals (risk framed as the decision the team needs to make) and the activity trail. Computed from the caller's scope at request time; nothing is stored."},{"name":"Notifications","description":"In-app inbox, email digest preferences and a per-user calendar (ICS) feed. Notifications are derived from critical dates, reviews, imports and platform or partner events, and retire themselves when the underlying item is resolved."},{"name":"Platform (control plane)","description":"Tenuta platform admins only: cells, partners, organisations, usage, config flags, audit. Served from admin.tenutaiq.com; never returns customer lease data."},{"name":"Partner (white label)","description":"Partner admins (white-label resellers): own customers, own analytics, branding, custom domains, statements. A partner token is scoped to one partner."}],"security":[{"apiKey":[]},{"oauth2":["leases:read"]}],"paths":{"/me":{"get":{"tags":["Account & directory"],"summary":"Identity behind the token","operationId":"getMe","responses":{"200":{"description":"The principal, its role, scope and capabilities.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Principal"},"example":{"id":"int_01J8","kind":"api_key","name":"Xero sync","account_id":"acc_01HZ","cell":"au","role":"integration","scope":{"type":"account"},"capabilities":["leases:read","leases:write","billing:read","reports:run"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/directory/accounts/{account_id}":{"get":{"tags":["Account & directory"],"summary":"Resolve an account to its regional cell","description":"Served from the global directory (`https://directory.tenutaiq.com/v1`). Returns only the cell, never account data.","operationId":"resolveAccountCell","security":[],"parameters":[{"$ref":"#/components/parameters/AccountId"}],"responses":{"200":{"description":"Cell information","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"cell":{"type":"string","enum":["au","ap","uk","eu","us"]},"base_url":{"type":"string","format":"uri"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/portfolios":{"get":{"tags":["Portfolios"],"summary":"List portfolios","operationId":"listPortfolios","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Portfolios in scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioList"}}}}}},"post":{"tags":["Portfolios"],"summary":"Create a portfolio","operationId":"createPortfolio","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portfolio"}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/portfolios/{portfolio_id}":{"parameters":[{"$ref":"#/components/parameters/PortfolioId"}],"get":{"tags":["Portfolios"],"summary":"Get a portfolio","operationId":"getPortfolio","responses":{"200":{"description":"Portfolio","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portfolio"}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Portfolios"],"summary":"Update portfolio settings","operationId":"updatePortfolio","parameters":[{"$ref":"#/components/parameters/IfMatch"}],"requestBody":{"required":true,"content":{"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/PortfolioInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portfolio"}}}},"412":{"$ref":"#/components/responses/PreconditionFailed"}}}},"/portfolios/{portfolio_id}/metrics":{"get":{"tags":["Portfolios"],"summary":"Portfolio KPIs as at a date","description":"Passing rent, face and effective rent per unit area, WALE (income and area), vacancy, income at risk, review pipeline, expiry profile. Money in the portfolio reporting currency unless `reporting_currency` overrides it.","operationId":"getPortfolioMetrics","parameters":[{"$ref":"#/components/parameters/PortfolioId"},{"name":"as_at","in":"query","schema":{"type":"string","format":"date"},"description":"Defaults to today in the portfolio's timezone."},{"name":"reporting_currency","in":"query","schema":{"$ref":"#/components/schemas/CurrencyCode"}},{"name":"fx_policy","in":"query","schema":{"type":"string","enum":["as_at_spot","month_average","budget"],"default":"as_at_spot"}},{"name":"assume_options_exercised","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioMetrics"}}}}}}},"/waitlist":{"post":{"tags":["Account & directory"],"summary":"Join the waitlist, send a message or request an account (public)","description":"Used by the marketing site (waitlist and contact forms) and by the app's sign-up page (account requests while self-serve sign-up is unavailable). `kind` picks which: `waitlist` (the default; one entry per email, a repeat updates it), `contact` or `signup` (every message kept). No authentication; allowed origins (the marketing site and the app itself) only, a honeypot field, and a limit of 5 enquiries per address per hour. A plain form post (application/x-www-form-urlencoded) redirects back with `?joined=1` (contact: to the contact page) or, for `signup`, to `/signup?requested=1`.","operationId":"joinWaitlist","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistEnquiry"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/WaitlistEnquiry"}}},"description":"The same fields as JSON or as a form post. `website` is a honeypot; leave it empty (a filled value is silently discarded)."},"responses":{"200":{"description":"A repeat waitlist enquiry from the same address (its row is updated)"},"201":{"description":"Stored"},"403":{"description":"The request carried an Origin header that is not an allowed site"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}}}},"/custom-fields":{"get":{"tags":["Custom fields"],"summary":"List custom field definitions","operationId":"listCustomFields","parameters":[{"name":"entity","in":"query","schema":{"type":"string","enum":["lease","property"]}},{"name":"archived","in":"query","description":"Include archived fields","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Definitions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldDefinition"}}}}}}}}},"post":{"tags":["Custom fields"],"summary":"Define a custom field","description":"Account owner or portfolio manager. The key is derived from the label unless given, and is fixed once created. At most 50 active fields per record type.","operationId":"createCustomField","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldInput"},"examples":{"pickList":{"value":{"entity":"lease","label":"Fitout grade","type":"select","options":["Shell","Warm shell","Fully fitted"]}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomFieldDefinition"}}}}}},"422":{"description":"Invalid definition (duplicate key, empty pick list, limit reached)"}}}},"/properties":{"get":{"tags":["Properties & premises"],"summary":"List properties","operationId":"listProperties","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[portfolio_id]","in":"query","schema":{"type":"string"}},{"name":"filter[country]","in":"query","schema":{"type":"string"},"example":"AU"},{"name":"filter[asset_class]","in":"query","schema":{"$ref":"#/components/schemas/AssetClass"}},{"name":"expand","in":"query","schema":{"type":"string"},"example":"premises,benchmark"}],"responses":{"200":{"description":"Properties","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropertyList"}}}}}},"post":{"tags":["Properties & premises"],"summary":"Create a property","description":"The address is geocoded and the most specific jurisdiction is derived; pass `jurisdiction` explicitly to override.","operationId":"createProperty","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropertyInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Property"}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/properties/{property_id}":{"parameters":[{"$ref":"#/components/parameters/PropertyId"}],"get":{"tags":["Properties & premises"],"summary":"Get a property","operationId":"getProperty","responses":{"200":{"description":"Property","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Property"}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Properties & premises"],"summary":"Update a property","operationId":"updateProperty","parameters":[{"$ref":"#/components/parameters/IfMatch"}],"requestBody":{"required":true,"content":{"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/PropertyInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Property"}}}}}},"delete":{"tags":["Properties & premises"],"summary":"Archive a property","description":"Soft delete. Fails with `409 has_active_leases` while live leases exist.","operationId":"archiveProperty","responses":{"204":{"description":"Archived"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/properties/{property_id}/premises":{"parameters":[{"$ref":"#/components/parameters/PropertyId"}],"get":{"tags":["Properties & premises"],"summary":"List premises (stacking plan order)","operationId":"listPremises","responses":{"200":{"description":"Premises","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Premises"}}}}}}}}},"post":{"tags":["Properties & premises"],"summary":"Create premises","operationId":"createPremises","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PremisesInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Premises"}}}}}}},"/premises/{premises_id}":{"parameters":[{"name":"premises_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Properties & premises"],"summary":"Get premises","operationId":"getPremises","responses":{"200":{"description":"Premises","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Premises"}}}}}},"patch":{"tags":["Properties & premises"],"summary":"Update premises (re-measure, status)","description":"Changing the measured area raises `premises.measured`, which recalculates rent per unit on attached leases.","operationId":"updatePremises","parameters":[{"$ref":"#/components/parameters/IfMatch"}],"requestBody":{"required":true,"content":{"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/PremisesInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Premises"}}}}}}},"/parties":{"get":{"tags":["Parties"],"summary":"List parties (tenants, landlords, guarantors, agents)","operationId":"listParties","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[legal_name][contains]","in":"query","schema":{"type":"string"}},{"name":"filter[registration_id]","in":"query","schema":{"type":"string"},"description":"ABN, Companies House number, UEN, EIN, SIREN..."}],"responses":{"200":{"description":"Parties","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Party"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}},"post":{"tags":["Parties"],"summary":"Create a party","description":"Registration identifiers are validated against the national register where one is available (ABR, Companies House, ACRA, ...).","operationId":"createParty","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartyInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Party"}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/parties/{party_id}":{"parameters":[{"name":"party_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Parties"],"summary":"Get a party","operationId":"getParty","responses":{"200":{"description":"Party","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Party"}}}}}},"patch":{"tags":["Parties"],"summary":"Update a party","operationId":"updateParty","requestBody":{"required":true,"content":{"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/PartyInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Party"}}}}}}},"/leases":{"get":{"tags":["Leases"],"summary":"List leases","operationId":"listLeases","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[status][in]","in":"query","schema":{"type":"string"},"example":"active,holding_over"},{"name":"filter[property_id]","in":"query","schema":{"type":"string"}},{"name":"filter[tenant_id]","in":"query","schema":{"type":"string"}},{"name":"filter[jurisdiction]","in":"query","schema":{"type":"string"},"description":"Matches the code or any parent (AU matches AU-QLD)."},{"name":"filter[lease_class]","in":"query","schema":{"$ref":"#/components/schemas/LeaseClass"}},{"name":"filter[expiry_date][lte]","in":"query","schema":{"type":"string","format":"date"}},{"name":"filter[updated_at][gte]","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync."},{"name":"sort","in":"query","schema":{"type":"string","default":"reference"}},{"name":"expand","in":"query","schema":{"type":"string"},"example":"tenant,property,premises,rent_schedule,compliance"},{"name":"fields","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Leases in the caller's scope","headers":{"X-RateLimit-Remaining":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaseList"}}}}}},"post":{"tags":["Leases"],"summary":"Create a lease (draft)","description":"Creates the lease in `draft`. The jurisdiction is inherited from the property unless supplied. Rule packs are resolved immediately and any findings are returned in `compliance`; errors do not block a draft, they block `commit`.\n","operationId":"createLease","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/LeaseInput"},{"$ref":"#/components/schemas/LeaseRecordInput"}],"description":"Either the full draft contract (rent periods, reviews, options) or the quick record the app's New lease form posts (camelCase, annual rent, option count). The quick record creates an active lease with one rent period and dormant options; refine it afterwards from the lease page."},"examples":{"quick_record":{"summary":"Quick record (what the New lease form sends)","value":{"reference":"L-2026-0900","propertyId":"pr-riverside","premisesIds":["pm-riv-3"],"tenantId":"pt-pavilion","leaseClass":"retail_regime","currency":"AUD","jurisdiction":"AU-QLD","commencement":"2026-11-01","expiry":"2031-10-31","annualRentExTax":98000,"optionCount":1,"optionTermMonths":60,"permittedUse":"Cafe","notes":"Relocating from kiosk K2"}},"qld_retail":{"summary":"Queensland retail shop lease","value":{"reference":"L-2021-0092","property_id":"prop_riverside","premises_ids":["prem_riv_3"],"lease_class":"retail_regime","parties":[{"party_id":"party_pavilion","role":"tenant"},{"party_id":"party_pah","role":"landlord"}],"currency":"AUD","rent_unit":"per_sqm_pa","language":"en","commencement_date":"2021-11-01","term_months":60,"recoveries_basis":"net","permitted_use":"Pharmacy","rent_periods":[{"start":"2021-11-01","end":"2022-10-31","annual_rent":{"amount":"170000.00","currency":"AUD"}}],"reviews":[{"review_date":"2022-11-01","type":"fixed_pct","parameters":{"pct":4}},{"review_date":"2026-11-01","type":"market","parameters":{}}],"options":[{"sequence":1,"term_months":60,"window_open":"2026-05-01","window_close":"2026-08-01"}],"incentives":[{"kind":"fitout_contribution","value":{"amount":"85000.00","currency":"AUD"},"note":"Payable on practical completion"}],"security":{"kind":"bank_guarantee","amount":{"amount":"62000.00","currency":"AUD"},"indexed_to_rent":true}}},"london_office":{"summary":"England office lease quoted per sq ft","value":{"reference":"L-2023-0507","property_id":"prop_manchester_sq","premises_ids":["prem_man_34"],"lease_class":"commercial","parties":[{"party_id":"party_kf","role":"tenant"}],"currency":"GBP","rent_unit":"per_sqft_pa","commencement_date":"2022-04-01","term_months":120,"recoveries_basis":"net","rent_periods":[{"start":"2022-04-01","end":"2027-03-31","annual_rent":{"amount":"781250.00","currency":"GBP"}}],"reviews":[{"review_date":"2027-04-01","type":"upward_only_market","parameters":{"dispute":"RICS PACT"}}],"attributes":{"lta_1954":"inside","break_dates":["2027-04-01"]}}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}},"402":{"$ref":"#/components/responses/PlanLimit"},"409":{"description":"A lease with that reference already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/leases/{lease_id}":{"parameters":[{"$ref":"#/components/parameters/LeaseId"}],"get":{"tags":["Leases"],"summary":"Get a lease","operationId":"getLease","parameters":[{"name":"expand","in":"query","schema":{"type":"string"},"example":"rent_schedule,reviews,options,clauses,documents,compliance,critical_dates"},{"name":"version","in":"query","schema":{"type":"integer"},"description":"Read a historical committed version."}],"responses":{"200":{"description":"Lease","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Leases"],"summary":"Correct lease attributes","description":"Attribute corrections only. On a committed lease this creates a new version with `reason: correction`; lifecycle changes use the command endpoints.","operationId":"updateLease","parameters":[{"$ref":"#/components/parameters/IfMatch"}],"requestBody":{"required":true,"content":{"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/LeaseInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}},"412":{"$ref":"#/components/responses/PreconditionFailed"}}},"delete":{"tags":["Leases"],"summary":"Archive a lease (soft delete)","description":"The record leaves the register and the metrics but keeps its history, sales, critical dates and activity. `?restore=true` brings it back. Archiving is recorded in the activity trail.","operationId":"archiveLease","parameters":[{"name":"restore","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Archived or restored","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"archived":{"type":"boolean"},"version":{"type":"integer"}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/leases/{lease_id}/commit":{"post":{"tags":["Leases"],"summary":"Commit a draft (generate schedules and critical dates)","description":"Validates the aggregate against the resolved rule packs. Errors block the commit unless each is acknowledged in `overrides` with a reason (audited). On success the rent schedule, options timeline and critical dates are generated and `lease.committed` is raised. Four-eyes thresholds may return `202` pending a second approver.\n","operationId":"commitLease","parameters":[{"$ref":"#/components/parameters/LeaseId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"overrides":{"type":"array","items":{"type":"object","required":["rule_code","reason"],"properties":{"rule_code":{"type":"string"},"reason":{"type":"string"}}}},"reason":{"type":"string","enum":["initial","variation","assignment","renewal","correction"],"default":"initial"}}}}}},"responses":{"200":{"description":"Committed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}},"202":{"description":"Awaiting second approval","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"409":{"description":"Blocking compliance findings","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ComplianceProblem"}}}}}}},"/leases/{lease_id}/terminate":{"post":{"tags":["Leases"],"summary":"Terminate, surrender or record a break","operationId":"terminateLease","parameters":[{"$ref":"#/components/parameters/LeaseId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["effective_date","reason"],"properties":{"effective_date":{"type":"string","format":"date"},"reason":{"type":"string","enum":["break","surrender","breach","agreement","other"]},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"Terminated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}}}}},"/leases/{lease_id}/assign":{"post":{"tags":["Leases"],"summary":"Record an assignment to a new tenant","operationId":"assignLease","parameters":[{"$ref":"#/components/parameters/LeaseId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["assignee_party_id","effective_date"],"properties":{"assignee_party_id":{"type":"string"},"effective_date":{"type":"string","format":"date"},"consent_document_id":{"type":"string"}}}}}},"responses":{"201":{"description":"New lease version for the assignee, parent marked assigned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}}}}},"/leases/{lease_id}/versions":{"get":{"tags":["Leases"],"summary":"Version history","operationId":"listLeaseVersions","parameters":[{"$ref":"#/components/parameters/LeaseId"}],"responses":{"200":{"description":"Versions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeaseVersion"}}}}}}}}}},"/leases/{lease_id}/rent-schedule":{"get":{"tags":["Leases"],"summary":"Rent schedule (all periods, past and future)","operationId":"getRentSchedule","parameters":[{"$ref":"#/components/parameters/LeaseId"},{"name":"reporting_currency","in":"query","schema":{"$ref":"#/components/schemas/CurrencyCode"},"description":"Adds an `fx` block per period converted at the period start date."}],"responses":{"200":{"description":"Schedule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RentPeriod"}},"passing_rent":{"$ref":"#/components/schemas/Money"},"effective_rent":{"$ref":"#/components/schemas/Money"},"incentive_pct":{"type":"number"}}}}}}}}},"/leases/{lease_id}/charges":{"get":{"tags":["Leases"],"summary":"Charge lines for a period (rent, recoveries, parking, turnover) with tax codes","description":"The feed a ledger integration (Xero, MYOB, Business Central, NetSuite, Sage) consumes. Idempotent per `period`.","operationId":"listCharges","parameters":[{"$ref":"#/components/parameters/LeaseId"},{"name":"period","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"example":"2026-10"}],"responses":{"200":{"description":"Charges","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChargeLine"}}}}}}}}}},"/leases/{lease_id}/compliance":{"get":{"tags":["Compliance"],"summary":"Evaluate the lease against its resolved rule packs","operationId":"evaluateLease","parameters":[{"$ref":"#/components/parameters/LeaseId"}],"responses":{"200":{"description":"Findings and packs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceResult"}}}}}}},"/leases/{lease_id}/reviews":{"parameters":[{"$ref":"#/components/parameters/LeaseId"}],"get":{"tags":["Rent reviews"],"summary":"List rent reviews on a lease","operationId":"listLeaseReviews","responses":{"200":{"description":"Reviews","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RentReview"}}}}}}}}},"post":{"tags":["Rent reviews"],"summary":"Add a review","operationId":"createReview","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentReviewInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentReview"}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/reviews":{"get":{"tags":["Rent reviews"],"summary":"Review pipeline across the scope","operationId":"listReviews","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[review_date][lte]","in":"query","schema":{"type":"string","format":"date"}},{"name":"filter[state][in]","in":"query","schema":{"type":"string"},"example":"scheduled,calculated,notice_due"},{"name":"filter[type]","in":"query","schema":{"$ref":"#/components/schemas/ReviewType"}}],"responses":{"200":{"description":"Reviews","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RentReview"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}}},"/reviews/{review_id}/calculate":{"post":{"tags":["Rent reviews"],"summary":"Calculate an index or fixed review","description":"Pulls the named index series for the reference periods, applies caps, collars and rounding, and stores `proposed_rent`. State becomes `calculated`.","operationId":"calculateReview","parameters":[{"$ref":"#/components/parameters/ReviewId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Calculated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentReview"}}}},"409":{"description":"Index not yet published for the reference period","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/reviews/{review_id}/notice":{"post":{"tags":["Rent reviews"],"summary":"Record the landlord notice for a market review","operationId":"noticeReview","parameters":[{"$ref":"#/components/parameters/ReviewId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["served_on","proposed_rent"],"properties":{"served_on":{"type":"string","format":"date"},"proposed_rent":{"$ref":"#/components/schemas/Money"},"document_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Notice recorded; statutory response window scheduled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentReview"}}}}}}},"/reviews/{review_id}/determine":{"post":{"tags":["Rent reviews"],"summary":"Record an agreed or determined rent","operationId":"determineReview","parameters":[{"$ref":"#/components/parameters/ReviewId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rent","basis"],"properties":{"rent":{"$ref":"#/components/schemas/Money"},"basis":{"type":"string","enum":["agreed","valuer_determination","expert","arbitration","court"]},"determined_on":{"type":"string","format":"date"},"document_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Determined","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentReview"}}}}}}},"/reviews/{review_id}/apply":{"post":{"tags":["Rent reviews"],"summary":"Apply an approved review to the rent schedule","description":"Creates the new rent period from the review date, calculates any back-rent adjustment, raises `review.applied`. Requires the `review.apply` capability (portfolio manager or owner).","operationId":"applyReview","parameters":[{"$ref":"#/components/parameters/ReviewId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"override_rent":{"$ref":"#/components/schemas/Money"},"override_reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Applied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentReview"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/leases/{lease_id}/options":{"parameters":[{"$ref":"#/components/parameters/LeaseId"}],"get":{"tags":["Options"],"summary":"List options and renewal rights","operationId":"listOptions","responses":{"200":{"description":"Options","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeaseOption"}}}}}}}}}},"/options/{option_id}/exercise":{"post":{"tags":["Options"],"summary":"Exercise an option","description":"Validates the window and conditions from the rule pack, creates the renewal lease as a child (`parent_lease_id`), marks the parent `renewed`, raises `option.exercised`.","operationId":"exerciseOption","parameters":[{"$ref":"#/components/parameters/OptionId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notice_received_on":{"type":"string","format":"date"},"notice_document_id":{"type":"string"},"renewal_rent":{"$ref":"#/components/schemas/Money"}}}}}},"responses":{"201":{"description":"Renewal lease created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}},"409":{"description":"Window closed or conditions not met","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/options/{option_id}/lapse":{"post":{"tags":["Options"],"summary":"Record that an option lapsed","operationId":"lapseOption","parameters":[{"$ref":"#/components/parameters/OptionId"}],"responses":{"200":{"description":"Lapsed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaseOption"}}}}}}},"/critical-dates":{"get":{"tags":["Critical dates & tasks"],"summary":"List critical dates","operationId":"listCriticalDates","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[due_date][gte]","in":"query","schema":{"type":"string","format":"date"}},{"name":"filter[due_date][lte]","in":"query","schema":{"type":"string","format":"date"}},{"name":"filter[kind]","in":"query","schema":{"type":"string"}},{"name":"filter[state][in]","in":"query","schema":{"type":"string"}},{"name":"filter[lease_id]","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Critical dates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CriticalDate"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}}},"/critical-dates.ics":{"get":{"tags":["Critical dates & tasks"],"summary":"Calendar feed","operationId":"criticalDatesCalendar","responses":{"200":{"description":"iCalendar feed","content":{"text/calendar":{"schema":{"type":"string"}}}}}}},"/tasks":{"get":{"tags":["Critical dates & tasks"],"summary":"List tasks","operationId":"listTasks","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[owner_user_id]","in":"query","schema":{"type":"string"}},{"name":"filter[state][in]","in":"query","schema":{"type":"string"},"example":"notified,acknowledged,overdue"}],"responses":{"200":{"description":"Tasks","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}}},"/tasks/{task_id}/acknowledge":{"post":{"tags":["Critical dates & tasks"],"summary":"Acknowledge a task","operationId":"acknowledgeTask","parameters":[{"$ref":"#/components/parameters/TaskId"}],"responses":{"200":{"description":"Acknowledged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}}}}},"/tasks/{task_id}/reassign":{"post":{"tags":["Critical dates & tasks"],"summary":"Reassign a task","operationId":"reassignTask","parameters":[{"$ref":"#/components/parameters/TaskId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["owner_user_id"],"properties":{"owner_user_id":{"type":"string"},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"Reassigned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}}}}},"/tasks/{task_id}/close":{"post":{"tags":["Critical dates & tasks"],"summary":"Close a task with an outcome","description":"Some outcomes trigger domain commands (for example `option_exercised` calls the option exercise). Raises `task.closed`.","operationId":"closeTask","parameters":[{"$ref":"#/components/parameters/TaskId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["outcome"],"properties":{"outcome":{"type":"string","enum":["actioned","not_required","option_exercised","option_lapsed","renewal_started","notice_issued","security_renewed","other"]},"note":{"type":"string"},"document_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}}}}},"/properties/{property_id}/outgoings-budgets":{"parameters":[{"$ref":"#/components/parameters/PropertyId"}],"get":{"tags":["Outgoings & recoveries"],"summary":"List budgets (outgoings, service charge, CAM) by fiscal year","operationId":"listOutgoingsBudgets","responses":{"200":{"description":"Budgets","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OutgoingsBudget"}}}}}}}}},"post":{"tags":["Outgoings & recoveries"],"summary":"Create a budget","description":"Category codes and recoverability defaults come from the property's jurisdiction rule pack (for example land tax non-recoverable for QLD retail).","operationId":"createOutgoingsBudget","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutgoingsBudgetInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutgoingsBudget"}}}}}}},"/outgoings-budgets/{budget_id}/actuals":{"post":{"tags":["Outgoings & recoveries"],"summary":"Post actuals (from the ledger) against a budget","operationId":"postOutgoingsActuals","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lines"],"properties":{"lines":{"type":"array","items":{"type":"object","required":["category","amount"],"properties":{"category":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"},"source_ref":{"type":"string"}}}}}}}}},"responses":{"202":{"description":"Accepted for reconciliation"}}}},"/outgoings-budgets/{budget_id}/reconcile":{"post":{"tags":["Outgoings & recoveries"],"summary":"Run the year-end reconciliation and produce tenant statements","operationId":"reconcileOutgoings","parameters":[{"name":"budget_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Reconciliation with adjustment lines per lease","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reconciliation"}}}}}}},"/documents":{"get":{"tags":["Documents & extraction"],"summary":"List documents","operationId":"listDocuments","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[lease_id]","in":"query","schema":{"type":"string"}},{"name":"filter[kind]","in":"query","schema":{"$ref":"#/components/schemas/DocumentKind"}}],"responses":{"200":{"description":"Documents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}},"post":{"tags":["Documents & extraction"],"summary":"Upload a document","description":"Multipart upload up to 100 MB. Returns the document and, when `extract=true`, an extraction job. For larger files request a signed upload URL via `/documents/upload-url`.","operationId":"uploadDocument","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","kind"],"properties":{"file":{"type":"string","format":"binary"},"kind":{"$ref":"#/components/schemas/DocumentKind"},"lease_id":{"type":"string"},"property_id":{"type":"string"},"title":{"type":"string"},"language":{"type":"string","example":"en"},"extract":{"type":"boolean","default":false,"description":"Queue AI-assisted abstraction."}}}}}},"responses":{"201":{"description":"Uploaded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"413":{"description":"Too large; use the signed upload URL flow."}}}},"/documents/upload-url":{"post":{"tags":["Documents & extraction"],"summary":"Get a signed URL for a direct upload","operationId":"createUploadUrl","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","content_type","size_bytes"],"properties":{"filename":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer"}}}}}},"responses":{"201":{"description":"Signed URL valid for 15 minutes","content":{"application/json":{"schema":{"type":"object","properties":{"upload_url":{"type":"string","format":"uri"},"document_id":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}}}}}}}}},"/documents/{document_id}":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"get":{"tags":["Documents & extraction"],"summary":"Get document metadata and a short-lived download URL","operationId":"getDocument","responses":{"200":{"description":"Document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}}}},"delete":{"tags":["Documents & extraction"],"summary":"Delete a document (subject to retention and legal hold)","operationId":"deleteDocument","responses":{"204":{"description":"Deleted"},"409":{"description":"Under legal hold","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/documents/{document_id}/extract":{"post":{"tags":["Documents & extraction"],"summary":"Queue AI-assisted abstraction","description":"Runs OCR if needed, then the multi-pass extraction (map, abstract, clauses and special conditions, self-check). Returns a job; poll it or subscribe to `extraction.completed`.","operationId":"extractDocument","parameters":[{"$ref":"#/components/parameters/DocumentId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string","default":"2026-09"},"language_hint":{"type":"string"},"summary_language":{"type":"string","default":"en"}}}}}},"responses":{"202":{"description":"Job queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"$ref":"#/components/responses/PlanLimit"}}}},"/extractions/{extraction_id}":{"get":{"tags":["Documents & extraction"],"summary":"Get an extraction proposal (fields, clauses, special conditions, each with page evidence)","operationId":"getExtraction","parameters":[{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Extraction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Extraction"}}}}}}},"/extractions/{extraction_id}/accept":{"post":{"tags":["Documents & extraction"],"summary":"Accept (with corrections) into a lease draft","description":"Creates or updates the lease draft from the proposal. Every accepted field records who accepted it and the evidence. Nothing is committed until `/leases/{id}/commit`.","operationId":"acceptExtraction","parameters":[{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"lease_id":{"type":"string","description":"Existing draft to update; omitted creates a new draft."},"corrections":{"type":"object","additionalProperties":true,"description":"Field path to corrected value."},"rejected_fields":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Draft lease","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}}}}},"/clauses":{"get":{"tags":["Documents & extraction"],"summary":"Search the clause library across the portfolio","operationId":"searchClauses","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"q","in":"query","schema":{"type":"string"},"description":"Full-text or semantic query, e.g. \"demolition clause expiring within 3 years\"."},{"name":"filter[type]","in":"query","schema":{"type":"string"}},{"name":"filter[jurisdiction]","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Clauses","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Clause"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}}},"/jurisdictions":{"get":{"tags":["Compliance"],"summary":"List jurisdictions (country, subdivision, municipality)","operationId":"listJurisdictions","parameters":[{"name":"filter[parent]","in":"query","schema":{"type":"string"},"example":"AU"}],"responses":{"200":{"description":"Jurisdictions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Jurisdiction"}}}}}}}}}},"/rule-packs":{"get":{"tags":["Compliance"],"summary":"List rule packs with versions","operationId":"listRulePacks","parameters":[{"name":"filter[jurisdiction]","in":"query","schema":{"type":"string"}},{"name":"filter[lease_class]","in":"query","schema":{"$ref":"#/components/schemas/LeaseClass"}},{"name":"effective_on","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Rule packs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RulePack"}}}}}}}}}},"/rule-packs/{rule_pack_id}":{"get":{"tags":["Compliance"],"summary":"Get a rule pack with its rules","operationId":"getRulePack","parameters":[{"name":"rule_pack_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rule pack","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulePack"}}}}}}},"/rule-packs/resolve":{"get":{"tags":["Compliance"],"summary":"Resolve the ordered packs for a jurisdiction and lease class","operationId":"resolveRulePacks","parameters":[{"name":"jurisdiction","in":"query","required":true,"schema":{"type":"string"},"example":"AU-QLD"},{"name":"lease_class","in":"query","required":true,"schema":{"$ref":"#/components/schemas/LeaseClass"}},{"name":"effective_on","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Ordered packs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RulePack"}}}}}}}}}},"/currencies":{"get":{"tags":["Reference data"],"summary":"Supported currencies","operationId":"listCurrencies","responses":{"200":{"description":"Currencies","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/CurrencyCode"},"minor_units":{"type":"integer"},"name":{"type":"string"}}}}}}}}}}}},"/fx-rates":{"get":{"tags":["Reference data"],"summary":"FX rates for a date (or range)","operationId":"listFxRates","parameters":[{"name":"base","in":"query","schema":{"$ref":"#/components/schemas/CurrencyCode"}},{"name":"quote","in":"query","schema":{"$ref":"#/components/schemas/CurrencyCode"}},{"name":"date","in":"query","schema":{"type":"string","format":"date"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Rates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FxRate"}}}}}}}}},"post":{"tags":["Reference data"],"summary":"Upload customer budget rates","description":"Budget or treasury rates used when a portfolio's `fx_policy` is `budget`.","operationId":"uploadBudgetFxRates","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FxRate"}}}}}}},"responses":{"201":{"description":"Stored"}}}},"/index-series":{"get":{"tags":["Reference data"],"summary":"Index series (CPI, ILC, ILAT, VPI, HICP ...) and their latest values","operationId":"listIndexSeries","parameters":[{"name":"filter[jurisdiction]","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Series","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IndexSeries"}}}}}}}}}},"/index-series/{series_id}/values":{"get":{"tags":["Reference data"],"summary":"Values for a series","operationId":"listIndexValues","parameters":[{"name":"series_id","in":"path","required":true,"schema":{"type":"string"},"example":"AU.ABS.CPI.ALL"},{"name":"from","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Values","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string","format":"date"},"value":{"type":"number"},"published_at":{"type":"string","format":"date"}}}}}}}}}}}},"/measurement-standards":{"get":{"tags":["Reference data"],"summary":"Measurement standards","operationId":"listMeasurementStandards","responses":{"200":{"description":"Standards","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"body":{"type":"string"}}}}}}}}}}}},"/portfolio/summary":{"get":{"tags":["Portfolio intelligence"],"summary":"Portfolio summary (the first read)","description":"How many leases, the annual rent and average rent per sqm, how much is expiring in the next 12 months, and how many leases are at risk. All in the portfolio's reporting currency at the as-at spot rate.","operationId":"portfolioSummary","responses":{"200":{"description":"Summary","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortfolioSummary"}}}}}}}}},"/portfolio/expirations":{"get":{"tags":["Portfolio intelligence"],"summary":"Expiration runway","description":"Leases and annual rent expiring in 0 to 6 months, 6 to 12 months, 1 to 2 years, 2 to 5 years and beyond. Timing turns a static lease list into an action horizon.","operationId":"portfolioExpirations","responses":{"200":{"description":"Buckets","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RunwayBucket"}}}}}}}}}},"/portfolio/signals":{"get":{"tags":["Portfolio intelligence"],"summary":"Priority signals","description":"Risk framed as the decision the team needs to make. Each at-risk lease contributes its most urgent signal: option decision needed, expiry approaching with no plan, renewal strategy under review, holding over, occupancy cost above the healthy band, rent above market, a co-tenancy or other special condition, a review due. Every signal carries a headline, why it matters, the date it is anchored to and the days left.\nRisk per lease is scored deterministically from the same inputs (`risks`), so the register, the dashboard and this endpoint always agree.\n","operationId":"portfolioSignals","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":10,"maximum":200}},{"name":"all","in":"query","schema":{"type":"boolean","default":false},"description":"Every signal on every lease rather than the top signal per lease."}],"responses":{"200":{"description":"Signals","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PrioritySignal"}},"risks":{"type":"array","items":{"type":"object","properties":{"leaseId":{"type":"string"},"risk":{"$ref":"#/components/schemas/RiskLevel"},"score":{"type":"integer"},"status":{"type":"string","example":"Decision needed"},"signals":{"type":"integer"}}}}}}}}}}}},"/activity":{"get":{"tags":["Portfolio intelligence"],"summary":"Activity trail (the paper trail)","description":"Every change in the caller's portfolio, newest first: leases created, updated and archived (with the fields that changed), reviews applied, options exercised, tasks closed, imports, sales reports, assets. Per organisation and permanent; the control plane's audit log is separate.","operationId":"listActivity","parameters":[{"name":"leaseId","in":"query","schema":{"type":"string"}},{"name":"kind","in":"query","schema":{"type":"string"},"description":"Prefix match: lease, review, option, task, import, sales, asset, document, critical_date, market, note."},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":500}}],"responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ActivityEvent"}}}}}}}}}},"/reports/export":{"post":{"tags":["Reports & dashboards"],"summary":"Export a report as XLSX or CSV","description":"Runs the definition now, in the caller's scope, and returns the file. Available on every plan.","operationId":"exportReport","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["definition"],"properties":{"definition":{"$ref":"#/components/schemas/ReportDefinition"},"format":{"type":"string","enum":["xlsx","csv"],"default":"csv"},"name":{"type":"string"}}}}}},"responses":{"200":{"description":"The file","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}},"text/csv":{"schema":{"type":"string"}}}}}}},"/report-schedules":{"get":{"tags":["Reports & dashboards"],"summary":"List report schedules (Scheduled reports add-on)","description":"Schedules generate a saved report daily, weekly or monthly, keep the file and email it to named users of the organisation. Files up to 5 MB are attached; larger files are sent as a sign-in link. Returns 404 when the add-on is off.","operationId":"listReportSchedules","responses":{"200":{"description":"Schedules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}}}}}}},"404":{"description":"The Scheduled reports add-on is not on for this organisation"}}}},"/report-runs/{run_id}/file":{"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Reports & dashboards"],"summary":"Download the file a report run produced","description":"Only the run's recipients, the person who ran it, the report's owner and the account owner.","operationId":"getReportRunFile","responses":{"200":{"description":"The file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Not a recipient or owner"},"410":{"description":"The file is no longer kept"}}}},"/reports/run":{"post":{"tags":["Reports & dashboards"],"summary":"Run a report definition","description":"Executes a semantic-layer query and returns rows plus chart-ready series. Respects the caller's scope. Long-running exports go through `/exports`.","operationId":"runReport","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDefinition"},"example":{"name":"Passing rent by country","measure":"passing_rent","group_by":["country"],"filters":{"asset_class":["retail_centre","retail_strip"],"as_at":"2026-09-30"},"reporting_currency":"USD","fx_policy":"as_at_spot","form":"donut"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResult"}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/reports":{"get":{"tags":["Reports & dashboards"],"summary":"List saved reports","operationId":"listReports","responses":{"200":{"description":"Reports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SavedReport"}}}}}}}}},"post":{"tags":["Reports & dashboards"],"summary":"Save a report definition","operationId":"saveReport","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDefinition"}}}},"responses":{"201":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReport"}}}}}}},"/reports/{report_id}/schedule":{"post":{"tags":["Reports & dashboards"],"summary":"Schedule delivery (PDF, XLSX, CSV) to recipients","operationId":"scheduleReport","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cron","format","recipients"],"properties":{"cron":{"type":"string","example":"0 7 1 * *"},"timezone":{"type":"string","example":"Australia/Brisbane"},"format":{"type":"string","enum":["pdf","xlsx","csv"]},"recipients":{"type":"array","items":{"type":"string","format":"email"}}}}}}},"responses":{"201":{"description":"Scheduled"}}}},"/semantic-layer":{"get":{"tags":["Reports & dashboards"],"summary":"Available measures, dimensions and filters","operationId":"getSemanticLayer","responses":{"200":{"description":"Semantic layer","content":{"application/json":{"schema":{"type":"object","properties":{"measures":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"aggregation":{"type":"string"},"unit":{"type":"string"}}}},"dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}}}}}}}}}}}},"/exports":{"post":{"tags":["Reports & dashboards"],"summary":"Start an export job (leases, rent schedules, critical dates, report rows)","operationId":"createExport","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","format"],"properties":{"kind":{"type":"string","enum":["leases","rent_schedules","critical_dates","report"]},"format":{"type":"string","enum":["csv","xlsx","json"]},"report":{"$ref":"#/components/schemas/ReportDefinition"},"filters":{"type":"object","additionalProperties":true}}}}}},"responses":{"202":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}}}}},"/jobs/{job_id}":{"get":{"tags":["Reports & dashboards"],"summary":"Poll a job (export, extraction, import)","operationId":"getJob","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}}}}},"/billing/entitlement":{"get":{"tags":["Billing"],"summary":"Plan, limits and current usage","operationId":"getEntitlement","responses":{"200":{"description":"Entitlement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entitlement"}}}}}}},"/billing/usage":{"get":{"tags":["Billing"],"summary":"Daily usage (active leases, AI abstractions) for a period","operationId":"getUsage","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"active_leases":{"type":"integer"},"ai_abstractions":{"type":"integer"}}}}}}}}}}}},"/billing/checkout-session":{"post":{"tags":["Billing"],"summary":"Create a Stripe Checkout session for an upgrade","operationId":"createCheckoutSession","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan","interval"],"properties":{"plan":{"type":"string","enum":["growth","portfolio"]},"interval":{"type":"string","enum":["month","year"]},"billing_currency":{"$ref":"#/components/schemas/CurrencyCode"},"success_url":{"type":"string","format":"uri"},"cancel_url":{"type":"string","format":"uri"}}}}}},"responses":{"201":{"description":"Session","content":{"application/json":{"schema":{"type":"object","properties":{"checkout_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}}}}}}}}},"/billing/portal-session":{"post":{"tags":["Billing"],"summary":"Create a Stripe Customer Portal session","operationId":"createPortalSession","responses":{"201":{"description":"Session","content":{"application/json":{"schema":{"type":"object","properties":{"portal_url":{"type":"string","format":"uri"}}}}}}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook subscriptions","operationId":"listWebhooks","responses":{"200":{"description":"Subscriptions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscription"}}}}}}}}},"post":{"tags":["Webhooks"],"summary":"Create a subscription","operationId":"createWebhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionInput"},"example":{"url":"https://erp.example.com/hooks/leaseiq","events":["lease.committed","review.applied","task.due","extraction.completed"],"description":"ERP sync"}}}},"responses":{"201":{"description":"Created; the `secret` is shown once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscription"}}}}}}},"/webhooks/{webhook_id}":{"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["Webhooks"],"summary":"Delete a subscription","operationId":"deleteWebhook","responses":{"204":{"description":"Deleted"}}}},"/webhooks/{webhook_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Delivery attempts (for debugging)","operationId":"listWebhookDeliveries","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deliveries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}}}}}}}},"/webhooks/{webhook_id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a signed test event","operationId":"testWebhook","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Queued"}}}},"/events":{"get":{"tags":["Webhooks"],"summary":"Event log (pull alternative to webhooks)","description":"Ordered, replayable stream of domain events for the account. Use `after` with the last event id you processed.","operationId":"listEvents","parameters":[{"name":"after","in":"query","schema":{"type":"string"}},{"name":"filter[type][in]","in":"query","schema":{"type":"string"}},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}}},"/audit-log":{"get":{"tags":["Audit"],"summary":"Audit entries (before/after, actor, source)","operationId":"listAuditLog","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[entity_type]","in":"query","schema":{"type":"string"},"example":"lease"},{"name":"filter[entity_id]","in":"query","schema":{"type":"string"}},{"name":"filter[occurred_at][gte]","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Audit entries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditEntry"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}}},"/imports":{"get":{"tags":["Bulk import"],"summary":"List import batches","operationId":"listImports","responses":{"200":{"description":"Batches","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ImportBatch"}}}}}}}}},"post":{"tags":["Bulk import"],"summary":"Upload any CSV/XLSX and get proposed column mappings (nothing is written yet)","description":"Step 1 of 4. Reads the first sheet, skips title rows above the header, samples values and proposes a target field per column from header synonyms and value shapes. A saved mapping template is applied when its columns match. Steps: upload, map, validate (dry run), commit; undo any time.","operationId":"createImport","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"template":{"type":"string","description":"Mapping template id to apply"}}}}}},"responses":{"201":{"description":"Batch staged","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportBatch"},"skippedRows":{"type":"integer"},"templateApplied":{"type":"string","nullable":true}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/imports/templates":{"get":{"tags":["Bulk import"],"summary":"List mapping templates and the field catalogue","operationId":"listImportTemplates","responses":{"200":{"description":"Templates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MappingTemplate"}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"entity":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"}}}}}}}}}}},"post":{"tags":["Bulk import"],"summary":"Save a mapping as a reusable template (per source system)","operationId":"saveImportTemplate","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingTemplate"}}}},"responses":{"201":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MappingTemplate"}}}}}}}}},"/imports/{import_id}":{"get":{"tags":["Bulk import"],"summary":"Get an import batch (mappings, defaults, sample, status)","operationId":"getImport","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Batch","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportBatch"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/imports/{import_id}/validate":{"post":{"tags":["Bulk import"],"summary":"Save mapping and defaults, run the dry run","description":"Steps 2 and 3. Normalises every row (dates in any format, money with symbols and per-month/per-week, areas in sqm or sq ft, state names to jurisdictions, review types, option strings like \"2 x 5\"), validates against required fields and rule packs, and returns row-level issues plus a reconciliation summary (properties, tenants, live leases, passing rent by currency, area, WALE, expiry profile) to check against the source.","operationId":"validateImport","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mappings":{"type":"array","items":{"$ref":"#/components/schemas/ColumnMapping"}},"defaults":{"$ref":"#/components/schemas/ImportDefaults"}}}}}},"responses":{"200":{"description":"Dry run result","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","additionalProperties":true},"issues":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer"},"severity":{"type":"string","enum":["error","warning"]},"field":{"type":"string"},"message":{"type":"string"}}}},"preview":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/imports/{import_id}/commit":{"post":{"tags":["Bulk import"],"summary":"Commit rows without errors (idempotent on lease reference)","description":"Step 4. Properties, premises and parties are matched by name; leases by reference, so re-running the same file updates rather than duplicates. Critical dates for reviews and security expiries are generated. Rows with errors are skipped and listed.","operationId":"commitImport","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Committed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportBatch"},"skipped":{"type":"array","items":{"type":"integer"}}}}}}}}}},"/imports/{import_id}/undo":{"post":{"tags":["Bulk import"],"summary":"Undo a committed batch (removes everything it created)","operationId":"undoImport","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Undone","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportBatch"}}}}}}}}},"/leases/{lease_id}/accounting/schedule":{"get":{"tags":["Lease accounting"],"summary":"IFRS 16 / ASC 842 / AASB 16 schedule for a lease (occupier side)","description":"Right-of-use asset and lease liability schedules computed from the rent schedule, incentives, initial direct costs and the incremental borrowing rate. Supports modification and remeasurement history.","operationId":"getLeaseAccountingSchedule","parameters":[{"$ref":"#/components/parameters/LeaseId"},{"name":"standard","in":"query","schema":{"type":"string","enum":["IFRS16","ASC842_operating","ASC842_finance","AASB16","GASB87","FRS102"],"default":"IFRS16"}},{"name":"discount_rate","in":"query","schema":{"type":"number","example":0.055},"description":"Incremental borrowing rate; defaults to the lease's stored rate."},{"name":"reporting_currency","in":"query","schema":{"$ref":"#/components/schemas/CurrencyCode"}}],"responses":{"200":{"description":"Schedule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingSchedule"}}}}}}},"/leases/{lease_id}/accounting/journals":{"get":{"tags":["Lease accounting"],"summary":"Journal entries for a period (interest, depreciation, liability reduction)","operationId":"getLeaseJournals","parameters":[{"$ref":"#/components/parameters/LeaseId"},{"name":"period","in":"query","required":true,"schema":{"type":"string","example":"2026-10"}}],"responses":{"200":{"description":"Journals","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/JournalEntry"}}}}}}}}}},"/accounting/disclosures":{"get":{"tags":["Lease accounting"],"summary":"Disclosure report (maturity analysis, weighted average IBR, expense by class)","operationId":"getAccountingDisclosures","parameters":[{"name":"period_end","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"standard","in":"query","schema":{"type":"string"}},{"name":"reporting_currency","in":"query","schema":{"$ref":"#/components/schemas/CurrencyCode"}}],"responses":{"200":{"description":"Disclosures","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/ledger/connections":{"get":{"tags":["Ledger & trust accounting"],"summary":"Connected accounting systems (Xero, MYOB, QuickBooks, Business Central, NetSuite, Sage)","operationId":"listLedgerConnections","responses":{"200":{"description":"Connections","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LedgerConnection"}}}}}}}}},"post":{"tags":["Ledger & trust accounting"],"summary":"Start an OAuth connection to a ledger","operationId":"createLedgerConnection","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider","entity_id"],"properties":{"provider":{"type":"string","enum":["xero","myob","quickbooks","business_central","netsuite","sage_intacct"]},"entity_id":{"type":"string","description":"The owning entity whose ledger this is."},"redirect_url":{"type":"string","format":"uri"}}}}}},"responses":{"201":{"description":"Authorisation URL","content":{"application/json":{"schema":{"type":"object","properties":{"authorize_url":{"type":"string","format":"uri"}}}}}}}}},"/ledger/charge-runs":{"post":{"tags":["Ledger & trust accounting"],"summary":"Generate the charge run for a period (invoices to tenants)","description":"Idempotent per entity and period. Produces invoices (rent, recoveries, parking, turnover, adjustments) with tax codes and pushes them to the connected ledger or the built-in trust ledger.","operationId":"createChargeRun","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entity_id","period"],"properties":{"entity_id":{"type":"string"},"period":{"type":"string","example":"2026-10"},"dry_run":{"type":"boolean","default":false}}}}}},"responses":{"202":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}}}}},"/ledger/invoices":{"get":{"tags":["Ledger & trust accounting"],"summary":"Invoices and their payment status","operationId":"listInvoices","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[lease_id]","in":"query","schema":{"type":"string"}},{"name":"filter[status][in]","in":"query","schema":{"type":"string"},"example":"open,overdue"}],"responses":{"200":{"description":"Invoices","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}}},"/ledger/receipts":{"post":{"tags":["Ledger & trust accounting"],"summary":"Record a receipt (trust accounting) or import bank feed matches","operationId":"createReceipt","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["invoice_id","amount","received_on"],"properties":{"invoice_id":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"},"received_on":{"type":"string","format":"date"},"method":{"type":"string","enum":["bank_transfer","direct_debit","card","cheque","other"]},"bank_ref":{"type":"string"}}}}}},"responses":{"201":{"description":"Receipt recorded"}}}},"/ledger/arrears":{"get":{"tags":["Ledger & trust accounting"],"summary":"Arrears by lease with ageing buckets","operationId":"getArrears","parameters":[{"name":"as_at","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Arrears","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"lease_id":{"type":"string"},"tenant_id":{"type":"string"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"current":{"type":"string"},"days_30":{"type":"string"},"days_60":{"type":"string"},"days_90_plus":{"type":"string"},"total":{"type":"string"}}}}}}}}}}}},"/ledger/trust-reconciliation":{"post":{"tags":["Ledger & trust accounting"],"summary":"Run the end-of-month trust account reconciliation (jurisdictions with agent trust rules)","operationId":"runTrustReconciliation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entity_id","period"],"properties":{"entity_id":{"type":"string"},"period":{"type":"string"}}}}}},"responses":{"202":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}}}}},"/tenant-portal/invitations":{"post":{"tags":["Tenant portal"],"summary":"Invite a tenant contact to the portal","operationId":"inviteTenant","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["party_id","email"],"properties":{"party_id":{"type":"string"},"email":{"type":"string","format":"email"},"lease_ids":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Invitation sent"}}}},"/tenant-portal/me/leases":{"get":{"tags":["Tenant portal"],"summary":"Leases visible to the signed-in tenant (portal token)","operationId":"tenantListLeases","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Tenant view of leases (rent, next charges, documents shared with the tenant, critical dates that concern the tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaseList"}}}}}}},"/tenant-portal/me/invoices":{"get":{"tags":["Tenant portal"],"summary":"Tenant invoices and payment links","operationId":"tenantListInvoices","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Invoices","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}}}}}}},"/tenant-portal/me/turnover":{"post":{"tags":["Tenant portal"],"summary":"Submit certified turnover (retail)","operationId":"tenantSubmitTurnover","security":[{"tenantToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lease_id","period","gross_turnover"],"properties":{"lease_id":{"type":"string"},"period":{"type":"string"},"gross_turnover":{"$ref":"#/components/schemas/Money"},"certificate_document_id":{"type":"string"}}}}}},"responses":{"201":{"description":"Recorded; turnover rent recalculated"}}}},"/tenant-portal/me/requests":{"post":{"tags":["Tenant portal"],"summary":"Raise a maintenance or general request","operationId":"tenantCreateRequest","security":[{"tenantToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrderInput"}}}},"responses":{"201":{"description":"Work order created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrder"}}}}}}},"/work-orders":{"get":{"tags":["Maintenance & work orders"],"summary":"List work orders","operationId":"listWorkOrders","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[property_id]","in":"query","schema":{"type":"string"}},{"name":"filter[state][in]","in":"query","schema":{"type":"string"}},{"name":"filter[priority]","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Work orders","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkOrder"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}},"post":{"tags":["Maintenance & work orders"],"summary":"Create a work order","operationId":"createWorkOrder","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrderInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrder"}}}}}}},"/work-orders/{work_order_id}/transition":{"post":{"tags":["Maintenance & work orders"],"summary":"Move a work order through its lifecycle (assign, quote, approve, complete, close)","operationId":"transitionWorkOrder","parameters":[{"name":"work_order_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["assign","quote","approve","start","complete","close","cancel"]},"contractor_id":{"type":"string"},"quote":{"$ref":"#/components/schemas/Money"},"recoverable":{"type":"boolean","description":"Whether the cost is recoverable from tenants under the lease."},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrder"}}}}}}},"/contractors":{"get":{"tags":["Maintenance & work orders"],"summary":"Contractor register with compliance documents (insurance, licences)","operationId":"listContractors","responses":{"200":{"description":"Contractors","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"trades":{"type":"array","items":{"type":"string"}},"insurance_expiry":{"type":"string","format":"date"},"compliant":{"type":"boolean"}}}}}}}}}}}},"/inspections":{"post":{"tags":["Maintenance & work orders"],"summary":"Record an inspection or condition report (with photos)","operationId":"createInspection","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["property_id","kind"],"properties":{"property_id":{"type":"string"},"premises_id":{"type":"string"},"lease_id":{"type":"string"},"kind":{"type":"string","enum":["routine","entry","exit","make_good","fire_safety","other"]},"notes":{"type":"string"},"photos":{"type":"array","items":{"type":"string","format":"binary"}}}}}}},"responses":{"201":{"description":"Created"}}}},"/deals":{"get":{"tags":["Leasing deals"],"summary":"Leasing pipeline (enquiry → proposal → heads of agreement → lease)","operationId":"listDeals","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[stage][in]","in":"query","schema":{"type":"string"}},{"name":"filter[premises_id]","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Deals","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Deal"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}},"post":{"tags":["Leasing deals"],"summary":"Create a deal for a vacancy or a renewal","operationId":"createDeal","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}}}}},"/deals/{deal_id}/proposals":{"post":{"tags":["Leasing deals"],"summary":"Add a proposal (terms) and get the effective rent and comparison to passing and benchmark","operationId":"createDealProposal","parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealProposal"}}}},"responses":{"201":{"description":"Proposal with computed economics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealProposal"}}}}}}},"/deals/{deal_id}/convert":{"post":{"tags":["Leasing deals"],"summary":"Convert the agreed proposal into a lease draft","operationId":"convertDeal","parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"Draft lease","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lease"}}}}}}},"/market/comparables":{"get":{"tags":["Market data"],"summary":"Comparables (customer-entered and licensed feeds) filtered for comparability","operationId":"listComparables","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string"}},{"name":"asset_class","in":"query","required":true,"schema":{"$ref":"#/components/schemas/AssetClass"}},{"name":"submarket","in":"query","schema":{"type":"string"}},{"name":"area_band","in":"query","schema":{"type":"string","example":"500-1000"}},{"name":"since","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Comparables","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Comparable"}},"benchmark":{"type":"object","properties":{"median_rent_per_unit":{"type":"number"},"unit":{"$ref":"#/components/schemas/RentUnit"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"sample_size":{"type":"integer"},"as_at":{"type":"string","format":"date"}}}}}}}}}},"post":{"tags":["Market data"],"summary":"Add a comparable","operationId":"createComparable","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comparable"}}}},"responses":{"201":{"description":"Created"}}}},"/market/gap":{"get":{"tags":["Market data"],"summary":"Market gap per lease (passing vs benchmark) across the scope","operationId":"getMarketGap","parameters":[{"name":"as_at","in":"query","schema":{"type":"string","format":"date"}},{"name":"filter[property_id]","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Gap analysis","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"lease_id":{"type":"string"},"passing_per_unit":{"type":"number"},"benchmark_per_unit":{"type":"number"},"unit":{"$ref":"#/components/schemas/RentUnit"},"gap_pct":{"type":"number"},"benchmark_source":{"type":"string"},"benchmark_as_at":{"type":"string","format":"date"}}}}}}}}}}}},"/integrations":{"get":{"tags":["Integrations"],"summary":"Integration catalogue (ledgers, CRM, document signing, calendars, BI, data feeds) and their status","operationId":"listIntegrations","responses":{"200":{"description":"Integrations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","example":"xero"},"name":{"type":"string"},"category":{"type":"string","enum":["ledger","crm","esign","calendar","bi","market_data","storage","identity","messaging"]},"status":{"type":"string","enum":["available","connected","error"]},"docs_url":{"type":"string","format":"uri"}}}}}}}}}}}},"/integrations/{key}/connect":{"post":{"tags":["Integrations"],"summary":"Connect an integration (returns an OAuth URL or accepts credentials)","operationId":"connectIntegration","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"201":{"description":"Connected or authorisation URL","content":{"application/json":{"schema":{"type":"object","properties":{"authorize_url":{"type":"string","format":"uri"},"status":{"type":"string"}}}}}}}}},"/integrations/esign/envelopes":{"post":{"tags":["Integrations"],"summary":"Send a lease or notice for e-signature (DocuSign, Adobe Sign)","operationId":"createEnvelope","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["document_id","signers"],"properties":{"document_id":{"type":"string"},"signers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"role":{"type":"string"}}}},"provider":{"type":"string","enum":["docusign","adobe_sign"]}}}}}},"responses":{"202":{"description":"Envelope sent; `document.signed` will be raised on completion"}}}},"/api-keys":{"get":{"tags":["Integrations"],"summary":"List API keys (prefix, capabilities, last used)","operationId":"listApiKeys","responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"prefix":{"type":"string","example":"liq_live_ab12"},"name":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"scope":{"type":"object"},"last_used_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}}}}}}}}}}},"post":{"tags":["Integrations"],"summary":"Create an API key (secret shown once)","operationId":"createApiKey","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","capabilities"],"properties":{"name":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"scope":{"type":"object","properties":{"type":{"type":"string","enum":["account","portfolio","property","lease"]},"ids":{"type":"array","items":{"type":"string"}}}},"expires_at":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"Key","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string","description":"Shown once."}}}}}}}}},"/sites":{"get":{"tags":["Sites & franchise"],"summary":"List sites (occupier view; a trading location with its agreements)","operationId":"listSites","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[ownership]","in":"query","schema":{"type":"string","enum":["company","franchised"]}},{"name":"filter[region]","in":"query","schema":{"type":"string"}},{"name":"filter[co_terminous]","in":"query","schema":{"type":"string","enum":["aligned","issues"]}}],"responses":{"200":{"description":"Sites","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Site"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}},"post":{"tags":["Sites & franchise"],"summary":"Create a site and attach agreements","operationId":"createSite","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}}}}},"/sites/{site_id}":{"parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Sites & franchise"],"summary":"Site with head lease, sublease, franchise agreement, co-terminous check and occupancy cost","operationId":"getSite","responses":{"200":{"description":"Site","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}}}}},"/sites/{site_id}/sales":{"post":{"tags":["Sites & franchise"],"summary":"Post sales for a period (POS or finance feed, or franchisee submission)","operationId":"postSiteSales","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["period","gross_sales"],"properties":{"period":{"type":"string","example":"2026-09"},"gross_sales":{"$ref":"#/components/schemas/Money"},"transactions":{"type":"integer"},"source":{"type":"string","enum":["pos","finance","franchisee_portal","manual"]}}}}}},"responses":{"201":{"description":"Recorded; occupancy cost ratio, turnover rent and royalties recalculated"}}}},"/sites/{site_id}/decision":{"post":{"tags":["Sites & franchise"],"summary":"Record a renewal decision (renew, renegotiate, relocate, close) with rationale","operationId":"recordSiteDecision","parameters":[{"name":"site_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["decision"],"properties":{"decision":{"type":"string","enum":["renew","renegotiate","relocate","close","defer"]},"rationale":{"type":"string"},"target_rent":{"$ref":"#/components/schemas/Money"},"approved_by":{"type":"string"}}}}}},"responses":{"201":{"description":"Decision recorded; deal or task created"}}}},"/franchise-agreements":{"get":{"tags":["Sites & franchise"],"summary":"List franchise agreements","operationId":"listFranchiseAgreements","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[state]","in":"query","schema":{"type":"string"}},{"name":"filter[end_of_term_notice_due][lte]","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Agreements","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FranchiseAgreement"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}},"post":{"tags":["Sites & franchise"],"summary":"Create a franchise agreement (draft); rule packs such as the Franchising Code are resolved by jurisdiction","operationId":"createFranchiseAgreement","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FranchiseAgreementInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FranchiseAgreement"}}}}}}},"/franchise-agreements/{agreement_id}/notice":{"post":{"tags":["Sites & franchise"],"summary":"Record the end-of-term notice (franchisor intention to renew or not)","operationId":"franchiseEndOfTermNotice","parameters":[{"name":"agreement_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["served_on","intention"],"properties":{"served_on":{"type":"string","format":"date"},"intention":{"type":"string","enum":["renew","new_agreement","not_renew"]},"document_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FranchiseAgreement"}}}}}}},"/franchise-agreements/{agreement_id}/renew":{"post":{"tags":["Sites & franchise"],"summary":"Renew; optionally align the sublease and head lease option in the same command","operationId":"renewFranchiseAgreement","parameters":[{"name":"agreement_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"term_months":{"type":"integer"},"align_sublease":{"type":"boolean","default":true},"exercise_head_lease_option_id":{"type":"string"}}}}}},"responses":{"201":{"description":"Renewed agreement (and aligned agreements)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FranchiseAgreement"}}}}}}},"/certifications":{"get":{"tags":["Certifications"],"summary":"Certification and licence register","operationId":"listCertifications","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"filter[status][in]","in":"query","schema":{"type":"string"},"example":"expiring,expired,missing"},{"name":"filter[subject_kind]","in":"query","schema":{"type":"string","enum":["property","site","lease","party"]}},{"name":"filter[category]","in":"query","schema":{"type":"string"}},{"name":"filter[expires_on][lte]","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Certifications","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Certification"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}}},"post":{"tags":["Certifications"],"summary":"Add a certification with evidence","operationId":"createCertification","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificationInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Certification"}}}}}}},"/certifications/{certification_id}/renew":{"post":{"tags":["Certifications"],"summary":"Record a renewal (new issue and expiry dates, evidence document)","operationId":"renewCertification","parameters":[{"name":"certification_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issued_on","expires_on"],"properties":{"issued_on":{"type":"string","format":"date"},"expires_on":{"type":"string","format":"date"},"reference":{"type":"string"},"evidence_document_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Renewed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Certification"}}}}}}},"/certification-templates":{"get":{"tags":["Certifications"],"summary":"Requirement templates by permitted use, asset class and jurisdiction (e.g. dental practice in AU-QLD)","operationId":"listCertificationTemplates","parameters":[{"name":"permitted_use","in":"query","schema":{"type":"string"},"example":"dental_practice"},{"name":"jurisdiction","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Templates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"applies_to":{"type":"object","additionalProperties":true},"required":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"name":{"type":"string"},"issuer":{"type":"string"},"renewal_lead_days":{"type":"integer"},"legal_basis":{"type":"string"}}}}}}}}}}}}}}},"/certification-templates/{template_id}/apply":{"post":{"tags":["Certifications"],"summary":"Apply a template to a subject, creating expected (missing) certifications and tasks","operationId":"applyCertificationTemplate","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"type":"object","properties":{"kind":{"type":"string","enum":["property","site","lease","party"]},"id":{"type":"string"}}}}}}}},"responses":{"201":{"description":"Register entries created"}}}},"/owner-portal/me/statements":{"get":{"tags":["Owner portal"],"summary":"Owner statements (managing-agent scenario; landlord as client)","operationId":"ownerListStatements","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Statements with income, fees, outgoings paid and disbursement per period","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"income":{"$ref":"#/components/schemas/Money"},"fees":{"$ref":"#/components/schemas/Money"},"outgoings_paid":{"$ref":"#/components/schemas/Money"},"disbursed":{"$ref":"#/components/schemas/Money"},"statement_document_id":{"type":"string"}}}}}}}}}}}},"/owner-portal/me/approvals":{"get":{"tags":["Owner portal"],"summary":"Items awaiting the owner's approval (work orders over threshold, lease proposals)","operationId":"ownerListApprovals","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Approvals","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["work_order","deal_proposal","lease_commit"]},"summary":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"},"due_by":{"type":"string","format":"date"}}}}}}}}}}}},"/sales":{"get":{"tags":["Sales and turnover"],"summary":"Turnover summary for every lease in scope with turnover terms","operationId":"salesSummary","responses":{"200":{"description":"Per-lease summary","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TurnoverSummary"}}}}}}}}},"post":{"tags":["Sales and turnover"],"summary":"Bulk sales submission (chains, POS integrations)","description":"Up to 5,000 reports per call. Idempotent on (lease_id, period): a resubmission replaces the figure and the previous value is kept for audit. Landlord and occupier users record as accepted; tenant tokens record as submitted for the landlord to accept.","operationId":"submitSalesBulk","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reports"],"properties":{"source":{"type":"string","enum":["api","pos"],"default":"api"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/SalesSubmission"}}}}}}},"responses":{"201":{"description":"Results per row","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"lease_id":{"type":"string"},"period":{"type":"string"},"status":{"type":"string","enum":["recorded","not_found"]}}}},"recorded":{"type":"integer"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/sales/import":{"post":{"tags":["Sales and turnover"],"summary":"Upload a sales spreadsheet (CSV/XLSX); preview or commit","description":"Columns are detected from headers: lease reference, shop number or tenant name to match the lease; period as 2026-08, Aug 2026 or any date in the month; gross sales with currency symbols; optional transactions. `commit=false` previews with per-row issues.","operationId":"importSales","parameters":[{"name":"commit","in":"query","schema":{"type":"boolean","default":false}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Preview or import result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/leases/{lease_id}/sales":{"get":{"tags":["Sales and turnover"],"summary":"Sales reports for a lease with its turnover terms","operationId":"listLeaseSales","parameters":[{"name":"lease_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Reports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SalesReport"}},"terms":{"$ref":"#/components/schemas/TurnoverTerms"}}}}}}}},"post":{"tags":["Sales and turnover","Tenant portal"],"summary":"Submit one period of sales (tenant token or account user)","operationId":"submitLeaseSales","security":[{"tenantToken":[]},{"apiKey":[]}],"parameters":[{"name":"lease_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["period","gross_sales"],"properties":{"period":{"type":"string","example":"2026-09"},"gross_sales":{"type":"number"},"net_sales":{"type":"number"},"transactions":{"type":"integer"},"note":{"type":"string"}}}}}},"responses":{"201":{"description":"Recorded","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SalesReport"}}}}}}}}},"/assets":{"get":{"tags":["Assets"],"summary":"Asset register with derived end-of-life, next service and a capex forecast","operationId":"listAssets","parameters":[{"name":"subject","in":"query","schema":{"type":"string"},"description":"Property or site id"},{"name":"category","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Assets","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Asset"}},"capex_forecast":{"type":"array","items":{"type":"object","properties":{"fy":{"type":"string"},"amount":{"type":"number"},"items":{"type":"integer"}}}}}}}}}}},"post":{"tags":["Assets"],"summary":"Create or update an asset","operationId":"saveAsset","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"responses":{"201":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Asset"}}}}}}}}},"/notifications":{"get":{"tags":["Notifications"],"summary":"The caller's inbox","operationId":"listNotifications","parameters":[{"name":"unread","in":"query","schema":{"type":"boolean"}},{"name":"kind","in":"query","schema":{"type":"string","enum":["task_due","task_overdue","review_ready","option_window","security_expiry","compliance","import","platform","partner","billing","system"]}}],"responses":{"200":{"description":"Notifications","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"unread":{"type":"integer"}}}}}}}},"patch":{"tags":["Notifications"],"summary":"Mark notifications read or unread","operationId":"markNotifications","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["all"]}]},"read":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Updated count","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer"}}}}}}}}},"/notifications/preferences":{"get":{"tags":["Notifications"],"summary":"Notification preferences for the caller","operationId":"getNotificationPreferences","responses":{"200":{"description":"Preferences","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NotificationPreferences"}}}}}}}},"put":{"tags":["Notifications"],"summary":"Update preferences (channels, digest, kinds)","operationId":"updateNotificationPreferences","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NotificationPreferences"}}}}}}}}},"/notifications/digest":{"get":{"tags":["Notifications"],"summary":"Preview the caller's email digest as HTML","operationId":"previewDigest","responses":{"200":{"description":"HTML","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/calendar/{token}.ics":{"get":{"tags":["Notifications"],"summary":"Per-user calendar feed of dated items (subscribe from Outlook, Google or Apple Calendar)","description":"Token-authenticated, no session. Served from app.tenutaiq.com/api/calendar/{token}.ics. Disable or regenerate the token from preferences.","operationId":"calendarFeed","security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"iCalendar","content":{"text/calendar":{"schema":{"type":"string"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/platform/cells":{"get":{"tags":["Platform (control plane)"],"summary":"List cells (regional deployments) with health, versions and cost","operationId":"platformListCells","security":[{"platformToken":[]}],"responses":{"200":{"description":"Cells","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Cell"}}}}}}},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/platform/partners":{"get":{"tags":["Platform (control plane)"],"summary":"List partners with rolled-up analytics","operationId":"platformListPartners","security":[{"platformToken":[]}],"responses":{"200":{"description":"Partners","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Partner"},{"type":"object","properties":{"analytics":{"$ref":"#/components/schemas/PartnerAnalytics"}}}]}}}}}}}}},"post":{"tags":["Platform (control plane)"],"summary":"Create a partner (starts provisioning and sends the partner-admin invite)","operationId":"platformCreatePartner","security":[{"platformToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Partner"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/platform/organisations":{"get":{"tags":["Platform (control plane)"],"summary":"List organisations across cells (metadata and usage only, no lease data)","operationId":"platformListOrganisations","security":[{"platformToken":[]}],"parameters":[{"name":"cell","in":"query","schema":{"type":"string"}},{"name":"partner","in":"query","schema":{"type":"string"}},{"name":"plan","in":"query","schema":{"type":"string","enum":["free","growth","enterprise"]}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Organisations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Organisation"}},"nextCursor":{"type":"string","nullable":true},"total":{"type":"integer"}}}}}}}}},"/platform/organisations/{organisation_id}/support-session":{"post":{"tags":["Platform (control plane)"],"summary":"Start a time-boxed, audited support session inside the organisation's cell","description":"Creates a short-lived impersonation grant (default 60 minutes) in the cell that holds the organisation. The organisation owner is notified; every action taken is written to the cell audit log with the support ticket reference.","operationId":"platformStartSupportSession","security":[{"platformToken":[]}],"parameters":[{"name":"organisation_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ticket","reason"],"properties":{"ticket":{"type":"string"},"reason":{"type":"string"},"minutes":{"type":"integer","default":60,"maximum":240}}}}}},"responses":{"201":{"description":"Session grant","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}}}}}}}}},"/platform/usage":{"get":{"tags":["Platform (control plane)"],"summary":"Platform usage summary and daily aggregates per cell and partner","operationId":"platformUsage","security":[{"platformToken":[]}],"parameters":[{"name":"cell","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","additionalProperties":true},"days":{"type":"array","items":{"$ref":"#/components/schemas/UsageDay"}}}}}}}}}},"/platform/flags":{"get":{"tags":["Platform (control plane)"],"summary":"List feature flags and config with scopes, rollout and overrides","operationId":"platformListFlags","security":[{"platformToken":[]}],"responses":{"200":{"description":"Flags","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FeatureFlag"}}}}}}}}},"patch":{"tags":["Platform (control plane)"],"summary":"Enable or disable a flag, or change its rollout or overrides","operationId":"platformUpdateFlag","security":[{"platformToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"type":"string"},"enabled":{"type":"boolean"},"rollout":{"type":"integer","minimum":0,"maximum":100},"overrides":{"type":"array","items":{"type":"object","properties":{"target":{"type":"string"},"enabled":{"type":"boolean"}}}}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FeatureFlag"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/platform/audit":{"get":{"tags":["Platform (control plane)"],"summary":"Control-plane audit log","operationId":"platformAudit","security":[{"platformToken":[]}],"responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}}}}}}}}}},"/partner/branding":{"get":{"tags":["Partner (white label)"],"summary":"Current branding, custom domains and default subdomain for the calling partner","operationId":"partnerGetBranding","security":[{"partnerToken":[]}],"responses":{"200":{"description":"Branding","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Branding"},"domains":{"type":"array","items":{"$ref":"#/components/schemas/CustomDomain"}},"slug":{"type":"string"}}}}}}}},"put":{"tags":["Partner (white label)"],"summary":"Update branding (logo, product name, colours, support email, login blurb)","operationId":"partnerUpdateBranding","security":[{"partnerToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Branding"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Branding"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/partner/domains":{"post":{"tags":["Partner (white label)"],"summary":"Add a custom domain; returns the CNAME target to configure","description":"The domain becomes active once the CNAME resolves and the certificate is issued (usually minutes). Until then the partner subdomain keeps working.","operationId":"partnerAddDomain","security":[{"partnerToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["host"],"properties":{"host":{"type":"string","example":"leases.yourcompany.com"}}}}}},"responses":{"201":{"description":"Domain added","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomDomain"}},"cname":{"type":"string","example":"cname.tenutaiq.com"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/partner/customers":{"get":{"tags":["Partner (white label)"],"summary":"Organisations brought in by this partner","operationId":"partnerListCustomers","security":[{"partnerToken":[]}],"responses":{"200":{"description":"Customers","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Organisation"}}}}}}}}},"post":{"tags":["Partner (white label)"],"summary":"Invite a new customer organisation under this partner's brand","operationId":"partnerInviteCustomer","security":[{"partnerToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","owner_email","country"],"properties":{"name":{"type":"string"},"owner_email":{"type":"string","format":"email"},"country":{"type":"string"},"plan":{"type":"string","enum":["free","growth","enterprise"],"default":"free"},"perspective":{"type":"string","enum":["landlord","occupier","agent","franchisor"]}}}}}},"responses":{"201":{"description":"Invited","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Organisation"}}}}}}}}},"/partner/analytics":{"get":{"tags":["Partner (white label)"],"summary":"Analytics rolled up over this partner's customers","operationId":"partnerAnalytics","security":[{"partnerToken":[]}],"responses":{"200":{"description":"Analytics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PartnerAnalytics"},"days":{"type":"array","items":{"$ref":"#/components/schemas/UsageDay"}}}}}}}}}},"/partner/statements":{"get":{"tags":["Partner (white label)"],"summary":"Monthly wholesale invoices or revenue-share statements","operationId":"partnerStatements","security":[{"partnerToken":[]}],"responses":{"200":{"description":"Statements","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string","example":"2026-09"},"kind":{"type":"string","enum":["wholesale_invoice","revenue_share_statement","referral_statement"]},"amount":{"$ref":"#/components/schemas/Money"},"pdf_url":{"type":"string","format":"uri"}}}}}}}}}}}}},"webhooks":{"lease.committed":{"post":{"summary":"A lease version was committed","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"},"example":{"id":"evt_01J9","type":"lease.committed","occurred_at":"2026-09-30T02:14:05Z","account_id":"acc_01HZ","data":{"lease_id":"lease_01J8","version":1,"reason":"initial"},"links":{"lease":"/v1/leases/lease_01J8"}}}}},"responses":{"200":{"description":"Acknowledged (any 2xx)"}}}},"review.applied":{"post":{"summary":"A rent review was applied to the schedule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}},"option.exercised":{"post":{"summary":"An option was exercised and a renewal lease created","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}},"task.due":{"post":{"summary":"A critical-date task reached its lead time","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}},"task.closed":{"post":{"summary":"A task was closed with an outcome","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}},"extraction.completed":{"post":{"summary":"AI abstraction finished (proposal ready for review)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}},"lease.expired":{"post":{"summary":"A lease passed its expiry without renewal","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}},"charges.generated":{"post":{"summary":"Charge lines for a period are ready for the ledger","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}},"rule_pack.published":{"post":{"summary":"A rule pack version was published (affected leases listed)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}},"billing.changed":{"post":{"summary":"Plan or entitlement changed","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledged"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"liq_live_… or liq_test_…","description":"API key created in Settings › API keys, sent as a Bearer token."},"tenantToken":{"type":"http","scheme":"bearer","description":"Short-lived token issued to a tenant portal user; scoped to that tenant's leases."},"platformToken":{"type":"http","scheme":"bearer","description":"Control-plane token (SSO session or service key) for platform_admin; issued only on admin.tenutaiq.com behind the IP allowlist."},"partnerToken":{"type":"http","scheme":"bearer","description":"Partner API key (liq_partner_…) or partner-admin session; scoped to exactly one partner."},"oauth2":{"type":"oauth2","description":"Partner platforms acting for many accounts.","flows":{"clientCredentials":{"tokenUrl":"https://auth.tenutaiq.com/oauth/token","scopes":{"leases:read":"Read leases, rent schedules, options, reviews","leases:write":"Create drafts, correct attributes, run commands","properties:read":"Read portfolios, properties, premises, parties","properties:write":"Manage portfolios, properties, premises, parties","dates:read":"Read critical dates and tasks","dates:write":"Acknowledge, reassign and close tasks","documents:read":"Read document metadata and download","documents:write":"Upload and extract","reports:run":"Run reports and exports","billing:read":"Read entitlement and usage","billing:manage":"Create checkout and portal sessions","webhooks:manage":"Manage subscriptions","audit:read":"Read the audit log"}}}}},"parameters":{"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},"Cursor":{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from `meta.next_cursor`."},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","schema":{"type":"string","format":"uuid"},"description":"Recommended on every POST."},"IfMatch":{"name":"If-Match","in":"header","schema":{"type":"string"},"description":"ETag from the last GET."},"AccountId":{"name":"account_id","in":"path","required":true,"schema":{"type":"string"}},"PortfolioId":{"name":"portfolio_id","in":"path","required":true,"schema":{"type":"string"}},"PropertyId":{"name":"property_id","in":"path","required":true,"schema":{"type":"string"}},"LeaseId":{"name":"lease_id","in":"path","required":true,"schema":{"type":"string"}},"ReviewId":{"name":"review_id","in":"path","required":true,"schema":{"type":"string"}},"OptionId":{"name":"option_id","in":"path","required":true,"schema":{"type":"string"}},"TaskId":{"name":"task_id","in":"path","required":true,"schema":{"type":"string"}},"DocumentId":{"name":"document_id","in":"path","required":true,"schema":{"type":"string"}}},"headers":{"ETag":{"schema":{"type":"string"},"description":"Entity tag for optimistic concurrency."}},"responses":{"Unauthorized":{"description":"Missing or invalid token","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"type":"https://developer.tenutaiq.com/errors/unauthenticated","title":"Unauthenticated","status":401,"code":"unauthenticated"}}}},"Forbidden":{"description":"The principal's role, scope or capability does not allow this","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"type":"https://developer.tenutaiq.com/errors/forbidden","title":"Forbidden","status":403,"code":"forbidden","detail":"review.apply requires portfolio_manager or owner"}}}},"NotFound":{"description":"Not found (or outside the caller's scope)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Conflict":{"description":"State conflict","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"PreconditionFailed":{"description":"ETag mismatch","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"PlanLimit":{"description":"Plan limit reached (e.g. 11th active lease on Starter)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"type":"https://developer.tenutaiq.com/errors/plan_limit_reached","title":"Plan limit reached","status":402,"code":"plan_limit_reached","detail":"Starter includes 10 active leases; the lease was saved as a draft.","upgrade_url":"https://app.tenutaiq.com/settings/billing"}}}},"ValidationError":{"description":"Validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"type":"https://developer.tenutaiq.com/errors/validation","title":"Validation failed","status":422,"code":"validation_failed","errors":[{"path":"/rent_periods/0/annual_rent/currency","code":"currency_mismatch","message":"Rent currency must equal lease currency (AUD)"}]}}}}},"schemas":{"TurnoverTerms":{"type":"object","properties":{"pct":{"type":"number","example":8},"breakpoint":{"oneOf":[{"type":"number"},{"type":"string","enum":["natural"]}],"description":"Annual sales above which turnover rent applies; natural = base rent / pct"},"basis":{"type":"string","enum":["gross","net_of_tax"]},"frequency":{"type":"string","enum":["monthly","weekly","quarterly","annual"]},"dueDays":{"type":"integer","description":"Days after period end the report is due"},"certifiedAnnualDueDay":{"type":"string","example":"08-31"},"excludes":{"type":"array","items":{"type":"string"}}}},"SalesSubmission":{"type":"object","required":["lease_id","period","gross_sales"],"properties":{"lease_id":{"type":"string"},"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"gross_sales":{"type":"number"},"net_sales":{"type":"number"},"transactions":{"type":"integer"},"note":{"type":"string"}}},"SalesReport":{"type":"object","properties":{"id":{"type":"string"},"leaseId":{"type":"string"},"period":{"type":"string"},"grossSales":{"type":"number"},"netSales":{"type":"number"},"transactions":{"type":"integer"},"currency":{"type":"string"},"source":{"type":"string","enum":["portal","import","api","pos"]},"submittedBy":{"type":"string"},"submittedAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["submitted","accepted","queried","certified"]},"note":{"type":"string"},"previousPeriodSales":{"type":"number","description":"Figure replaced by a resubmission"}}},"TurnoverSummary":{"type":"object","properties":{"lease_id":{"type":"string"},"currency":{"type":"string"},"terms":{"$ref":"#/components/schemas/TurnoverTerms"},"lease_year":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"label":{"type":"string"}}},"months_reported":{"type":"integer"},"sales_ytd":{"type":"number"},"projected_annual":{"type":"number"},"breakpoint":{"type":"number"},"breakpoint_pct":{"type":"number"},"turnover_rent_ytd":{"type":"number"},"turnover_rent_projected":{"type":"number"},"occupancy_cost_ratio":{"type":"number","nullable":true},"missing_periods":{"type":"array","items":{"type":"string"}}}},"Asset":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"object","properties":{"kind":{"type":"string","enum":["property","site"]},"id":{"type":"string"},"label":{"type":"string"}}},"premisesId":{"type":"string"},"leaseId":{"type":"string"},"category":{"type":"string","enum":["lift","escalator","hvac","fire","electrical","plumbing","roof","facade","security","signage","fitout","refrigeration","medical_equipment","it_network","vehicle_lift","other"]},"name":{"type":"string"},"make":{"type":"string"},"model":{"type":"string"},"serial":{"type":"string"},"location":{"type":"string"},"ownedBy":{"type":"string","enum":["landlord","tenant","franchisor"]},"installedOn":{"type":"string","format":"date"},"expectedLifeYears":{"type":"number"},"condition":{"type":"integer","minimum":1,"maximum":5},"conditionAssessedOn":{"type":"string","format":"date"},"replacementCost":{"type":"number"},"currency":{"type":"string"},"serviceIntervalMonths":{"type":"integer"},"lastServicedOn":{"type":"string","format":"date"},"contractor":{"type":"string"},"certificationIds":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["in_service","out_of_service","decommissioned","planned"]},"makeGoodRelevant":{"type":"boolean"},"notes":{"type":"string"},"end_of_life":{"type":"string","format":"date","readOnly":true},"next_service_due":{"type":"string","format":"date","readOnly":true,"nullable":true}}},"Notification":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["task_due","task_overdue","review_ready","option_window","security_expiry","compliance","import","platform","partner","billing","system"]},"severity":{"type":"string","enum":["info","warning","critical"]},"title":{"type":"string"},"body":{"type":"string"},"link":{"type":"string","description":"In-app path"},"dueDate":{"type":"string","format":"date","nullable":true},"createdAt":{"type":"string","format":"date-time"},"readAt":{"type":"string","format":"date-time","nullable":true}}},"NotificationPreferences":{"type":"object","properties":{"inApp":{"type":"boolean"},"email":{"type":"string","enum":["off","immediate","daily","weekly"]},"emailCritical":{"type":"boolean","description":"Always email critical items immediately"},"digestHour":{"type":"integer","minimum":0,"maximum":23},"quietWeekends":{"type":"boolean"},"calendarFeed":{"type":"boolean"},"calendarToken":{"type":"string","readOnly":true},"kinds":{"type":"object","additionalProperties":{"type":"boolean"}}}},"ColumnMapping":{"type":"object","properties":{"column":{"type":"string","description":"Header in the uploaded file"},"field":{"type":"string","description":"Target field key, e.g. lease.commencement, or ignore"},"confidence":{"type":"number"},"source":{"type":"string","enum":["exact","fuzzy","sample","ai","user","none"]}}},"ImportDefaults":{"type":"object","properties":{"currency":{"type":"string","example":"AUD"},"country":{"type":"string","example":"AU"},"areaUnit":{"type":"string","enum":["sqm","sqft"]},"dayFirst":{"type":"boolean","description":"Interpret 01/02/2026 as 1 February"}}},"ImportBatch":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"template":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"status":{"type":"string","enum":["staged","committed","undone"]},"headers":{"type":"array","items":{"type":"string"}},"rowCount":{"type":"integer"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/ColumnMapping"}},"defaults":{"$ref":"#/components/schemas/ImportDefaults"},"sample":{"type":"array","items":{"type":"object","additionalProperties":true}},"committed":{"type":"object","nullable":true,"properties":{"propertyIds":{"type":"array","items":{"type":"string"}},"premisesIds":{"type":"array","items":{"type":"string"}},"partyIds":{"type":"array","items":{"type":"string"}},"leaseIds":{"type":"array","items":{"type":"string"}},"dateIds":{"type":"array","items":{"type":"string"}}}}}},"MappingTemplate":{"type":"object","required":["name","mappings"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"sourceSystem":{"type":"string","example":"MRI"},"mappings":{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"field":{"type":"string"}}}},"defaults":{"$ref":"#/components/schemas/ImportDefaults"},"savedBy":{"type":"string"},"savedAt":{"type":"string","format":"date"}}},"Cell":{"type":"object","description":"A regional deployment; residency is a property of the cell.","properties":{"id":{"type":"string","example":"cell-syd"},"region":{"type":"string","example":"ap-southeast-2"},"label":{"type":"string"},"provider":{"type":"string","enum":["supabase","self_hosted"]},"status":{"type":"string","enum":["healthy","degraded","maintenance","provisioning"]},"appVersion":{"type":"string"},"schemaVersion":{"type":"string"},"rulePackBundle":{"type":"string"},"organisations":{"type":"integer"},"activeLeases":{"type":"integer"},"p95Ms":{"type":"integer"},"errorRatePct":{"type":"number"},"monthlyCostUsd":{"type":"number"},"residency":{"type":"array","items":{"type":"string"}}}},"Branding":{"type":"object","properties":{"productName":{"type":"string","example":"LeaseHawk"},"logoText":{"type":"string","maxLength":2},"logoDataUrl":{"type":"string","description":"data: URL of an SVG or PNG, max 200 KB"},"accent":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"accentDark":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"ink":{"type":"string"},"supportEmail":{"type":"string","format":"email"},"loginBlurb":{"type":"string"},"hidePoweredBy":{"type":"boolean","description":"Enterprise partner plan only"}}},"CustomDomain":{"type":"object","properties":{"host":{"type":"string"},"verified":{"type":"boolean"},"certificate":{"type":"string","enum":["issued","pending","none"]}}},"Partner":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"legalEntity":{"type":"string"},"country":{"type":"string"},"status":{"type":"string","enum":["active","onboarding","suspended"]},"primaryDomain":{"type":"string"},"customDomains":{"type":"array","items":{"$ref":"#/components/schemas/CustomDomain"}},"cellId":{"type":"string"},"isolation":{"type":"string","enum":["shared_rls","dedicated_schema","dedicated_project"]},"branding":{"$ref":"#/components/schemas/Branding"},"commercial":{"type":"object","properties":{"model":{"type":"string","enum":["revenue_share","wholesale","referral"]},"partnerSharePct":{"type":"number"},"wholesalePerLeaseUsd":{"type":"number"},"billingCurrency":{"type":"string"},"invoicesCustomersDirectly":{"type":"boolean"}}},"since":{"type":"string","format":"date"}}},"PartnerCreate":{"type":"object","required":["name","legalEntity","country","cellId","model","ownerEmail"],"properties":{"name":{"type":"string"},"legalEntity":{"type":"string"},"country":{"type":"string"},"cellId":{"type":"string"},"isolation":{"type":"string","enum":["shared_rls","dedicated_schema","dedicated_project"],"default":"shared_rls"},"model":{"type":"string","enum":["revenue_share","wholesale","referral"]},"ownerEmail":{"type":"string","format":"email"}}},"Organisation":{"type":"object","description":"A customer account (metadata and usage counters only; lease data lives in the cell).","properties":{"id":{"type":"string"},"name":{"type":"string"},"partnerId":{"type":"string","nullable":true},"cellId":{"type":"string"},"country":{"type":"string"},"plan":{"type":"string","enum":["free","growth","enterprise"]},"perspective":{"type":"string","enum":["landlord","occupier","agent","franchisor"]},"activeLeases":{"type":"integer"},"users":{"type":"integer"},"mrrUsd":{"type":"number"},"status":{"type":"string","enum":["active","trial","churn_risk","suspended"]},"sso":{"type":"boolean"},"createdOn":{"type":"string","format":"date"},"lastActive":{"type":"string","format":"date"}}},"UsageDay":{"type":"object","properties":{"date":{"type":"string","format":"date"},"cellId":{"type":"string"},"partnerId":{"type":"string","nullable":true},"apiCalls":{"type":"integer"},"activeUsers":{"type":"integer"},"leasesCreated":{"type":"integer"},"aiExtractions":{"type":"integer"},"reportRuns":{"type":"integer"},"p95Ms":{"type":"integer"},"errors":{"type":"integer"}}},"PartnerAnalytics":{"type":"object","properties":{"organisations":{"type":"integer"},"activeLeases":{"type":"integer"},"users":{"type":"integer"},"mrrUsd":{"type":"number"},"trials":{"type":"integer"},"churnRisk":{"type":"integer"},"apiCalls30d":{"type":"integer"},"aiExtractions30d":{"type":"integer"},"reportRuns30d":{"type":"integer"},"byPlan":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"number"}}}}}},"FeatureFlag":{"type":"object","properties":{"key":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string","enum":["global","cell","partner","organisation"]},"enabled":{"type":"boolean"},"rollout":{"type":"integer"},"overrides":{"type":"array","items":{"type":"object","properties":{"target":{"type":"string"},"enabled":{"type":"boolean"}}}},"owner":{"type":"string"},"updatedOn":{"type":"string","format":"date"}}},"AuditEvent":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string","format":"date-time"},"actor":{"type":"string"},"actorRole":{"type":"string"},"action":{"type":"string"},"target":{"type":"string"},"cellId":{"type":"string","nullable":true},"detail":{"type":"string"}}},"SiteInput":{"type":"object","required":["portfolio_id","store_number","name","property_id","premises_id","ownership","head_lease_id"],"properties":{"portfolio_id":{"type":"string"},"store_number":{"type":"string","example":"0587"},"name":{"type":"string"},"format":{"type":"string","example":"Standard"},"region":{"type":"string"},"ownership":{"type":"string","enum":["company","franchised"]},"property_id":{"type":"string"},"premises_id":{"type":"string"},"head_lease_id":{"type":"string"},"sublease_id":{"type":"string"},"franchise_agreement_id":{"type":"string"},"franchisee_party_id":{"type":"string"},"opened_on":{"type":"string","format":"date"},"status":{"type":"string","enum":["pipeline","fitout","trading","refit","closing","closed"]},"external_ids":{"type":"object","additionalProperties":{"type":"string"}}}},"Site":{"allOf":[{"$ref":"#/components/schemas/SiteInput"},{"type":"object","properties":{"id":{"type":"string"},"jurisdiction":{"type":"string"},"rent_payable":{"$ref":"#/components/schemas/Money"},"sales_ltm":{"$ref":"#/components/schemas/Money"},"occupancy_cost_ratio":{"type":"number","description":"(rent + recoveries) / sales"},"co_terminous":{"type":"object","properties":{"aligned":{"type":"boolean"},"issues":{"type":"array","items":{"type":"string"}},"head_lease_expiry":{"type":"string","format":"date"},"sublease_expiry":{"type":"string","format":"date"},"franchise_expiry":{"type":"string","format":"date"}}},"next_event":{"type":"object","properties":{"kind":{"type":"string"},"date":{"type":"string","format":"date"}}}}}]},"FranchiseAgreementInput":{"type":"object","required":["site_id","franchisor_party_id","franchisee_party_id","commencement_date","term_months","currency"],"properties":{"site_id":{"type":"string"},"franchisor_party_id":{"type":"string"},"franchisee_party_id":{"type":"string"},"jurisdiction":{"type":"string"},"commencement_date":{"type":"string","format":"date"},"term_months":{"type":"integer"},"renewal_terms":{"type":"string"},"territory":{"type":"string"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"fees":{"type":"object","properties":{"initial":{"$ref":"#/components/schemas/Money"},"royalty_pct":{"type":"number"},"marketing_levy_pct":{"type":"number"},"technology_fee":{"$ref":"#/components/schemas/Money"}}},"minimum_performance":{"type":"string"},"disclosure":{"type":"object","properties":{"served_on":{"type":"string","format":"date"},"cooling_off_ends":{"type":"string","format":"date"},"document_id":{"type":"string"}}},"attributes":{"type":"object","additionalProperties":true}}},"FranchiseAgreement":{"allOf":[{"$ref":"#/components/schemas/FranchiseAgreementInput"},{"type":"object","properties":{"id":{"type":"string"},"expiry_date":{"type":"string","format":"date"},"state":{"type":"string","enum":["draft","disclosed","active","renewal_notice_due","notice_served","renewed","expired","terminated"]},"end_of_term_notice_due":{"type":"string","format":"date","description":"Generated by the rule pack (e.g. 6 months before expiry under the Franchising Code)."},"rule_packs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"string"}}}},"compliance":{"$ref":"#/components/schemas/ComplianceResult"}}}]},"CertificationInput":{"type":"object","required":["subject","category","name","issuer","expires_on"],"properties":{"subject":{"type":"object","required":["kind","id"],"properties":{"kind":{"type":"string","enum":["property","site","lease","party"]},"id":{"type":"string"}}},"category":{"type":"string","example":"Radiation"},"name":{"type":"string","example":"Radiation practice licence (dental X-ray)"},"issuer":{"type":"string"},"reference":{"type":"string"},"jurisdiction":{"type":"string"},"issued_on":{"type":"string","format":"date"},"expires_on":{"type":"string","format":"date"},"renewal_lead_days":{"type":"integer","default":60},"owner_user_id":{"type":"string"},"evidence_document_id":{"type":"string"},"required_by":{"type":"string","description":"Legal basis or contract clause."}}},"Certification":{"allOf":[{"$ref":"#/components/schemas/CertificationInput"},{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["current","expiring","expired","missing"]},"task_id":{"type":"string","description":"Renewal task generated from the lead time."}}}]},"PortfolioMetrics":{"type":"object","properties":{"as_at":{"type":"string","format":"date"},"reporting_currency":{"$ref":"#/components/schemas/CurrencyCode"},"fx_policy":{"type":"string"},"lease_count":{"type":"integer"},"passing_rent":{"$ref":"#/components/schemas/Money"},"face_rent_per_unit":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","example":"AUD/sqm p.a."}}},"effective_rent_per_unit":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"}}},"incentive_pct":{"type":"number"},"wale_income_years":{"type":"number"},"wale_area_years":{"type":"number"},"vacancy_pct":{"type":"number"},"vacant_area_sqm":{"type":"number"},"income_at_risk_12m":{"$ref":"#/components/schemas/Money"},"reviews_due_12m":{"type":"object","additionalProperties":{"type":"integer"},"example":{"index":9,"fixed_pct":5,"market":3}},"options_opening_12m":{"type":"integer"},"expiry_profile":{"type":"array","items":{"type":"object","properties":{"fiscal_year":{"type":"string","example":"FY29"},"passing_rent":{"$ref":"#/components/schemas/Money"},"pct":{"type":"number"},"lease_count":{"type":"integer"}}}},"by_country":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string"},"passing_rent":{"$ref":"#/components/schemas/Money"},"pct":{"type":"number"}}}},"compliance":{"type":"object","properties":{"errors":{"type":"integer"},"warnings":{"type":"integer"}}}}},"AccountingSchedule":{"type":"object","properties":{"lease_id":{"type":"string"},"standard":{"type":"string"},"classification":{"type":"string","enum":["operating","finance","short_term_exempt","low_value_exempt"]},"discount_rate":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"initial_measurement":{"type":"object","properties":{"lease_liability":{"type":"string"},"rou_asset":{"type":"string"},"initial_direct_costs":{"type":"string"},"incentives_received":{"type":"string"},"measurement_date":{"type":"string","format":"date"}}},"periods":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string","example":"2026-10"},"payment":{"type":"string"},"interest":{"type":"string"},"principal":{"type":"string"},"closing_liability":{"type":"string"},"depreciation":{"type":"string"},"closing_rou_asset":{"type":"string"},"total_expense":{"type":"string"}}}},"remeasurements":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"reason":{"type":"string","enum":["review_applied","option_reassessed","modification","index_change"]},"liability_change":{"type":"string"}}}}}},"JournalEntry":{"type":"object","properties":{"id":{"type":"string"},"lease_id":{"type":"string"},"period":{"type":"string"},"date":{"type":"string","format":"date"},"lines":{"type":"array","items":{"type":"object","properties":{"account":{"type":"string","example":"Lease liability"},"account_code":{"type":"string"},"debit":{"type":"string"},"credit":{"type":"string"},"memo":{"type":"string"}}}},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"posted_to_ledger":{"type":"boolean"}}},"LedgerConnection":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"entity_id":{"type":"string"},"tenant_name":{"type":"string","description":"The organisation name in the ledger."},"status":{"type":"string","enum":["connected","needs_reauth","error"]},"mappings":{"type":"object","properties":{"revenue_account":{"type":"string"},"recoveries_account":{"type":"string"},"tax_codes":{"type":"object","additionalProperties":{"type":"string"}}}},"last_sync_at":{"type":"string","format":"date-time"}}},"Invoice":{"type":"object","properties":{"id":{"type":"string"},"lease_id":{"type":"string"},"tenant_id":{"type":"string"},"number":{"type":"string"},"period":{"type":"string"},"issue_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ChargeLine"}},"total_net":{"$ref":"#/components/schemas/Money"},"total_tax":{"$ref":"#/components/schemas/Money"},"total_gross":{"$ref":"#/components/schemas/Money"},"paid":{"$ref":"#/components/schemas/Money"},"status":{"type":"string","enum":["draft","open","part_paid","paid","overdue","void"]},"payment_url":{"type":"string","format":"uri","description":"Tenant portal payment link (Stripe or GoCardless) when enabled."},"external_ids":{"type":"object","additionalProperties":{"type":"string"}}}},"WorkOrderInput":{"type":"object","required":["property_id","title","category"],"properties":{"property_id":{"type":"string"},"premises_id":{"type":"string"},"lease_id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["hvac","electrical","plumbing","fire_safety","cleaning","security","structural","fitout","make_good","other"]},"priority":{"type":"string","enum":["low","medium","high","urgent"],"default":"medium"},"photos":{"type":"array","items":{"type":"string"},"description":"Document ids"}}},"WorkOrder":{"allOf":[{"$ref":"#/components/schemas/WorkOrderInput"},{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["new","assigned","quoted","approved","in_progress","completed","closed","cancelled"]},"contractor_id":{"type":"string"},"quote":{"$ref":"#/components/schemas/Money"},"actual_cost":{"$ref":"#/components/schemas/Money"},"recoverable":{"type":"boolean"},"recovery_category":{"type":"string","description":"Outgoings category the cost flows to when recoverable."},"raised_by":{"type":"object","properties":{"kind":{"type":"string","enum":["staff","tenant","inspection","system"]},"id":{"type":"string"}}},"sla_due_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","format":"date-time"}}}]},"DealInput":{"type":"object","required":["premises_ids","kind"],"properties":{"premises_ids":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["new_letting","renewal","expansion","relocation","assignment"]},"prospect_party_id":{"type":"string"},"existing_lease_id":{"type":"string"},"agent_party_id":{"type":"string"},"stage":{"type":"string","enum":["enquiry","inspection","proposal","negotiation","heads_of_agreement","lease_drafting","executed","lost"],"default":"enquiry"},"probability":{"type":"number","minimum":0,"maximum":1},"target_commencement":{"type":"string","format":"date"},"notes":{"type":"string"}}},"Deal":{"allOf":[{"$ref":"#/components/schemas/DealInput"},{"type":"object","properties":{"id":{"type":"string"},"proposals":{"type":"array","items":{"$ref":"#/components/schemas/DealProposal"}},"lease_id":{"type":["string","null"],"description":"Set after conversion."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}]},"DealProposal":{"type":"object","required":["from_party","term_months","rent"],"properties":{"id":{"type":"string"},"from_party":{"type":"string","enum":["landlord","tenant"]},"term_months":{"type":"integer"},"rent":{"$ref":"#/components/schemas/Money"},"rent_unit":{"$ref":"#/components/schemas/RentUnit"},"reviews":{"type":"array","items":{"$ref":"#/components/schemas/RentReviewInput"}},"incentives":{"type":"array","items":{"$ref":"#/components/schemas/Incentive"}},"options":{"type":"array","items":{"$ref":"#/components/schemas/LeaseOptionInput"}},"economics":{"type":"object","readOnly":true,"properties":{"face_rent_per_unit":{"type":"number"},"effective_rent_per_unit":{"type":"number"},"incentive_pct":{"type":"number"},"vs_passing_pct":{"type":"number"},"vs_benchmark_pct":{"type":"number"},"npv":{"$ref":"#/components/schemas/Money"}}},"status":{"type":"string","enum":["open","countered","accepted","rejected"]}}},"Comparable":{"type":"object","required":["country","asset_class","rent_per_unit","rent_unit","currency","deal_date"],"properties":{"id":{"type":"string"},"country":{"type":"string"},"subdivision":{"type":"string"},"submarket":{"type":"string","example":"Brisbane CBD"},"asset_class":{"$ref":"#/components/schemas/AssetClass"},"grade":{"type":"string"},"area":{"$ref":"#/components/schemas/Area"},"rent_per_unit":{"type":"number"},"rent_unit":{"$ref":"#/components/schemas/RentUnit"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"basis":{"type":"string","enum":["gross","net","semi_gross"]},"incentive_pct":{"type":"number"},"term_months":{"type":"integer"},"deal_date":{"type":"string","format":"date"},"source":{"type":"string","example":"Agent advice"},"licensed_feed":{"type":"boolean","readOnly":true}}},"CurrencyCode":{"type":"string","pattern":"^[A-Z]{3}$","example":"AUD","description":"ISO 4217"},"Money":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"string","pattern":"^-?\\d+(\\.\\d{1,4})?$","example":"616200.00","description":"Decimal string","never a float.":null},"currency":{"$ref":"#/components/schemas/CurrencyCode"}}},"Area":{"type":"object","required":["value","unit","standard"],"properties":{"value":{"type":"number","example":12500},"unit":{"type":"string","enum":["sqm","sqft","tsubo","ping"]},"standard":{"type":"string","example":"RICS_NIA"},"sqm":{"type":"number","readOnly":true,"example":1161.29},"survey_date":{"type":"string","format":"date"}}},"AssetClass":{"type":"string","enum":["office","retail_centre","retail_strip","industrial","medical","mixed","other"]},"LeaseClass":{"type":"string","enum":["retail_regime","commercial","industrial","licence","sublease","ground"]},"LeaseStatus":{"type":"string","enum":["draft","negotiating","disclosure_served","executed","committed","active","holding_over","renewed","assigned","expired","terminated"]},"ReviewType":{"type":"string","enum":["index","fixed_pct","stepped","market","upward_only_market","greater_of","turnover"]},"RentUnit":{"type":"string","enum":["per_sqm_pa","per_sqm_pm","per_sqft_pa","per_sqft_pm","per_tsubo_pm"]},"DocumentKind":{"type":"string","enum":["lease","variation","disclosure","plan","security","insurance","notice","correspondence","valuation","turnover_certificate","epc","side_letter","other"]},"PageMeta":{"type":"object","properties":{"next_cursor":{"type":["string","null"]},"limit":{"type":"integer"},"as_at":{"type":"string","format":"date"}}},"Principal":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["user","api_key","oauth_client"]},"name":{"type":"string"},"account_id":{"type":"string"},"cell":{"type":"string"},"role":{"type":"string","enum":["owner","portfolio_manager","lease_admin","property_manager","finance","analyst","external","integration"]},"scope":{"type":"object","properties":{"type":{"type":"string","enum":["account","portfolio","property","lease"]},"ids":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string","format":"date-time"}}},"capabilities":{"type":"array","items":{"type":"string"}}}},"Portfolio":{"allOf":[{"$ref":"#/components/schemas/PortfolioInput"},{"type":"object","required":["id"],"properties":{"id":{"type":"string","example":"pf_01J8"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}]},"PortfolioInput":{"type":"object","required":["name","perspective","reporting_currency"],"properties":{"name":{"type":"string"},"perspective":{"type":"string","enum":["landlord","occupier","both"]},"reporting_currency":{"$ref":"#/components/schemas/CurrencyCode"},"fx_policy":{"type":"string","enum":["as_at_spot","month_average","budget"],"default":"as_at_spot"},"comparison_area_unit":{"type":"string","enum":["sqm","sqft"],"default":"sqm"},"fiscal_year_start_month":{"type":"integer","minimum":1,"maximum":12,"default":7},"timezone":{"type":"string","example":"Australia/Brisbane"}}},"PortfolioList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Portfolio"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"Address":{"type":"object","required":["line1","locality","country"],"properties":{"line1":{"type":"string"},"line2":{"type":"string"},"locality":{"type":"string","example":"Newstead"},"region":{"type":"string","example":"QLD"},"postcode":{"type":"string"},"country":{"type":"string","pattern":"^[A-Z]{2}$","example":"AU"},"lat":{"type":"number"},"lng":{"type":"number"}}},"PropertyInput":{"type":"object","required":["portfolio_id","name","asset_class","address"],"properties":{"custom":{"$ref":"#/components/schemas/CustomValues"},"portfolio_id":{"type":"string"},"name":{"type":"string"},"asset_class":{"$ref":"#/components/schemas/AssetClass"},"grade":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"},"jurisdiction":{"type":"string","example":"AU-QLD","description":"Derived from the address when omitted."},"title_reference":{"type":"string"},"owner_entity_id":{"type":"string"},"tax_profile":{"type":"object","properties":{"regime":{"type":"string","enum":["GST","VAT","sales_tax","none"]},"rate":{"type":"number"},"election":{"type":"string","example":"opted_to_tax"}}},"energy_ratings":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string","example":"NABERS"},"rating":{"type":"string","example":"5.0"},"expires_on":{"type":"string","format":"date"}}}},"attributes":{"type":"object","additionalProperties":true}}},"Property":{"allOf":[{"$ref":"#/components/schemas/PropertyInput"},{"type":"object","properties":{"custom":{"$ref":"#/components/schemas/CustomValues"},"id":{"type":"string","example":"prop_01J8"},"jurisdiction_chain":{"type":"array","items":{"type":"string"},"example":["AU","AU-QLD"],"readOnly":true},"premises":{"type":"array","items":{"$ref":"#/components/schemas/Premises"},"description":"With `expand=premises`."},"archived_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}]},"PropertyList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Property"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"PremisesInput":{"type":"object","required":["identifier","area"],"properties":{"building_id":{"type":"string"},"identifier":{"type":"string","example":"Level 12, Suite 1201"},"level":{"type":"string"},"area":{"$ref":"#/components/schemas/Area"},"permitted_use":{"type":"string"},"status":{"type":"string","enum":["vacant","leased","offline"]},"stacking_order":{"type":"integer"}}},"Premises":{"allOf":[{"$ref":"#/components/schemas/PremisesInput"},{"type":"object","properties":{"id":{"type":"string","example":"prem_01J8"},"property_id":{"type":"string"},"current_lease_id":{"type":["string","null"]}}}]},"PartyInput":{"type":"object","required":["legal_name"],"properties":{"legal_name":{"type":"string"},"trading_name":{"type":"string"},"registration":{"type":"object","properties":{"type":{"type":"string","example":"ABN","description":"ABN","ACN":null,"NZBN":null,"CRN (Companies House)":null,"UEN":null,"EIN":null,"SIREN":null,"HRB ...":null},"id":{"type":"string"},"verified":{"type":"boolean","readOnly":true}}},"industry":{"type":"object","properties":{"taxonomy":{"type":"string","enum":["ANZSIC","SIC","NAICS","NACE"]},"code":{"type":"string"}}},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"role":{"type":"string"}}}},"notice_address":{"$ref":"#/components/schemas/Address"}}},"Party":{"allOf":[{"$ref":"#/components/schemas/PartyInput"},{"type":"object","properties":{"id":{"type":"string","example":"party_01J8"}}}]},"RentPeriodInput":{"type":"object","required":["start","end","annual_rent"],"properties":{"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"annual_rent":{"$ref":"#/components/schemas/Money"},"source":{"type":"string","enum":["initial","index","fixed","stepped","market","abatement","manual"],"default":"initial"}}},"RentPeriod":{"allOf":[{"$ref":"#/components/schemas/RentPeriodInput"},{"type":"object","properties":{"id":{"type":"string"},"rent_per_unit":{"type":"object","properties":{"value":{"type":"number","example":790},"unit":{"$ref":"#/components/schemas/RentUnit"}}},"source_review_id":{"type":"string"},"fx":{"type":"object","description":"Present when `reporting_currency` requested.","properties":{"currency":{"$ref":"#/components/schemas/CurrencyCode"},"rate":{"type":"number"},"rate_date":{"type":"string","format":"date"},"annual_rent":{"$ref":"#/components/schemas/Money"}}}}}]},"RentReviewInput":{"type":"object","required":["review_date","type"],"properties":{"review_date":{"type":"string","format":"date"},"type":{"$ref":"#/components/schemas/ReviewType"},"parameters":{"type":"object","description":"Type-specific. index → series_id, base_period, cap, collar, rounding. fixed_pct → pct. stepped → steps. market → valuer_method, dispute. turnover → threshold, pct.","additionalProperties":true,"example":{"series_id":"AU.ABS.CPI.ALL","base_period":"2025-Q2","cap":4,"collar":0}}}},"RentReview":{"allOf":[{"$ref":"#/components/schemas/RentReviewInput"},{"type":"object","properties":{"id":{"type":"string","example":"rv_01J8"},"lease_id":{"type":"string"},"state":{"type":"string","enum":["scheduled","calculated","notice_due","notice_issued","agreed","disputed","valuer_appointed","determined","approved","applied","waived"]},"proposed_rent":{"$ref":"#/components/schemas/Money"},"calculation":{"type":"object","additionalProperties":true,"example":{"base_index":139.4,"current_index":144.1,"uplift_pct":3.37}},"statutory_deadlines":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"due_date":{"type":"string","format":"date"},"rule_code":{"type":"string"}}}},"applied_at":{"type":"string","format":"date-time"}}}]},"LeaseOptionInput":{"type":"object","required":["sequence","term_months","window_open","window_close"],"properties":{"sequence":{"type":"integer"},"term_months":{"type":"integer"},"window_open":{"type":"string","format":"date"},"window_close":{"type":"string","format":"date"},"conditions":{"type":"object","additionalProperties":true,"example":{"no_breach":true,"personal_to_tenant":false}}}},"LeaseOption":{"allOf":[{"$ref":"#/components/schemas/LeaseOptionInput"},{"type":"object","properties":{"id":{"type":"string","example":"opt_01J8"},"landlord_notice_due":{"type":["string","null"],"format":"date","description":"Generated by the rule pack where the jurisdiction requires a landlord reminder."},"state":{"type":"string","enum":["dormant","reminder_due","window_open","exercised","lapsed","rejected"]},"renewal_lease_id":{"type":["string","null"]}}}]},"Incentive":{"type":"object","required":["kind","value"],"properties":{"kind":{"type":"string","enum":["rent_free","abatement","fitout_contribution","cash","other"]},"value":{"$ref":"#/components/schemas/Money"},"period_start":{"type":"string","format":"date"},"period_end":{"type":"string","format":"date"},"amortise_over_term":{"type":"boolean","default":true},"note":{"type":"string"}}},"SecurityInstrument":{"type":"object","required":["kind","amount"],"properties":{"kind":{"type":"string","enum":["bank_guarantee","cash_deposit","rent_deposit_deed","letter_of_credit","retail_bond_scheme","key_money","personal_guarantee"]},"amount":{"$ref":"#/components/schemas/Money"},"issuer":{"type":"string"},"reference":{"type":"string"},"expiry_date":{"type":"string","format":"date"},"indexed_to_rent":{"type":"boolean","default":false}}},"Clause":{"type":"object","properties":{"id":{"type":"string"},"lease_id":{"type":"string"},"type":{"type":"string","example":"demolition","description":"Global clause taxonomy (option","break":null,"rent_review":null,"turnover_rent":null,"relocation":null,"demolition":null,"make_good":null,"assignment":null,"insurance":null,"exclusivity":null,"permitted_use":null,"redevelopment":null,"first_right_of_refusal":null,"...).":null},"summary":{"type":"string"},"obligation_on":{"type":"string","enum":["landlord","tenant","both"]},"evidence":{"$ref":"#/components/schemas/Evidence"},"critical_date":{"type":["string","null"],"format":"date"},"accepted_by":{"type":"string"},"accepted_at":{"type":"string","format":"date-time"}}},"SpecialCondition":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"summary_language":{"type":"string","example":"en"},"verbatim":{"type":"string"},"obligation_on":{"type":"string","enum":["landlord","tenant","both"]},"trigger":{"type":"string"},"deadline":{"type":["string","null"],"format":"date"},"risk":{"type":"string","enum":["low","medium","high"]},"evidence":{"$ref":"#/components/schemas/Evidence"}}},"Evidence":{"type":"object","description":"Where a value came from in the source document.","properties":{"document_id":{"type":"string"},"page":{"type":"integer"},"quote":{"type":"string"},"bbox":{"type":"array","items":{"type":"number"},"minItems":4,"maxItems":4,"description":"[x0, y0, x1, y1] in PDF points"},"confidence":{"type":"number","minimum":0,"maximum":1}}},"WaitlistEnquiry":{"type":"object","required":["name","email"],"properties":{"kind":{"type":"string","enum":["waitlist","contact","signup"],"description":"Optional, waitlist when omitted. waitlist: join the waitlist; contact: a message; signup: a request to create an account"},"name":{"type":"string","maxLength":120},"email":{"type":"string","format":"email"},"company":{"type":"string","maxLength":160},"side":{"type":"string","enum":["landlord","occupier","franchisor","agent","partner","other"]},"portfolioSize":{"type":"string","enum":["1-5","6-25","26-100","101-500","500+"]},"plan":{"type":"string","enum":["free","growth","enterprise","unsure"]},"message":{"type":"string","maxLength":2000},"lang":{"type":"string","maxLength":8},"source":{"type":"string","maxLength":200},"website":{"type":"string","description":"Honeypot; must be empty"}}},"CustomValues":{"type":"object","description":"Custom field values keyed by field key. On PATCH, keys not given keep their value and `null` clears one. Values are validated against the field type (number, money, date as YYYY-MM-DD, yes/no as boolean, pick list as one of its options).","additionalProperties":{"type":["string","number","boolean","null"]},"example":{"cost_centre":"CC-4100","fitout_grade":"Fully fitted","make_good_agreed":true}},"CustomFieldInput":{"type":"object","required":["entity","label","type"],"properties":{"entity":{"type":"string","enum":["lease","property"]},"label":{"type":"string","maxLength":60},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["text","number","currency","date","boolean","select"]},"options":{"type":"array","items":{"type":"string","maxLength":60},"maxItems":50,"description":"Pick list only"},"required":{"type":"boolean","default":false},"help":{"type":"string","maxLength":200}}},"CustomFieldDefinition":{"allOf":[{"$ref":"#/components/schemas/CustomFieldInput"},{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"integer"},"archived":{"type":"boolean"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}]},"LeaseInput":{"type":"object","required":["reference","property_id","premises_ids","lease_class","parties","currency","rent_unit","commencement_date","term_months","recoveries_basis","rent_periods"],"properties":{"custom":{"$ref":"#/components/schemas/CustomValues"},"reference":{"type":"string"},"property_id":{"type":"string"},"premises_ids":{"type":"array","items":{"type":"string"},"minItems":1},"lease_class":{"$ref":"#/components/schemas/LeaseClass"},"parties":{"type":"array","items":{"type":"object","required":["party_id","role"],"properties":{"party_id":{"type":"string"},"role":{"type":"string","enum":["landlord","tenant","guarantor","agent"]}}}},"jurisdiction":{"type":"string","description":"Defaults to the property's jurisdiction."},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"rent_unit":{"$ref":"#/components/schemas/RentUnit"},"language":{"type":"string","default":"en"},"commencement_date":{"type":"string","format":"date"},"term_months":{"type":"integer"},"expiry_date":{"type":"string","format":"date","description":"Derived from commencement and term when omitted."},"holdover_terms":{"type":"string"},"recoveries_basis":{"type":"string","enum":["gross","net","semi_gross"]},"recoverable_categories":{"type":"array","items":{"type":"string"}},"permitted_use":{"type":"string"},"rent_periods":{"type":"array","items":{"$ref":"#/components/schemas/RentPeriodInput"},"minItems":1},"reviews":{"type":"array","items":{"$ref":"#/components/schemas/RentReviewInput"}},"options":{"type":"array","items":{"$ref":"#/components/schemas/LeaseOptionInput"}},"incentives":{"type":"array","items":{"$ref":"#/components/schemas/Incentive"}},"security":{"$ref":"#/components/schemas/SecurityInstrument"},"turnover_rent":{"type":"object","properties":{"threshold":{"$ref":"#/components/schemas/Money"},"pct":{"type":"number"},"reporting":{"type":"string","enum":["monthly","quarterly","annual"]}}},"attributes":{"type":"object","additionalProperties":true,"description":"Jurisdiction-specific extras (lta_1954","break_dates":null,"ejari_number":null,"registration_number ...).":null},"external_ids":{"type":"object","additionalProperties":{"type":"string"},"example":{"xero_contact_id":"c9e1...","erp_lease_no":"LS-0092"},"description":"Your system's identifiers","returned unchanged and filterable.":null}}},"LeaseRecordInput":{"type":"object","description":"The quick lease record the app's New lease / Edit lease form posts (camelCase). PATCH accepts any subset; `reference` cannot change.","required":["reference","propertyId","premisesIds","tenantId","leaseClass","currency","jurisdiction","commencement","expiry","annualRentExTax"],"properties":{"custom":{"$ref":"#/components/schemas/CustomValues"},"reference":{"type":"string","maxLength":40},"propertyId":{"type":"string"},"premisesIds":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Must belong to propertyId."},"tenantId":{"type":"string"},"leaseClass":{"$ref":"#/components/schemas/LeaseClass"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"rentUnit":{"$ref":"#/components/schemas/RentUnit"},"jurisdiction":{"type":"string","example":"AU-QLD"},"commencement":{"type":"string","format":"date"},"expiry":{"type":"string","format":"date","description":"Must be after commencement."},"status":{"$ref":"#/components/schemas/LeaseStatus"},"recoveriesBasis":{"type":"string","enum":["gross","net","semi_gross"],"default":"net"},"permittedUse":{"type":"string"},"annualRentExTax":{"type":"number","description":"Replaces the current rent period's figure on update; earlier periods are kept."},"optionCount":{"type":"integer","minimum":0,"maximum":10,"default":0},"optionTermMonths":{"type":"integer","default":60},"security":{"type":"object","properties":{"kind":{"type":"string","enum":["bank_guarantee","cash_bond","guarantee","none"]},"amount":{"type":"number"},"expiry":{"type":"string","format":"date"}}},"notes":{"type":"string","maxLength":2000,"description":"Team context shown in the lease's Why it matters panel."}}},"RiskLevel":{"type":"string","enum":["high","medium","low"]},"PortfolioSummary":{"type":"object","properties":{"asAt":{"type":"string","format":"date"},"reportingCurrency":{"$ref":"#/components/schemas/CurrencyCode"},"portfolioId":{"type":"string"},"leases":{"type":"integer","description":"Live leases (active or holding over)."},"properties":{"type":"integer"},"areaSqm":{"type":"integer"},"annualRent":{"type":"number"},"averageRentPerSqm":{"type":"number"},"waleYears":{"type":"number"},"vacancyPct":{"type":"number"},"expiringNext12Months":{"type":"integer"},"rentExpiringNext12Months":{"type":"number"},"atRiskLeases":{"type":"integer","description":"Leases scored high risk."},"mediumRiskLeases":{"type":"integer"},"openSignals":{"type":"integer"},"averageOccupancyCostPct":{"type":["number","null"],"description":"Across leases with 12 months of reported sales."}}},"RunwayBucket":{"type":"object","properties":{"key":{"type":"string","example":"0-6m"},"label":{"type":"string","example":"0 to 6 months"},"count":{"type":"integer"},"amount":{"type":"number","description":"Annual rent expiring in the window","reporting currency.":null},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"tone":{"type":"string","enum":["critical","warning","neutral","stable"]}}},"PrioritySignal":{"type":"object","properties":{"leaseId":{"type":"string"},"reference":{"type":"string"},"property":{"type":"string"},"tenant":{"type":"string"},"kind":{"type":"string","enum":["option_decision","renewal_strategy","expiry_approaching","occupancy_cost","above_market","special_condition","holding_over","review_pending"]},"risk":{"$ref":"#/components/schemas/RiskLevel"},"headline":{"type":"string","example":"Option decision needed"},"why":{"type":"string","example":"Option 1 (5 years) must be exercised by 2026-10-14, and occupancy cost is already above the healthy band."},"date":{"type":["string","null"],"format":"date"},"daysLeft":{"type":["integer","null"]},"metric":{"type":["object","null"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}},"leaseRisk":{"$ref":"#/components/schemas/RiskLevel"},"riskScore":{"type":"integer"},"status":{"type":"string","example":"Decision needed"},"occupancyCostPct":{"type":["number","null"]}}},"ActivityEvent":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string","format":"date-time"},"kind":{"type":"string","example":"lease.updated"},"title":{"type":"string","example":"Lease record updated"},"description":{"type":"string"},"actorId":{"type":"string"},"actorName":{"type":"string"},"leaseId":{"type":"string"},"propertyId":{"type":"string"},"link":{"type":"string","description":"App path for the event."},"changes":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}}}}}},"Lease":{"allOf":[{"$ref":"#/components/schemas/LeaseInput"},{"type":"object","properties":{"custom":{"$ref":"#/components/schemas/CustomValues"},"id":{"type":"string","example":"lease_01J8"},"status":{"$ref":"#/components/schemas/LeaseStatus"},"version":{"type":"integer"},"parent_lease_id":{"type":["string","null"]},"rule_packs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"string"}}},"readOnly":true},"passing_rent":{"$ref":"#/components/schemas/Money"},"rent_per_unit":{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/RentUnit"}}},"area":{"$ref":"#/components/schemas/Area"},"effective_rent":{"$ref":"#/components/schemas/Money"},"incentive_pct":{"type":"number"},"compliance":{"$ref":"#/components/schemas/ComplianceResult"},"clauses":{"type":"array","items":{"$ref":"#/components/schemas/Clause"}},"special_conditions":{"type":"array","items":{"$ref":"#/components/schemas/SpecialCondition"}},"documents":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}]},"LeaseList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Lease"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"LeaseVersion":{"type":"object","properties":{"version":{"type":"integer"},"reason":{"type":"string","enum":["initial","variation","assignment","renewal","correction"]},"committed_by":{"type":"string"},"committed_at":{"type":"string","format":"date-time"},"diff":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"before":{},"after":{}}}}}},"Approval":{"type":"object","properties":{"id":{"type":"string"},"required_role":{"type":"string"},"reason":{"type":"string","example":"Passing rent above AUD 1,000,000 requires a second approver"},"expires_at":{"type":"string","format":"date-time"}}},"ChargeLine":{"type":"object","properties":{"id":{"type":"string"},"lease_id":{"type":"string"},"period":{"type":"string","example":"2026-10"},"kind":{"type":"string","enum":["rent","recoveries","parking","turnover","adjustment","other"]},"description":{"type":"string"},"net":{"$ref":"#/components/schemas/Money"},"tax":{"$ref":"#/components/schemas/Money"},"tax_code":{"type":"string","example":"GST10"},"gross":{"$ref":"#/components/schemas/Money"},"due_date":{"type":"string","format":"date"},"external_ids":{"type":"object","additionalProperties":{"type":"string"}}}},"ComplianceFinding":{"type":"object","properties":{"rule_code":{"type":"string","example":"QLD-RSL-RATCHET"},"rule_pack_id":{"type":"string"},"severity":{"type":"string","enum":["error","warning","info"]},"description":{"type":"string"},"path":{"type":"string","example":"/reviews/1/type"},"overridden":{"type":"object","properties":{"by":{"type":"string"},"reason":{"type":"string"},"at":{"type":"string","format":"date-time"}}}}},"ComplianceResult":{"type":"object","properties":{"rule_packs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"string"},"jurisdiction":{"type":"string"}}}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceFinding"}},"blocking":{"type":"boolean"}}},"ComplianceProblem":{"allOf":[{"$ref":"#/components/schemas/Problem"},{"type":"object","properties":{"findings":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceFinding"}}}}]},"CriticalDate":{"type":"object","properties":{"id":{"type":"string"},"lease_id":{"type":"string"},"kind":{"type":"string","example":"option_window_close"},"label":{"type":"string","example":"Option window closes"},"due_date":{"type":"string","format":"date"},"source":{"type":"string","example":"option opt_01J8"},"rule_code":{"type":"string"},"state":{"type":"string","enum":["scheduled","notified","acknowledged","overdue","escalated","closed","cancelled"]},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}}},"Task":{"type":"object","properties":{"id":{"type":"string"},"critical_date_id":{"type":"string"},"lease_id":{"type":"string"},"title":{"type":"string"},"owner_user_id":{"type":"string"},"due_date":{"type":"string","format":"date"},"lead_time":{"type":"string","example":"6 months before expiry"},"state":{"type":"string","enum":["scheduled","notified","acknowledged","overdue","escalated","closed","cancelled"]},"outcome":{"type":"object","properties":{"code":{"type":"string"},"note":{"type":"string"},"document_id":{"type":"string"},"closed_by":{"type":"string"},"closed_at":{"type":"string","format":"date-time"}}}}},"OutgoingsBudgetInput":{"type":"object","required":["fiscal_year","currency","lines"],"properties":{"fiscal_year":{"type":"integer","example":2027},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"lines":{"type":"array","items":{"type":"object","required":["category","amount"],"properties":{"category":{"type":"string","example":"council_rates"},"amount":{"$ref":"#/components/schemas/Money"},"recoverable":{"type":"boolean"},"cap":{"$ref":"#/components/schemas/Money"}}}},"apportionment":{"type":"string","enum":["area_share","fixed_pct","weighted"],"default":"area_share"}}},"OutgoingsBudget":{"allOf":[{"$ref":"#/components/schemas/OutgoingsBudgetInput"},{"type":"object","properties":{"id":{"type":"string"},"property_id":{"type":"string"},"state":{"type":"string","enum":["draft","estimate_issued","accruing","year_end","audited","reconciled","closed"]},"statutory_deadlines":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","example":"audited_statement_due"},"due_date":{"type":"string","format":"date"},"rule_code":{"type":"string"}}}}}}]},"Reconciliation":{"type":"object","properties":{"budget_id":{"type":"string"},"total_budget":{"$ref":"#/components/schemas/Money"},"total_actual":{"$ref":"#/components/schemas/Money"},"per_lease":{"type":"array","items":{"type":"object","properties":{"lease_id":{"type":"string"},"share_pct":{"type":"number"},"charged":{"$ref":"#/components/schemas/Money"},"actual_share":{"$ref":"#/components/schemas/Money"},"adjustment":{"$ref":"#/components/schemas/Money"},"statement_document_id":{"type":"string"}}}}}},"Document":{"type":"object","properties":{"id":{"type":"string","example":"doc_01J8"},"lease_id":{"type":["string","null"]},"property_id":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/DocumentKind"},"title":{"type":"string"},"language":{"type":"string"},"pages":{"type":"integer"},"size_bytes":{"type":"integer"},"sha256":{"type":"string"},"version":{"type":"integer"},"download_url":{"type":"string","format":"uri","description":"Signed","expires in 15 minutes.":null},"extraction":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["none","queued","extracting","proposed","reviewed","committed","failed"]}}},"legal_hold":{"type":"boolean"},"uploaded_by":{"type":"string"},"uploaded_at":{"type":"string","format":"date-time"}}},"Extraction":{"type":"object","properties":{"id":{"type":"string"},"document_id":{"type":"string"},"state":{"type":"string","enum":["queued","extracting","proposed","reviewed","committed","failed","discarded"]},"model":{"type":"string","example":"claude-sonnet-4-5@2026-09"},"schema_version":{"type":"string"},"document_language":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"value":{},"evidence":{"$ref":"#/components/schemas/Evidence"},"status":{"type":"string","enum":["proposed","accepted","corrected","rejected"]}}},"example":{"commencement_date":{"value":"2021-11-01","evidence":{"page":2,"quote":"Item 6 Commencement Date 1 November 2021","confidence":0.97},"status":"proposed"}}},"clauses":{"type":"array","items":{"$ref":"#/components/schemas/Clause"}},"special_conditions":{"type":"array","items":{"$ref":"#/components/schemas/SpecialCondition"}},"self_check":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"passed":{"type":"boolean"},"note":{"type":"string"}}}},"cost":{"type":"object","properties":{"pages":{"type":"integer"},"tokens":{"type":"integer"}}}}},"Jurisdiction":{"type":"object","properties":{"code":{"type":"string","example":"AU-QLD"},"parent":{"type":["string","null"],"example":"AU"},"level":{"type":"string","enum":["country","subdivision","municipality"]},"name":{"type":"string"},"default_currency":{"$ref":"#/components/schemas/CurrencyCode"},"default_area_unit":{"type":"string"},"default_rent_unit":{"$ref":"#/components/schemas/RentUnit"},"fiscal_year_start_month":{"type":"integer"},"tax_regime":{"type":"string"},"tax_rate":{"type":"number"},"holiday_calendar":{"type":"string"}}},"RulePack":{"type":"object","properties":{"id":{"type":"string"},"jurisdiction":{"type":"string"},"lease_class":{"type":"string"},"name":{"type":"string"},"version":{"type":"string","example":"2026.1"},"effective_from":{"type":"string","format":"date"},"effective_to":{"type":["string","null"],"format":"date"},"verified_by":{"type":"string"},"verified_at":{"type":"string","format":"date"},"language":{"type":"string"},"rules":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["error","warning","info"]},"condition":{"type":"object","additionalProperties":true},"effect":{"type":"object","additionalProperties":true},"reference":{"type":"string","example":"Retail Shop Leases Act 1994 (Qld) s 27"}}}}}},"FxRate":{"type":"object","required":["date","base","quote","rate"],"properties":{"date":{"type":"string","format":"date"},"base":{"$ref":"#/components/schemas/CurrencyCode"},"quote":{"$ref":"#/components/schemas/CurrencyCode"},"rate":{"type":"number"},"source":{"type":"string","example":"ECB"}}},"IndexSeries":{"type":"object","properties":{"id":{"type":"string","example":"FR.INSEE.ILC"},"jurisdiction":{"type":"string"},"name":{"type":"string"},"frequency":{"type":"string","enum":["monthly","quarterly","annual"]},"publisher":{"type":"string"},"latest":{"type":"object","properties":{"period":{"type":"string","format":"date"},"value":{"type":"number"},"published_at":{"type":"string","format":"date"}}}}},"ReportDefinition":{"type":"object","required":["measure","group_by"],"properties":{"name":{"type":"string"},"measure":{"type":"string","enum":["passing_rent","face_rent_per_unit","effective_rent_per_unit","leased_area","vacant_area","incentive_pct","wale_income","wale_area","lease_count","reviews_due","options_open","income_at_risk","outgoings_budget","arrears_balance"]},"group_by":{"type":"array","items":{"anyOf":[{"type":"string","enum":["portfolio","property","country","subdivision","city","currency","asset_class","grade","tenant","tenant_industry","lease_class","expiry_fy","review_type","recoveries_basis","rule_pack"]},{"type":"string","pattern":"^cf:(lease|property):[a-z][a-z0-9_]*$","description":"A custom field (pick list, yes/no, text, or date by year), e.g. cf:lease:fitout_grade"}]},"minItems":1,"maxItems":2},"filters":{"type":"object","additionalProperties":true,"properties":{"as_at":{"type":"string","format":"date"},"country":{"type":"array","items":{"type":"string"}},"asset_class":{"type":"array","items":{"type":"string"}},"expiry_between":{"type":"array","items":{"type":"string","format":"date"}}}},"reporting_currency":{"$ref":"#/components/schemas/CurrencyCode"},"fx_policy":{"type":"string","enum":["as_at_spot","month_average","budget"]},"area_unit":{"type":"string","enum":["sqm","sqft"]},"form":{"type":"string","enum":["bar","stacked_bar","donut","line","heatmap","table"]},"options":{"type":"object","additionalProperties":true}}},"ReportResult":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/ReportDefinition"},"as_at":{"type":"string","format":"date"},"unit":{"type":"string","example":"USD"},"rows":{"type":"array","items":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"}},"value":{"type":"number"},"count":{"type":"integer"}}}},"series":{"type":"array","description":"Chart-ready","items":{"type":"object","properties":{"name":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"x":{"type":"string"},"y":{"type":"number"}}}}}}},"drill_through":{"type":"string","format":"uri-reference","description":"A `/leases` URL with the equivalent filters."}}},"SavedReport":{"allOf":[{"$ref":"#/components/schemas/ReportDefinition"},{"type":"object","properties":{"id":{"type":"string"},"owner_user_id":{"type":"string"},"shared":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}}]},"Job":{"type":"object","properties":{"id":{"type":"string","example":"job_01J8"},"kind":{"type":"string","enum":["export","extraction","import","reconciliation"]},"state":{"type":"string","enum":["queued","running","succeeded","failed"]},"progress":{"type":"number","minimum":0,"maximum":1},"result_url":{"type":"string","format":"uri","description":"Signed download for exports."},"result":{"type":"object","additionalProperties":true},"error":{"$ref":"#/components/schemas/Problem"},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":"string","format":"date-time"}}},"Entitlement":{"type":"object","properties":{"plan":{"type":"string","enum":["starter","growth","portfolio","enterprise"]},"status":{"type":"string","enum":["trialing","active","past_due","grace","read_only","cancelled"]},"billing_currency":{"$ref":"#/components/schemas/CurrencyCode"},"limits":{"type":"object","properties":{"free_active_leases":{"type":"integer"},"ai_abstractions_included":{"type":"integer"},"users":{"type":["integer","null"]},"storage_gb":{"type":"integer"}}},"usage":{"type":"object","properties":{"active_leases":{"type":"integer"},"ai_abstractions_this_period":{"type":"integer"},"storage_gb":{"type":"number"}}},"features":{"type":"array","items":{"type":"string"},"example":["sso","api","ledger_sync","four_eyes"]},"grace_until":{"type":["string","null"],"format":"date"}}},"WebhookSubscriptionInput":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["lease.committed","lease.versioned","lease.expired","lease.terminated","lease.assigned","review.calculated","review.applied","option.window_opened","option.exercised","option.lapsed","task.due","task.overdue","task.closed","extraction.completed","extraction.failed","charges.generated","invoice.paid","invoice.overdue","site.sales_posted","site.co_terminous_issue","franchise.notice_due","franchise.renewed","certification.expiring","certification.expired","outgoings.reconciled","work_order.created","work_order.completed","deal.stage_changed","deal.converted","document.signed","turnover.submitted","rule_pack.published","billing.changed","premises.measured"]}},"description":{"type":"string"},"api_version":{"type":"string","example":"2026-09-01"}}},"WebhookSubscription":{"allOf":[{"$ref":"#/components/schemas/WebhookSubscriptionInput"},{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string","writeOnly":false,"description":"Shown once on creation."},"state":{"type":"string","enum":["active","paused","disabled_failures"]},"created_at":{"type":"string","format":"date-time"}}}]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"attempt":{"type":"integer"},"status_code":{"type":["integer","null"]},"delivered_at":{"type":"string","format":"date-time"},"next_retry_at":{"type":["string","null"],"format":"date-time"},"error":{"type":"string"}}},"Event":{"type":"object","required":["id","type","occurred_at","account_id","data"],"properties":{"id":{"type":"string","example":"evt_01J9"},"type":{"type":"string","example":"review.applied"},"occurred_at":{"type":"string","format":"date-time"},"account_id":{"type":"string"},"api_version":{"type":"string"},"data":{"type":"object","additionalProperties":true},"links":{"type":"object","additionalProperties":{"type":"string"}}}},"AuditEntry":{"type":"object","properties":{"id":{"type":"string"},"entity_type":{"type":"string"},"entity_id":{"type":"string"},"action":{"type":"string","example":"lease.commit"},"actor":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"}}},"source":{"type":"string","enum":["ui","api","import","extraction","system"]},"before":{"type":"object","additionalProperties":true},"after":{"type":"object","additionalProperties":true},"occurred_at":{"type":"string","format":"date-time"},"request_id":{"type":"string"}}},"Problem":{"type":"object","description":"RFC 9457 problem details with a stable machine-readable `code`.","required":["title","status","code"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"code":{"type":"string","example":"validation_failed"},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}