Company Financials Endpoint — Structured Response (Experimental)
GET/companies/{id}/financials/ now returns a structured document instead of a flat, paginated list of statement rows. The response is a company envelope containing periods, each grouping that fiscal period's Income Statement, Balance Sheet, and Cash Flow statements, each holding its line_items. This endpoint is experimental — its response schema may change without an API version bump.
- Per-period grouping: All statements for a fiscal period are returned together under one periods[] entry, removing the need to regroup statement rows client-side.
- Point-in-time queries: A new as_of=YYYY-MM-DD parameter returns the financials as they were known on that date — only filings published on or before as_of are considered when selecting each period's statement.
- Extraction provenance: Each statement now carries an extraction object (model, prompt version, timestamp); each line item now carries confidence and source_page.
- Stricter validation: Invalid statement_type / fiscal_period values, non-integer fiscal years, and unrecognized line_items KPI codes now return 400 with a clear message instead of being silently ignored.
- Source visibility: Per-filing source provenance (source_filing, sources) is included only for accounts with source unmasking enabled, consistent with source masking elsewhere in the API. The response carries a sources_masked flag indicating which applies.
- No pagination: A company's financials are a bounded dataset and are now returned as a single document.
- Performance: Responses are served from a per-company cache that refreshes automatically when new financial data is extracted.