HTTP API reference
Extraction, invoices, aggregates, BI, and insights accept Authorization: Bearer with a bf_live_ API key or session JWT. Create and revoke bf_live_ keys only from the signed-in dashboard (not documented here). Billing and subscription webhooks are handled in the product UI, not in this catalog.
How the pieces connect
Arrows show a typical path; each box links to a topic page with every method and path listed.
Complete endpoint index
| Method | Path | Topic | Summary | Details |
|---|---|---|---|---|
| POST | /api/extract-invoice | Extraction | Extract from a public URL (http or https); JSON body with file_url. | View |
| POST | /api/extract-invoice-file | Extraction | Multipart upload: file + optional invoice_kind. | View |
| GET | /api/invoices | Invoices & chart data | Paginated list of stored invoices for the authenticated user. | View |
| GET | /api/invoices/[id] | Invoices & chart data | Fetch one invoice by id (path param). | View |
| PATCH | /api/invoices/[id] | Invoices & chart data | Update invoice_kind and/or parsed_data fields. | View |
| DELETE | /api/invoices/[id] | Invoices & chart data | Delete a stored invoice. | View |
| GET | /api/invoices/aggregates | Invoices & chart data | Monthly revenue/expense series or top counterparties (groupBy=month|counterparty). Respects reporting currency like GET /api/bi/summary; response includes `caveats`. | View |
| GET | /api/bi/summary | Business metrics (BI) | Period totals: revenue, expenses, profit, margin. When `profiles.reporting_currency` is set, amounts are converted with published daily reference rates; `caveats` lists `reportingCurrency`, `fxAsOf`, `excludedMissingCurrency`, and optional `fxError`. | View |
| GET | /api/bi/trends | Business metrics (BI) | Month buckets with revenue, expenses, optional profit when single-currency. | View |
| GET | /api/bi/distribution | Business metrics (BI) | Top clients (revenue) and top vendors (expenses) for a date range. | View |
| GET | /api/insights | Insights | Executive-style payload: data quality, insights, actions, summary text inputs. | View |
| GET | /api/actions | Insights | Same JSON as GET /api/insights (including optional narrative=1). Prefer /api/insights; kept for backwards compatibility. | View |