API Documentation
API reference for importing assets, existing loans, maturities, and lender relationship context into CapLens. Review authentication, request fields, and example responses before connecting your systems.
Delta-safe by design
Repeated pushes update records instead of duplicating assets.
Use Bearer caplens_sk_... for automated portfolio pushes.
Dry-run mode returns issues and warnings before saving.
Keys are organization-scoped and revocable in CapLens.
/api/sponsor/portfolio/importLoad current assets and existing loans. Use dry-run to validate, then createRecords to create or update monitored capital records.
Start with dryRun: true to validate your data. The example below uses createRecords: true and saves records; switch to that mode only after reviewing validation results.
curl https://app.caplens.io/api/sponsor/portfolio/import \ -H "Authorization: Bearer caplens_sk_..." \ -H "Content-Type: application/json" \ -d @portfolio-import.json
{
"dryRun": false,
"createRecords": true,
"sourceSystem": "11Capital BI",
"fileName": "debt-book-export.xlsx",
"assets": [
{
"externalId": "11C-SEA-014",
"propertyName": "Harbor Ridge Apartments",
"market": "Seattle, WA",
"units": 184,
"sponsorName": "11Capital",
"currentLoan": {
"lenderName": "Pacific Crest Bank",
"lenderType": "Bank",
"lenderContactName": "Jordan Lee",
"lenderContactEmail": "jordan@pacificcrest.example",
"loanAmount": 21400000,
"interestRate": 6.18,
"rateType": "fixed-index-spread",
"maturityDate": "2027-11-15",
"extensionNoticeDate": "2027-05-15",
"prepaymentType": "yield-maintenance",
"prepaymentSummary": "Yield maintenance through 2027; open final 90 days",
"depositRequirements": "Tax, insurance, and replacement reserves",
"recentLenderConversation": "Bank open to reviewing refi 9 months before maturity.",
"noi": 1825000,
"dscr": 1.31,
"occupancy": 94.2,
"debtYield": 8.5
}
}
]
}{
"status": "published",
"mode": "upserted_records",
"summary": {
"totalRows": 1,
"readyRows": 1,
"warningRows": 0,
"blockedRows": 0,
"createdRecords": 0,
"updatedRecords": 1
},
"rows": [
{
"rowNumber": 1,
"status": "ready",
"createdDealId": "4b0f8cf8-6f8b-4129-94fd-aaf4b7c09dc7",
"importAction": "updated"
}
]
}Schema
externalIdStable asset id from the sponsor system of record.
propertyNameAsset name shown in CapLens.
marketMarket label, such as Seattle, WA.
unitsUnit count for the asset.
sponsorNameSponsor or borrower name.
currentLoan.lenderNameCurrent lender relationship.
currentLoan.loanAmountCurrent loan balance or amount.
currentLoan.maturityDateCurrent loan maturity date.
currentLoan.extensionNoticeDateRefi or extension trigger date.
currentLoan.prepaymentSummaryYield maintenance, defeasance, stepdown, or open-period context.
currentLoan.depositRequirementsDeposits, reserves, escrows, or lender-controlled accounts.
currentLoan.recentLenderConversationInstitutional memory from the latest lender call.
currentLoan.dscr / noi / occupancyOperating snapshot for monitoring and refinance readiness.
rawDataUntouched source payload retained for traceability.
/api/sponsor/api-keysCreate a one-time sponsor integration token from a logged-in CapLens session.
/api/sponsor/api-keys/{id}Soft-revoke a sponsor API key so old integrations stop working without losing audit history.
/api/sponsor/portfolio/{id}/start-refinanceCreate or reuse a draft refinance workflow from an active sponsor portfolio record.
/api/sponsor/portfolio/{id}/lender-appetite-linkGenerate a private lender package link anchored to the lender criteria update form.
OpenAPI preview
The full JSON spec is exposed at /api/public/openapi for technical review and future developer tooling.
{
"openapi": "3.1.0",
"info": {
"title": "CapLens Sponsor Portfolio API",
"version": "2026-07-04",
"summary": "Load existing CRE debt portfolios and convert assets into monitored capital records.",
"description": "Use the Sponsor Portfolio API to validate, import, and update existing debt books from BI tools, spreadsheets, data warehouses, and sponsor systems of record."
},
"paths": {
"/api/sponsor/portfolio/import": {
"post": {
"tags": [
"Sponsor Portfolio"
],
"summary": "Validate, save, or upsert an existing sponsor debt portfolio",
"description": "Validates portfolio rows and optionally creates or updates monitored capital records. Delta updates are keyed by organization, sourceSystem, and externalId.",
"security": [
{
"SponsorApiKey": []
},
{
"CapLensSession": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SponsorPortfolioImportRequest"
}
}
}
},
"responses": {
"200": {
"description": "Validation or import result",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SponsorPortfolioImportResponse"
}
}
}
},
"400": {
"description": "Invalid JSON or missing assets"
},
"401": {
"description": "Missing or invalid sponsor API key/session"
},
"403": {
"description": "API key missing required scope or organization access"
}
}
}
}
}
}Implementation support
Bring your source fields, organization setup, and validation questions. Our team can help you prepare the import.