Re-import historical activity
reimport_historicalQueues a historical import for the org over a chosen window: the worker lists the connected account's activity (Stripe charges/refunds/payouts, or Mercury transactions across all accounts) and feeds it through the same pipeline as live webhooks. Safe to call any time — it is idempotent: events already present (from live webhooks or an earlier import) are skipped, never duplicated, so the P&L and ledger are never double-counted. After import, a reconciliation sweep drains fully-settled Stripe payouts out of clearing once their matching Mercury deposit has imported. If the chosen window overlaps an already-completed import, the call returns an overlap_warning and does NOT queue unless confirm_overlap is true (the dedup guard still prevents any double-booking; this is a "did you mean to re-scan?" prompt). Returns the run state; poll get_financial_summary to watch progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org_id | No | Optional. Defaults to the organisation the authenticated API key is bound to, so you normally omit it and never need to ask the user for their organisation UUID. If provided, it must match the key’s org or the request is rejected. | 0e91146d-511c-469f-bdee-5c867b26ae0d |
| window | No | How far back to import: 'last_90_days' (default), 'last_12_months', 'this_year', or 'all_available'. | last_90_days |
| provider | No | Which connected provider to import. Defaults to Stripe. | stripe |
| confirm_overlap | No | Set true to proceed even when the window overlaps an already-completed import (skips the overlap warning). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| since | Yes | ||
| queued | Yes | ||
| status | Yes | ||
| provider | Yes | ||
| overlap_warning | Yes | ||
| not_queued_reason | Yes |