@rundit-sdk/embed 0.3.5-rc.15 → 0.3.5-rc.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "paths": {
4
4
  "/api/v2/sdk/companies/dashboards": {
5
5
  "post": {
6
- "description": "PREFERRED tool for multi-company analysis. Returns full dashboards (company metadata, positions, metrics with data points, recent transactions, report summaries) for many companies in a single request, grouped per company. Use this instead of looping `GET /companies/:id/dashboard` (the N+1 pattern) whenever the agent needs to look at more than one company — it returns the same shape per company but in one round trip. Typical workflow: resolve company ids (e.g. `GET /companies?nameSearch=[\"acme\",\"beta\"]`), then call this with their `companyIds`. Use `metricTypeIds` or `metricTypeNames` (case-insensitive exact match on full name or `shortName`) to scope the returned metrics. `metricsFrom` (ISO 8601) sets a lower-bound date for metric data points; omit to include all history. `metricsTimeframe` restricts data point granularity to Month, Quarter, or Year. `currency` (ISO 4217, required) FX-converts all monetary metrics across the batch. `conversionStrategy` controls which rate is applied: `LATEST_FX_RATE` (default) or `ENTITY_DATE_RATE` (the rate on each point's own date). `transactionLimit` / `reportLimit` cap list sizes per company (defaults: 10 and 5 respectively). Dashboards come back in the order the `companyIds` were requested, so `limit`/`cursor` paging is stable.",
6
+ "description": "PREFERRED tool for multi-company analysis. Returns full dashboards (company metadata, positions, metrics with data points, recent transactions, report summaries) for many companies in a single request, grouped per company. Use this instead of looping `GET /companies/:id/dashboard` (the N+1 pattern) whenever the agent needs to look at more than one company — it returns the same shape per company but in one round trip. Typical workflow: resolve company ids (e.g. `GET /companies?nameSearch=[\"acme\",\"beta\"]`), then call this with their `companyIds`. Use `metricTypeIds` or `metricTypeNames` (case-insensitive exact match on full name or `shortName`) to scope the returned metrics. `metricsFrom` (ISO 8601) sets a lower-bound date for metric data points; omit to include all history. `metricsTimeframe` restricts data point granularity to Month, Quarter, or Year. `metricsPointLimit` keeps only the most recent N points per metric (`1` = latest dated point; set `metricsTo` to today to exclude future values) — full histories for many companies add up quickly. `currency` (ISO 4217, required) FX-converts all monetary metrics across the batch. `conversionStrategy` controls which rate is applied: `LATEST_FX_RATE` (default) or `ENTITY_DATE_RATE` (the rate on each point's own date). `transactionLimit` / `reportLimit` cap list sizes per company (defaults: 10 and 5 respectively). Dashboards come back in the order the `companyIds` were requested, so `limit`/`cursor` paging is stable.",
7
7
  "operationId": "companies.getDashboards",
8
8
  "parameters": [],
9
9
  "requestBody": {
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "/api/v2/sdk/companies/{id}/dashboard": {
65
65
  "get": {
66
- "description": "Returns company metadata, positions per fund, all metrics with data points, recent transactions, and report summaries for a single company. For more than one company, prefer POST /companies/dashboards (`companies.getDashboards`) instead — it returns the same payload per company in one call and avoids the N+1 pattern. Use `metricsFrom` to limit metric history, `transactionLimit` and `reportLimit` to cap list sizes.",
66
+ "description": "Returns company metadata, positions per fund, metrics with data points, recent transactions, and report summaries for a single company. For more than one company, prefer POST /companies/dashboards (`companies.getDashboards`) instead — it returns the same payload per company in one call and avoids the N+1 pattern. Takes the same metric options as the batch route: `metricTypeNames` / `metricTypeIds` scope which metrics are included, `metricsTimeframe` picks a granularity, `metricsFrom`, `metricsTo`, and `metricsPointLimit` limit history (`metricsPointLimit: 1` = latest dated point; set `metricsTo` to today for current values — prefer it over `metricsFrom` for \"latest\" reads, since a date lower bound hides values last reported before it). `transactionLimit` and `reportLimit` cap list sizes.",
67
67
  "operationId": "companies.getDashboard",
68
68
  "parameters": [
69
69
  {
@@ -93,6 +93,76 @@
93
93
  "type": "string"
94
94
  }
95
95
  },
96
+ {
97
+ "name": "metricsTo",
98
+ "required": false,
99
+ "in": "query",
100
+ "description": "Inclusive upper bound for metric data points (ISO 8601). Pair with metricsPointLimit: 1 for latest values as of this date; omit to allow future-dated points.",
101
+ "schema": {
102
+ "type": "string"
103
+ }
104
+ },
105
+ {
106
+ "name": "metricsTimeframe",
107
+ "required": false,
108
+ "in": "query",
109
+ "description": "Restrict metric data points to this reporting period granularity.",
110
+ "schema": {
111
+ "type": "string",
112
+ "enum": [
113
+ "Month",
114
+ "Quarter",
115
+ "Year"
116
+ ]
117
+ }
118
+ },
119
+ {
120
+ "name": "metricsPointLimit",
121
+ "required": false,
122
+ "in": "query",
123
+ "description": "Keep only the most recent N data points per metric (applied after `metricsFrom` / `metricsTo` / `metricsTimeframe`). Omit for the full history; `1` yields the latest dated point, which may be in the future. Set `metricsTo` to today for current values and `metricsTimeframe` for a single granularity.",
124
+ "schema": {
125
+ "minimum": 1,
126
+ "type": "number"
127
+ }
128
+ },
129
+ {
130
+ "name": "metricTypeNames",
131
+ "required": false,
132
+ "in": "query",
133
+ "description": "Metric type names to include (case-insensitive exact match on display name or `shortName`). Omit to include all metrics. Names that match no accessible metric type are ignored.",
134
+ "schema": {
135
+ "type": "array",
136
+ "items": {
137
+ "type": "string"
138
+ }
139
+ }
140
+ },
141
+ {
142
+ "name": "metricTypeIds",
143
+ "required": false,
144
+ "in": "query",
145
+ "description": "Metric type identifiers to include. Intersected with `metricTypeNames` when both are provided.",
146
+ "schema": {
147
+ "type": "array",
148
+ "items": {
149
+ "type": "number"
150
+ }
151
+ }
152
+ },
153
+ {
154
+ "name": "conversionStrategy",
155
+ "required": false,
156
+ "in": "query",
157
+ "description": "FX rate selection when converting monetary metrics. `LATEST_FX_RATE` (default) uses the most recent rate; `ENTITY_DATE_RATE` uses the rate on each point's date.",
158
+ "schema": {
159
+ "type": "string",
160
+ "enum": [
161
+ "LATEST_FX_RATE",
162
+ "ENTITY_DATE_RATE"
163
+ ]
164
+ }
165
+ },
96
166
  {
97
167
  "name": "transactionLimit",
98
168
  "required": false,
@@ -467,7 +537,7 @@
467
537
  },
468
538
  "/api/v2/sdk/positions/portfolio/summary": {
469
539
  "get": {
470
- "description": "Returns one row per company *per fund* — a company held by two funds appears twice, distinguished by `companyGroupId` — with position data (invested, fair value, multiple, ROI) and latest values for selected metrics. Defaults to MRR, Cash Balance, Headcount, Net Burn Rate, and Runway. Override with `metricTypeNames` (case-insensitive exact match on full name or `shortName`). Designed for portfolio overview tables. Ordered by company id, then fund id.",
540
+ "description": "Returns position data (invested, fair value, multiple, ROI) and latest monthly metrics as of `date` (today by default). One row per company and fund by default; `groupBy: Company` combines selected accessible funds into one row per company. For top 3 companies by fair value use `groupBy: Company`, `sortBy: fairValue`, `sortDirection: desc`, `limit: 3`, `includeMetrics: false`. Sorting happens before pagination; metrics are loaded only for the returned page. Default metrics are MRR, Cash Balance, Headcount, Net Burn Rate, and Runway. Override with `metricTypeNames` or set `includeMetrics: false` to skip metrics entirely. Without a limit all rows are returned and can be large. Default order is company id, then fund id.",
471
541
  "operationId": "positions.getPortfolioSummary",
472
542
  "parameters": [
473
543
  {
@@ -490,6 +560,60 @@
490
560
  "type": "string"
491
561
  }
492
562
  },
563
+ {
564
+ "name": "groupBy",
565
+ "required": false,
566
+ "in": "query",
567
+ "description": "CompanyGroup (default) returns one row per company and fund. Company combines all selected, accessible funds into one row per company using the investment engine totals; companyGroupId is null and companyGroup is omitted.",
568
+ "schema": {
569
+ "default": "CompanyGroup",
570
+ "type": "string",
571
+ "enum": [
572
+ "CompanyGroup",
573
+ "Company"
574
+ ]
575
+ }
576
+ },
577
+ {
578
+ "name": "sortBy",
579
+ "required": false,
580
+ "in": "query",
581
+ "description": "Sort before pagination. For the top companies by fair value use groupBy: Company, sortBy: fairValue, sortDirection: desc, limit: 3. Missing values sort last; company and fund ids break ties.",
582
+ "schema": {
583
+ "default": "companyId",
584
+ "type": "string",
585
+ "enum": [
586
+ "companyId",
587
+ "fairValue",
588
+ "invested",
589
+ "realized",
590
+ "multiple"
591
+ ]
592
+ }
593
+ },
594
+ {
595
+ "name": "sortDirection",
596
+ "required": false,
597
+ "in": "query",
598
+ "schema": {
599
+ "default": "asc",
600
+ "type": "string",
601
+ "enum": [
602
+ "asc",
603
+ "desc"
604
+ ]
605
+ }
606
+ },
607
+ {
608
+ "name": "includeMetrics",
609
+ "required": false,
610
+ "in": "query",
611
+ "description": "Include the latest monthly metric snapshot as of date (defaults to today). Set false for position-only queries: skips metric computation and returns latestMetrics: [].",
612
+ "schema": {
613
+ "default": true,
614
+ "type": "boolean"
615
+ }
616
+ },
493
617
  {
494
618
  "name": "companyGroupIds",
495
619
  "required": false,
@@ -638,7 +762,7 @@
638
762
  "name": "currency",
639
763
  "required": true,
640
764
  "in": "query",
641
- "description": "Reporting currency code",
765
+ "description": "Reporting currency code (ISO 4217)",
642
766
  "schema": {
643
767
  "type": "string"
644
768
  }
@@ -727,7 +851,7 @@
727
851
  "name": "currency",
728
852
  "required": true,
729
853
  "in": "query",
730
- "description": "Reporting currency code",
854
+ "description": "Reporting currency code (ISO 4217)",
731
855
  "schema": {
732
856
  "type": "string"
733
857
  }
@@ -1182,7 +1306,7 @@
1182
1306
  },
1183
1307
  "/api/v2/sdk/metrics/types": {
1184
1308
  "get": {
1185
- "description": "Returns predefined metric types plus user-defined metric types scoped to the caller — VC group custom types for VC users, company custom types for company users. Each entry carries the metric shape needed to interpret values: `valueType` is `\"numeric\"` (read `point.value` as a number; may carry `rangeConfig` with min/max/step for ranged metrics) or `\"option\"` (read `point.optionValue` as a string from `optionConfig.options[]` — this is how boolean / yes-no metrics are encoded, as two options typically labelled \"Yes\"/\"No\"). `unit.unit` describes the measurement (`Currency`, `Percentage`, `Number`, time units, ...); `unit.currencyCode` is intentionally null on this endpoint because monetary types resolve their concrete currency per company — call /metrics to receive `unit.currencyCode` populated with each company's native currency, or pass `currency` to convert all monetary metrics to a chosen target. Ordered by metric type id ascending.",
1309
+ "description": "Returns predefined metric types plus user-defined metric types scoped to the caller — VC group custom types for VC users, company custom types for company users. Each entry carries the metric shape needed to interpret values: `valueType` is `\"numeric\"` (read `point.value` as a number; may carry `rangeConfig` with min/max/step for ranged metrics) or `\"option\"` (read `point.optionValue` as a string from `optionConfig.options[]` — this is how boolean / yes-no metrics are encoded, as two options typically labelled \"Yes\"/\"No\"). `unit.unit` describes the measurement (`Currency`, `Percentage`, `Number`, time units, ...); `unit.currencyCode` is intentionally null on this endpoint because monetary types resolve their concrete currency per company — call /metrics to receive `unit.currencyCode` populated with each company's native currency, or pass `currency` to convert all monetary metrics to a chosen target. Filter with `nameSearch` (case-insensitive substring on name or `shortName`, OR across an array) to find a few types without paging the whole catalogue — e.g. `nameSearch=[\"mrr\",\"burn\"]`. Ordered by metric type id ascending.",
1186
1310
  "operationId": "metrics.getTypes",
1187
1311
  "parameters": [
1188
1312
  {
@@ -1204,6 +1328,18 @@
1204
1328
  "schema": {
1205
1329
  "type": "string"
1206
1330
  }
1331
+ },
1332
+ {
1333
+ "name": "nameSearch",
1334
+ "required": false,
1335
+ "in": "query",
1336
+ "description": "Case-insensitive substring match on metric type name or `shortName`. Pass an array to look up several types in one call — a type matches if ANY listed substring occurs (OR semantics). Use it to find ids or exact names without paging the whole catalogue.",
1337
+ "schema": {
1338
+ "type": "array",
1339
+ "items": {
1340
+ "type": "string"
1341
+ }
1342
+ }
1207
1343
  }
1208
1344
  ],
1209
1345
  "responses": {
@@ -1249,7 +1385,7 @@
1249
1385
  },
1250
1386
  "/api/v2/sdk/metrics": {
1251
1387
  "post": {
1252
- "description": "Returns metric data points for companies the caller can access (companies in the caller's VC group portfolio, or the caller's own company for company users). Each entry carries company and metric type references with id and human-readable name. Each point carries both `value` (number, for `valueType === \"numeric\"`, including ranged numerics constrained by the type's `rangeConfig`) and `optionValue` (string, for `valueType === \"option\"`, matching one of `metricType.optionConfig.options[].value` — this is how boolean/yes-no metrics report their reading); read whichever matches the metric type's `valueType`. Filter by company id, company name substring (`companyNameSearch`), company group, metric type id, metric type name (`metricTypeNames` — case-insensitive exact match on either the full name or the `shortName`, so \"MRR\" and \"MRR - Monthly Recurring Revenue\" both work), timeframe, and date range to narrow the response. Pass `currency` (ISO 4217) to FX-convert monetary metrics to that target currency in one call instead of fetching company currencies separately. Entries are ordered by company id ascending — one entry per company, so `limit` pages whole companies, never partial metric lists.",
1388
+ "description": "Returns metric data points for companies the caller can access (companies in the caller's VC group portfolio, or the caller's own company for company users). Each entry carries company and metric type references with id and human-readable name. Each point carries both `value` (number, for `valueType === \"numeric\"`, including ranged numerics constrained by the type's `rangeConfig`) and `optionValue` (string, for `valueType === \"option\"`, matching one of `metricType.optionConfig.options[].value` — this is how boolean/yes-no metrics report their reading); read whichever matches the metric type's `valueType`. Each entry embeds a metric type *summary* (id, name, shortName, valueType, unit, plus option/range config when relevant); the full definition lives on /metrics/types. Filter by company id, company name substring (`companyNameSearch`), company group, metric type id, metric type name (`metricTypeNames` — case-insensitive exact match on either the full name or the `shortName`, so \"MRR\" and \"MRR - Monthly Recurring Revenue\" both work), timeframe, and date range to narrow the response. Pass `currency` (ISO 4217) to FX-convert monetary metrics to that target currency in one call instead of fetching company currencies separately. Use `pointLimit` to keep only the most recent N points per metric (`pointLimit: 1` = latest dated point; set `to` to today to exclude future values) — without it every historical point is returned, which can be very large across a portfolio. Entries are ordered by company id ascending — one entry per company, so `limit` pages whole companies, never partial metric lists.",
1253
1389
  "operationId": "metrics.search",
1254
1390
  "parameters": [],
1255
1391
  "requestBody": {
@@ -1305,7 +1441,7 @@
1305
1441
  },
1306
1442
  "/api/v2/sdk/metrics/compare": {
1307
1443
  "post": {
1308
- "description": "Returns date-aligned rows for one or more metric types across multiple companies. Pass `metricTypeIds` (resolve from /metrics/types) to compare several metrics in a single round trip; names are not accepted on this endpoint to keep selection stable. Each row contains one value per company for a given period. Optionally includes period-over-period percentage change. Use `companyIds`, `companyNameSearch`, or `companyGroupIds` to select companies.",
1444
+ "description": "Returns date-aligned rows for one or more metric types across multiple companies. Select metric types with `metricTypeIds` and/or `metricTypeNames` (case-insensitive exact match on name or `shortName`, e.g. \"MRR\"); several metrics are compared in a single round trip, one entry per metric type in `metricTypeIds` order; name-only selections follow catalogue order. Each row contains one value per company for a given period. Optionally includes period-over-period percentage change. Use `companyIds`, `companyNameSearch`, or `companyGroupIds` to select companies.",
1309
1445
  "operationId": "metrics.compare",
1310
1446
  "parameters": [],
1311
1447
  "requestBody": {
@@ -1361,7 +1497,7 @@
1361
1497
  },
1362
1498
  "/api/v2/sdk/metrics/aggregate": {
1363
1499
  "post": {
1364
- "description": "Returns aggregated metric values (SUM, AVG, MEDIAN, MIN, MAX, COUNT) across companies for each reporting period. Pass `metricTypeIds` (resolve from /metrics/types) to select what to aggregate; names are not accepted on this endpoint to keep selection stable. Optionally group results by fund (`companyGroupId`) for fund-level breakdowns. MIN, MAX, and COUNT are always computed. SUM, AVG, and MEDIAN are only produced when the metric type enables them in its `summaryAggregationMethods` configuration; otherwise `point.value` is `null` for that aggregation. Every requested metric type the caller can access yields one entry (per fund when grouped) — with an empty `points` array when none of the selected companies has a value for it, so \"no data\" is explicit rather than a missing row. Ids that match no accessible metric type produce no entry. Select companies with `companyIds`, `companyNameSearch`, or `companyGroupIds`; when those select no company at all the response is an empty list. Ordered by fund id, then by the order of the requested `metricTypeIds`.",
1500
+ "description": "Returns aggregated metric values (SUM, AVG, MEDIAN, MIN, MAX, COUNT) across companies for each reporting period. Select metric types with `metricTypeIds` and/or `metricTypeNames` (case-insensitive exact match on name or `shortName`, e.g. \"MRR\"). Optionally group results by fund (`companyGroupId`) for fund-level breakdowns. MIN, MAX, and COUNT are always computed. SUM, AVG, and MEDIAN are only produced when the metric type enables them in its `summaryAggregationMethods` configuration; otherwise `point.value` is `null` for that aggregation. Every requested metric type the caller can access yields one entry (per fund when grouped) — with an empty `points` array when none of the selected companies has a value for it, so \"no data\" is explicit rather than a missing row. Ids that match no accessible metric type produce no entry. Select companies with `companyIds`, `companyNameSearch`, or `companyGroupIds`; when those select no company at all the response is an empty list. Ordered by fund id, then in the order the metric types were requested (`metricTypeIds` order; name-resolved types follow the catalogue order).",
1365
1501
  "operationId": "metrics.aggregate",
1366
1502
  "parameters": [],
1367
1503
  "requestBody": {
@@ -1417,7 +1553,7 @@
1417
1553
  },
1418
1554
  "/api/v2/sdk/company-reports": {
1419
1555
  "get": {
1420
- "description": "Returns lightweight report metadata (id, title, period, publisher company reference). Use GET /company-reports/:id to fetch the full content of a specific report. Visibility is determined by the caller's roles — VC users see reports for managed-portfolio companies, company employees see their own company's reports, portfolio investors see Published reports shared with their visibility groups. Filters narrow the list by company ids, funds (`companyGroupIds`), company name substring (`companyNameSearch`), and reporting period (timeframe + date range). Ordered by report date descending, then id descending — newest first.",
1556
+ "description": "Returns lightweight report metadata (id, title, period, publisher company reference). Use GET /company-reports/:id to fetch the full content of a specific report. Visibility is determined by the caller's roles — VC users see reports for managed-portfolio companies, company employees see their own company's reports, portfolio investors see Published reports shared with their visibility groups. Filters narrow the list by company ids, funds (`companyGroupIds`), company name substring (`companyNameSearch`), and reporting period (timeframe + date range). Ordered by reporting period date descending, then id descending by default. Use `sortBy: publishedAt` and `limit: 1` for the most recently published report; publication order can differ from period order.",
1421
1557
  "operationId": "companyReports.list",
1422
1558
  "parameters": [
1423
1559
  {
@@ -1440,6 +1576,20 @@
1440
1576
  "type": "string"
1441
1577
  }
1442
1578
  },
1579
+ {
1580
+ "name": "sortBy",
1581
+ "required": false,
1582
+ "in": "query",
1583
+ "description": "Descending sort, with report id descending as a tiebreaker and missing dates last. date (default) is the reporting period; publishedAt is the publication timestamp. Use publishedAt with limit: 1 for the most recently published report.",
1584
+ "schema": {
1585
+ "default": "date",
1586
+ "type": "string",
1587
+ "enum": [
1588
+ "date",
1589
+ "publishedAt"
1590
+ ]
1591
+ }
1592
+ },
1443
1593
  {
1444
1594
  "name": "companyIds",
1445
1595
  "required": false,
@@ -1659,6 +1809,10 @@
1659
1809
  "type": "string",
1660
1810
  "description": "Lower bound for metric data points (ISO 8601). Omit to include all available history."
1661
1811
  },
1812
+ "metricsTo": {
1813
+ "type": "string",
1814
+ "description": "Inclusive upper bound for metric data points (ISO 8601). Pair with metricsPointLimit: 1 for latest values as of this date; omit to allow future-dated points."
1815
+ },
1662
1816
  "metricsTimeframe": {
1663
1817
  "type": "string",
1664
1818
  "description": "Restrict metric data points to this reporting period granularity.",
@@ -1668,6 +1822,11 @@
1668
1822
  "Year"
1669
1823
  ]
1670
1824
  },
1825
+ "metricsPointLimit": {
1826
+ "type": "number",
1827
+ "description": "Keep only the most recent N data points per metric (applied after `metricsFrom` / `metricsTo` / `metricsTimeframe`). Omit for the full history; `1` yields the latest dated point, which may be in the future. Set `metricsTo` to today for current values and `metricsTimeframe` for a single granularity.",
1828
+ "minimum": 1
1829
+ },
1671
1830
  "metricTypeNames": {
1672
1831
  "description": "Metric type names to include (case-insensitive exact match on display name or `shortName`). Omit to include all metrics. Use metric type ids via `metricTypeIds` when ids are known. Names that match no accessible metric type are ignored.",
1673
1832
  "type": "array",
@@ -2291,8 +2450,21 @@
2291
2450
  "type": "object",
2292
2451
  "properties": {
2293
2452
  "unit": {
2294
- "type": "object",
2295
- "description": "Unit category. Examples: \"Currency\", \"Percentage\", \"Number\", \"Day\", \"Month\", \"Quarter\", \"Year\"."
2453
+ "type": "string",
2454
+ "description": "Unit category. Examples: \"Currency\", \"Percentage\", \"Number\", \"Day\", \"Month\", \"Quarter\", \"Year\".",
2455
+ "enum": [
2456
+ "Percentage",
2457
+ "Currency",
2458
+ "Number",
2459
+ "Second",
2460
+ "Minute",
2461
+ "Hour",
2462
+ "Day",
2463
+ "Week",
2464
+ "Month",
2465
+ "Quarter",
2466
+ "Year"
2467
+ ]
2296
2468
  },
2297
2469
  "currencyCode": {
2298
2470
  "type": "string",
@@ -2358,7 +2530,7 @@
2358
2530
  "step"
2359
2531
  ]
2360
2532
  },
2361
- "SdkMetricTypeDto": {
2533
+ "SdkMetricTypeSummaryDto": {
2362
2534
  "type": "object",
2363
2535
  "properties": {
2364
2536
  "id": {
@@ -2374,22 +2546,13 @@
2374
2546
  "description": "Short display name / abbreviation.",
2375
2547
  "nullable": true
2376
2548
  },
2377
- "description": {
2378
- "type": "string",
2379
- "description": "Free-form description of what the metric represents.",
2380
- "nullable": true
2381
- },
2382
- "origin": {
2383
- "type": "object",
2384
- "description": "Origin: predefined by Rundit or user-defined within the VC group."
2385
- },
2386
- "aggMethod": {
2387
- "type": "object",
2388
- "description": "How values aggregate across periods when rolled up (e.g. SUM, AVG, LAST_AVAILABLE, NONE)."
2389
- },
2390
2549
  "valueType": {
2391
- "type": "object",
2392
- "description": "Shape of each point's value: `\"numeric\"` — read `points[].value` as a number; `\"option\"` — read `points[].optionValue` as a string from `optionConfig.options[]` (this is how boolean / yes-no metrics are encoded — two options, typically \"Yes\"/\"No\"). Numeric metrics may additionally carry a `rangeConfig` constraining `value` to [min, max] with a `step`."
2550
+ "type": "string",
2551
+ "description": "Shape of each point's value: `\"numeric\"` — read `points[].value` as a number; `\"option\"` — read `points[].optionValue` as a string from `optionConfig.options[]` (this is how boolean / yes-no metrics are encoded — two options, typically \"Yes\"/\"No\"). Numeric metrics may additionally carry a `rangeConfig` constraining `value` to [min, max] with a `step`.",
2552
+ "enum": [
2553
+ "numeric",
2554
+ "option"
2555
+ ]
2393
2556
  },
2394
2557
  "unit": {
2395
2558
  "description": "Unit of measurement.",
@@ -2402,7 +2565,7 @@
2402
2565
  ]
2403
2566
  },
2404
2567
  "optionConfig": {
2405
- "description": "Allowed values when `valueType === \"option\"`. Each point reports its choice in `optionValue`. Boolean (yes/no) metrics surface here as two options.",
2568
+ "description": "Allowed values when `valueType === \"option\"`. Each point reports its choice in `optionValue`. Boolean (yes/no) metrics surface here as two options. Omitted from embedded summaries when the type is not option-valued.",
2406
2569
  "nullable": true,
2407
2570
  "type": "object",
2408
2571
  "allOf": [
@@ -2412,7 +2575,7 @@
2412
2575
  ]
2413
2576
  },
2414
2577
  "rangeConfig": {
2415
- "description": "Bounds for ranged numeric metrics: each point's `value` is constrained to `[min, max]` with the given `step`. Absent when the metric is unbounded.",
2578
+ "description": "Bounds for ranged numeric metrics: each point's `value` is constrained to `[min, max]` with the given `step`. Omitted from embedded summaries when the metric is unbounded.",
2416
2579
  "nullable": true,
2417
2580
  "type": "object",
2418
2581
  "allOf": [
@@ -2424,8 +2587,7 @@
2424
2587
  },
2425
2588
  "required": [
2426
2589
  "id",
2427
- "name",
2428
- "aggMethod"
2590
+ "name"
2429
2591
  ]
2430
2592
  },
2431
2593
  "SdkMetricPointDto": {
@@ -2436,8 +2598,13 @@
2436
2598
  "description": "Period end date (ISO 8601, YYYY-MM-DD)."
2437
2599
  },
2438
2600
  "timeframe": {
2439
- "type": "object",
2440
- "description": "Reporting period granularity."
2601
+ "type": "string",
2602
+ "description": "Reporting period granularity.",
2603
+ "enum": [
2604
+ "Month",
2605
+ "Quarter",
2606
+ "Year"
2607
+ ]
2441
2608
  },
2442
2609
  "value": {
2443
2610
  "type": "number",
@@ -2451,12 +2618,12 @@
2451
2618
  },
2452
2619
  "valueError": {
2453
2620
  "type": "string",
2454
- "description": "Computation error message, if the value could not be calculated.",
2621
+ "description": "Computation error message when the value could not be calculated. Omitted otherwise.",
2455
2622
  "nullable": true
2456
2623
  },
2457
2624
  "aggregated": {
2458
2625
  "type": "boolean",
2459
- "description": "True when the point is derived (e.g. aggregated from sub-rows) rather than directly stored."
2626
+ "description": "True when the point is derived (e.g. rolled up from finer periods) rather than directly reported. Omitted otherwise."
2460
2627
  }
2461
2628
  },
2462
2629
  "required": [
@@ -2474,10 +2641,10 @@
2474
2641
  "description": "Metric instance identifier (unique per company)."
2475
2642
  },
2476
2643
  "metricType": {
2477
- "description": "Metric type definition.",
2644
+ "description": "Metric type summary — the fields needed to interpret `points`. Fetch the full definition (description, origin, roll-up method) from /metrics/types.",
2478
2645
  "allOf": [
2479
2646
  {
2480
- "$ref": "#/components/schemas/SdkMetricTypeDto"
2647
+ "$ref": "#/components/schemas/SdkMetricTypeSummaryDto"
2481
2648
  }
2482
2649
  ]
2483
2650
  },
@@ -2540,8 +2707,13 @@
2540
2707
  "description": "Reporting period end date (ISO 8601, YYYY-MM-DD)."
2541
2708
  },
2542
2709
  "timeframe": {
2543
- "type": "object",
2544
- "description": "Reporting period granularity."
2710
+ "type": "string",
2711
+ "description": "Reporting period granularity.",
2712
+ "enum": [
2713
+ "Month",
2714
+ "Quarter",
2715
+ "Year"
2716
+ ]
2545
2717
  },
2546
2718
  "publishedAt": {
2547
2719
  "type": "string",
@@ -5021,6 +5193,90 @@
5021
5193
  "meta"
5022
5194
  ]
5023
5195
  },
5196
+ "SdkMetricTypeDto": {
5197
+ "type": "object",
5198
+ "properties": {
5199
+ "id": {
5200
+ "type": "number",
5201
+ "description": "Metric type identifier."
5202
+ },
5203
+ "name": {
5204
+ "type": "string",
5205
+ "description": "Metric type display name."
5206
+ },
5207
+ "shortName": {
5208
+ "type": "string",
5209
+ "description": "Short display name / abbreviation.",
5210
+ "nullable": true
5211
+ },
5212
+ "valueType": {
5213
+ "type": "string",
5214
+ "description": "Shape of each point's value: `\"numeric\"` — read `points[].value` as a number; `\"option\"` — read `points[].optionValue` as a string from `optionConfig.options[]` (this is how boolean / yes-no metrics are encoded — two options, typically \"Yes\"/\"No\"). Numeric metrics may additionally carry a `rangeConfig` constraining `value` to [min, max] with a `step`.",
5215
+ "enum": [
5216
+ "numeric",
5217
+ "option"
5218
+ ]
5219
+ },
5220
+ "unit": {
5221
+ "description": "Unit of measurement.",
5222
+ "nullable": true,
5223
+ "type": "object",
5224
+ "allOf": [
5225
+ {
5226
+ "$ref": "#/components/schemas/SdkMetricUnitDto"
5227
+ }
5228
+ ]
5229
+ },
5230
+ "optionConfig": {
5231
+ "description": "Allowed values when `valueType === \"option\"`. Each point reports its choice in `optionValue`. Boolean (yes/no) metrics surface here as two options. Omitted from embedded summaries when the type is not option-valued.",
5232
+ "nullable": true,
5233
+ "type": "object",
5234
+ "allOf": [
5235
+ {
5236
+ "$ref": "#/components/schemas/SdkMetricTypeOptionConfigDto"
5237
+ }
5238
+ ]
5239
+ },
5240
+ "rangeConfig": {
5241
+ "description": "Bounds for ranged numeric metrics: each point's `value` is constrained to `[min, max]` with the given `step`. Omitted from embedded summaries when the metric is unbounded.",
5242
+ "nullable": true,
5243
+ "type": "object",
5244
+ "allOf": [
5245
+ {
5246
+ "$ref": "#/components/schemas/SdkMetricTypeRangeConfigDto"
5247
+ }
5248
+ ]
5249
+ },
5250
+ "description": {
5251
+ "type": "string",
5252
+ "description": "Free-form description of what the metric represents.",
5253
+ "nullable": true
5254
+ },
5255
+ "origin": {
5256
+ "type": "string",
5257
+ "description": "Origin: predefined by Rundit or user-defined within the VC group.",
5258
+ "enum": [
5259
+ "Predefined",
5260
+ "UserDefined"
5261
+ ]
5262
+ },
5263
+ "aggMethod": {
5264
+ "type": "string",
5265
+ "description": "How values aggregate across periods when rolled up (e.g. SUM, AVG, LAST_AVAILABLE, NONE).",
5266
+ "enum": [
5267
+ "SUM",
5268
+ "LAST_AVAILABLE",
5269
+ "AVG",
5270
+ "NONE"
5271
+ ]
5272
+ }
5273
+ },
5274
+ "required": [
5275
+ "id",
5276
+ "name",
5277
+ "aggMethod"
5278
+ ]
5279
+ },
5024
5280
  "SdkMetricTypesListResponseDto": {
5025
5281
  "type": "object",
5026
5282
  "properties": {
@@ -5074,6 +5330,102 @@
5074
5330
  "timeframe"
5075
5331
  ]
5076
5332
  },
5333
+ "SdkMetricBatchWriteItemDto": {
5334
+ "type": "object",
5335
+ "properties": {
5336
+ "metricTypeId": {
5337
+ "type": "number",
5338
+ "description": "Existing metric type id. Supply exactly one of metricTypeId or metricTypeName."
5339
+ },
5340
+ "metricTypeName": {
5341
+ "type": "string",
5342
+ "description": "Exact case-insensitive full name or shortName, e.g. MRR. Unknown or ambiguous names fail."
5343
+ },
5344
+ "flavor": {
5345
+ "type": "string",
5346
+ "enum": [
5347
+ "actual",
5348
+ "forecast",
5349
+ "budget"
5350
+ ],
5351
+ "default": "actual",
5352
+ "description": "Select an existing row. Missing forecast/budget rows are not created."
5353
+ },
5354
+ "points": {
5355
+ "minItems": 1,
5356
+ "maxItems": 250,
5357
+ "type": "array",
5358
+ "items": {
5359
+ "$ref": "#/components/schemas/SdkMetricPointWriteDto"
5360
+ }
5361
+ }
5362
+ },
5363
+ "required": [
5364
+ "points"
5365
+ ]
5366
+ },
5367
+ "SdkCompanyMetricBatchWriteDto": {
5368
+ "type": "object",
5369
+ "properties": {
5370
+ "companyId": {
5371
+ "type": "number"
5372
+ },
5373
+ "currency": {
5374
+ "type": "string",
5375
+ "description": "Company native currency, e.g. USD. Writes do not convert FX."
5376
+ },
5377
+ "items": {
5378
+ "minItems": 1,
5379
+ "maxItems": 50,
5380
+ "type": "array",
5381
+ "items": {
5382
+ "$ref": "#/components/schemas/SdkMetricBatchWriteItemDto"
5383
+ }
5384
+ }
5385
+ },
5386
+ "required": [
5387
+ "companyId",
5388
+ "currency",
5389
+ "items"
5390
+ ]
5391
+ },
5392
+ "SdkMetricBatchWriteRequestDto": {
5393
+ "type": "object",
5394
+ "properties": {
5395
+ "companies": {
5396
+ "minItems": 1,
5397
+ "maxItems": 100,
5398
+ "description": "Each company may appear once. Maximum 1000 metric items and 10000 points across the request.",
5399
+ "type": "array",
5400
+ "items": {
5401
+ "$ref": "#/components/schemas/SdkCompanyMetricBatchWriteDto"
5402
+ }
5403
+ }
5404
+ },
5405
+ "required": [
5406
+ "companies"
5407
+ ]
5408
+ },
5409
+ "SdkMetricBatchWriteResponseDto": {
5410
+ "type": "object",
5411
+ "properties": {
5412
+ "companyCount": {
5413
+ "type": "number"
5414
+ },
5415
+ "metricCount": {
5416
+ "type": "number"
5417
+ },
5418
+ "pointsWritten": {
5419
+ "type": "number",
5420
+ "description": "Number of submitted points successfully upserted, including identical values. No point values are echoed."
5421
+ }
5422
+ },
5423
+ "required": [
5424
+ "companyCount",
5425
+ "metricCount",
5426
+ "pointsWritten"
5427
+ ]
5428
+ },
5077
5429
  "SdkMetricPointsWriteRequestDto": {
5078
5430
  "type": "object",
5079
5431
  "properties": {
@@ -5131,7 +5483,7 @@
5131
5483
  }
5132
5484
  },
5133
5485
  "companyNameSearch": {
5134
- "description": "Resolve companies by case-insensitive substring match on their display name. Pass an array to resolve multiple companies in one call — a company matches if its name contains ANY of the listed substrings (OR semantics). A single string is also accepted and treated as a one-element array. Intersects with `companyIds`/`companyGroupIds`. Lets the agent skip a separate /companies lookup when it only knows names.",
5486
+ "description": "Resolve companies by case-insensitive substring match on their display name. Pass an array to resolve multiple companies in one call — a company matches if its name contains ANY of the listed substrings (OR semantics). Intersects with `companyIds`/`companyGroupIds`. Lets the agent skip a separate /companies lookup when it only knows names.",
5135
5487
  "type": "array",
5136
5488
  "items": {
5137
5489
  "type": "string"
@@ -5186,6 +5538,11 @@
5186
5538
  "LATEST_FX_RATE",
5187
5539
  "ENTITY_DATE_RATE"
5188
5540
  ]
5541
+ },
5542
+ "pointLimit": {
5543
+ "type": "number",
5544
+ "description": "Keep only the most recent N data points per metric, applied after the `timeframe` and date filters. Points stay in date-ascending order. Omit for the full history. `pointLimit: 1` returns the latest dated point, which may be in the future. Set `to` to today for current values; pair with `timeframe` so the window is a single granularity.",
5545
+ "minimum": 1
5189
5546
  }
5190
5547
  }
5191
5548
  },
@@ -5240,7 +5597,7 @@
5240
5597
  "type": "object",
5241
5598
  "properties": {
5242
5599
  "metricTypeIds": {
5243
- "description": "Metric type identifiers to compare (resolve names to ids via /metrics/types). When multiple ids are provided, the response contains one entry per metric type.",
5600
+ "description": "Metric type identifiers to compare (discover ids via /metrics/types). One comparison entry is returned per metric type, in this order. Required unless `metricTypeNames` is given; intersected with it when both are given.",
5244
5601
  "example": [
5245
5602
  1,
5246
5603
  7
@@ -5250,6 +5607,13 @@
5250
5607
  "type": "number"
5251
5608
  }
5252
5609
  },
5610
+ "metricTypeNames": {
5611
+ "description": "Metric type names to compare — case-insensitive exact match on display name or `shortName` (so \"MRR\" and \"MRR - Monthly Recurring Revenue\" both work). Lets a caller compare by name without resolving ids first. Intersected with `metricTypeIds` when both are given. Names that match no accessible metric type are ignored.",
5612
+ "type": "array",
5613
+ "items": {
5614
+ "type": "string"
5615
+ }
5616
+ },
5253
5617
  "companyIds": {
5254
5618
  "description": "Restrict to these company identifiers.",
5255
5619
  "type": "array",
@@ -5258,7 +5622,7 @@
5258
5622
  }
5259
5623
  },
5260
5624
  "companyNameSearch": {
5261
- "description": "Case-insensitive substring match on company display name. Pass an array to compare multiple companies in one call — a company matches if its name contains ANY of the listed substrings (OR semantics). A single string is also accepted and treated as a one-element array. Intersects with `companyIds`/`companyGroupIds`.",
5625
+ "description": "Case-insensitive substring match on company display name. Pass an array to compare multiple companies in one call — a company matches if its name contains ANY of the listed substrings (OR semantics). Intersects with `companyIds`/`companyGroupIds`.",
5262
5626
  "type": "array",
5263
5627
  "items": {
5264
5628
  "type": "string"
@@ -5305,10 +5669,7 @@
5305
5669
  "description": "Include period-over-period percentage change for each value.",
5306
5670
  "default": false
5307
5671
  }
5308
- },
5309
- "required": [
5310
- "metricTypeIds"
5311
- ]
5672
+ }
5312
5673
  },
5313
5674
  "SdkMetricTypeReferenceDto": {
5314
5675
  "type": "object",
@@ -5362,8 +5723,13 @@
5362
5723
  "description": "Period date (ISO 8601, YYYY-MM-DD)."
5363
5724
  },
5364
5725
  "timeframe": {
5365
- "type": "object",
5366
- "description": "Reporting period granularity."
5726
+ "type": "string",
5727
+ "description": "Reporting period granularity.",
5728
+ "enum": [
5729
+ "Month",
5730
+ "Quarter",
5731
+ "Year"
5732
+ ]
5367
5733
  },
5368
5734
  "values": {
5369
5735
  "description": "One entry per company with the metric value for this period.",
@@ -5450,7 +5816,7 @@
5450
5816
  "description": "Opaque cursor from a previous response's `meta.nextCursor`. Carries the page size it was issued with, so a follow-up call needs only the cursor. Valid solely for the endpoint, filters, and caller that produced it — change any of them and you get 422; start again without a cursor. Paging reflects the data as of each request, so rows added or removed mid-walk can shift positions."
5451
5817
  },
5452
5818
  "metricTypeIds": {
5453
- "description": "Metric type identifiers to aggregate. Resolve names to ids via /metrics/types.",
5819
+ "description": "Metric type identifiers to aggregate (discover ids via /metrics/types). Entries are returned in this order. Required unless `metricTypeNames` is given; intersected with it when both are given.",
5454
5820
  "example": [
5455
5821
  1,
5456
5822
  7
@@ -5460,6 +5826,13 @@
5460
5826
  "type": "number"
5461
5827
  }
5462
5828
  },
5829
+ "metricTypeNames": {
5830
+ "description": "Metric type names to aggregate — case-insensitive exact match on display name or `shortName` (so \"MRR\" and \"MRR - Monthly Recurring Revenue\" both work). Lets a caller aggregate by name without resolving ids first. Intersected with `metricTypeIds` when both are given. Names that match no accessible metric type are ignored.",
5831
+ "type": "array",
5832
+ "items": {
5833
+ "type": "string"
5834
+ }
5835
+ },
5463
5836
  "aggregation": {
5464
5837
  "type": "string",
5465
5838
  "description": "Aggregation function to apply across companies for each period.",
@@ -5480,7 +5853,7 @@
5480
5853
  }
5481
5854
  },
5482
5855
  "companyNameSearch": {
5483
- "description": "Case-insensitive substring match on company display name. Pass an array to select multiple companies in one call — a company matches if its name contains ANY of the listed substrings (OR semantics). A single string is also accepted and treated as a one-element array. Intersects with `companyIds`/`companyGroupIds`. When the combined company filters select no company at all, the response is an empty list — nothing to aggregate over.",
5856
+ "description": "Case-insensitive substring match on company display name. Pass an array to select multiple companies in one call — a company matches if its name contains ANY of the listed substrings (OR semantics). Intersects with `companyIds`/`companyGroupIds`. When the combined company filters select no company at all, the response is an empty list — nothing to aggregate over.",
5484
5857
  "type": "array",
5485
5858
  "items": {
5486
5859
  "type": "string"
@@ -5529,7 +5902,6 @@
5529
5902
  }
5530
5903
  },
5531
5904
  "required": [
5532
- "metricTypeIds",
5533
5905
  "aggregation"
5534
5906
  ]
5535
5907
  },
@@ -5541,8 +5913,13 @@
5541
5913
  "description": "Period date (ISO 8601, YYYY-MM-DD)."
5542
5914
  },
5543
5915
  "timeframe": {
5544
- "type": "object",
5545
- "description": "Reporting period granularity."
5916
+ "type": "string",
5917
+ "description": "Reporting period granularity.",
5918
+ "enum": [
5919
+ "Month",
5920
+ "Quarter",
5921
+ "Year"
5922
+ ]
5546
5923
  },
5547
5924
  "value": {
5548
5925
  "type": "number",
@@ -6005,8 +6382,13 @@
6005
6382
  "description": "Reporting period end date (ISO 8601, YYYY-MM-DD)."
6006
6383
  },
6007
6384
  "timeframe": {
6008
- "type": "object",
6009
- "description": "Reporting period granularity."
6385
+ "type": "string",
6386
+ "description": "Reporting period granularity.",
6387
+ "enum": [
6388
+ "Month",
6389
+ "Quarter",
6390
+ "Year"
6391
+ ]
6010
6392
  },
6011
6393
  "publishedAt": {
6012
6394
  "type": "string",