Analytics
Access KPIs, pipeline metrics, and team leaderboards for your organization.
The analytics API provides real-time reporting on your organization's lending performance, pipeline health, and team rankings.
KPIs
GET /v1/analytics/kpisReturns key performance indicators for the current month with period-over-period comparison.
Example Request
curl -H "Authorization: Bearer lw_live_xxxx" \
https://api.lend.works/v1/analytics/kpisExample Response
{
"data": {
"type": "kpis",
"attributes": {
"leadsCreated": {
"current": 142,
"previous": 128,
"delta": 14,
"deltaPercent": 10.9
},
"opportunitiesSubmitted": {
"current": 48,
"previous": 52,
"delta": -4,
"deltaPercent": -7.7
},
"dealsFunded": {
"current": 18,
"previous": 15,
"delta": 3,
"deltaPercent": 20.0
},
"fundedAmount": {
"current": 4500000,
"previous": 3750000,
"delta": 750000,
"deltaPercent": 20.0
},
"commissionEarned": {
"current": 142500,
"previous": 118750,
"delta": 23750,
"deltaPercent": 20.0
},
"pipelineConversion": {
"current": 12.7,
"previous": 11.7,
"delta": 1.0,
"deltaPercent": 8.5
}
}
},
"meta": {
"requestId": "d43e53f6-a7b8-4c90-1234-567890123def"
}
}Each metric includes:
| Field | Type | Description |
|---|---|---|
current | number | Value for the current period |
previous | number | Value for the previous period |
delta | number | Absolute change |
deltaPercent | number | Percentage change |
Pipeline Metrics
GET /v1/analytics/pipelineReturns pipeline stage metrics showing deal flow, conversion rates, and bottlenecks.
Example Request
curl -H "Authorization: Bearer lw_live_xxxx" \
https://api.lend.works/v1/analytics/pipelineExample Response
{
"data": {
"type": "pipeline",
"attributes": {
"stages": [
{
"stageId": "a1b2c3d4-...",
"stageLabel": "New Lead",
"count": 42,
"totalAmount": 10500000,
"avgDaysInStage": 1.2,
"conversionRateToNext": 72.0
},
{
"stageId": "b2c3d4e5-...",
"stageLabel": "Qualified",
"count": 28,
"totalAmount": 7000000,
"avgDaysInStage": 3.5,
"conversionRateToNext": 64.0
},
{
"stageId": "c3d4e5f6-...",
"stageLabel": "Submitted",
"count": 18,
"totalAmount": 4500000,
"avgDaysInStage": 5.1,
"conversionRateToNext": 55.0
},
{
"stageId": "d4e5f6g7-...",
"stageLabel": "Approved",
"count": 8,
"totalAmount": 2000000,
"avgDaysInStage": 2.0,
"conversionRateToNext": 87.5
},
{
"stageId": "e5f6g7h8-...",
"stageLabel": "Funded",
"count": 7,
"totalAmount": 1750000,
"avgDaysInStage": 0,
"conversionRateToNext": 0
}
]
}
},
"meta": {
"requestId": "e54f64a7-b8c9-4d01-2345-678901234ef0"
}
}Leaderboard
GET /v1/analytics/leaderboardReturns a ranked list of advisors by a chosen performance metric.
Query Parameters
| Parameter | Type | Default | Options | Description |
|---|---|---|---|---|
metric | enum | deals_funded | commission_earned, deals_funded, leads_converted, funded_amount | Ranking metric |
period | enum | this_month | this_week, this_month, this_quarter, ytd | Time period |
limit | integer | 10 | 1-50 | Number of entries |
Example Request
curl -H "Authorization: Bearer lw_live_xxxx" \
"https://api.lend.works/v1/analytics/leaderboard?metric=commission_earned&period=this_month&limit=5"Example Response
{
"data": {
"type": "leaderboard",
"attributes": {
"entries": [
{
"rank": 1,
"advisorId": "e5f6g7h8-...",
"advisorName": "Mike Johnson",
"value": 42000,
"trend": 15.3
},
{
"rank": 2,
"advisorId": "a9b8c7d6-...",
"advisorName": "Sarah Williams",
"value": 38500,
"trend": 8.2
},
{
"rank": 3,
"advisorId": "f1e2d3c4-...",
"advisorName": "David Park",
"value": 31000,
"trend": -2.1
}
]
}
},
"meta": {
"requestId": "f65a75b8-c9d0-4e12-3456-789012345f01"
}
}| Field | Type | Description |
|---|---|---|
rank | integer | Position on the leaderboard |
advisorId | UUID | Advisor's user ID |
advisorName | string | Advisor's display name |
value | number | Metric value |
trend | number | Percentage change from previous period |
Errors
| Status | Code | Description |
|---|---|---|
403 | FORBIDDEN | API key lacks read permission |