Email history extraction

Import receipts and invoices that already live in your connected mailbox, not just new incoming mail.

ST
Written by SparkReceipt TeamUpdated Aug 24, 2026

Email history extraction (also called History Import inside the app) scans past emails in a connected mailbox for receipts and invoices. Unlike ongoing automatic email scanning, which only processes mail arriving from now on, history extraction walks backwards through messages you've already received and pulls the receipts into SparkReceipt.

Use it once after connecting a mailbox to get your books caught up, or again later with a different date range if you missed something.

How it differs from automatic scanning

  • Automatic email scanning runs continuously in the background and only sees emails that arrive after you connect the mailbox. No credits, no date picker, no progress bar.
  • History extraction is a one-off, on-demand sweep of a specific date range in the past. You pick the range, SparkReceipt counts the matching emails, shows you the cost up front, and processes them in batches.

Both share the same classification pipeline, the same approval queue, and the same sender rules — the only difference is which messages are pulled in and how that pull is metered.

History extraction is available only for OAuth or IMAP-connected mailboxes (Gmail, Microsoft, or IMAP). It is not available for the manual forwarding address, because that workflow doesn't have a mailbox to read from.

How to trigger it

Web app

  1. Connect a mailbox first — see Automatic email scanning if you haven't yet.
  2. Go to Settings → Scan receipts from email and click Settings on the mailbox row under the Automatic email scanning table.
  3. In the source settings, find the History Import section and click Manage history extraction.
  4. On the History Extraction page, in the Start New Extraction card:
    • Choose a start date under Emails from.
    • Optionally pick an end date under Until (leave empty to use "Now").
    • Click Prepare task. SparkReceipt counts matching emails and shows the cost breakdown.
    • Click Start extraction to queue the job.

Flutter app

  1. Open the main menu and tap Scan from email.
  2. Tap the connected mailbox in the Automatic inbox scanning card.
  3. Scroll to the History Import section and tap Manage.
  4. On the History Extraction screen, pick a date range, tap Prepare task, then Start extraction.

How far back it reaches

The Emails from date defaults to 90 days ago, but that's just a starting point, not a cap. You can change the start date to any date in the past — for example, 1 January 2025 — and the scan will cover the whole range you pick. Leave the Until date empty to scan right up to now. SparkReceipt counts the matching emails across the exact range you choose and shows the cost before you commit, so a longer reach just means a bigger (and clearly priced) batch.

There is no minimum either; you can also run history extraction on a short range (for example, the last week) if you connected a mailbox after something important arrived.

Progress, status, and coverage

While a task is running, the page polls every few seconds and updates live. You'll see:

  • A status badge — Starting, In progress, Paused, Completed, Failed, or Cancelled.
  • A progress bar showing percentage complete.
  • Running counts for Scanned, Receipts found, and Duplicates.

Below the config card, an Extraction Coverage timeline shows which date ranges you've already extracted, so it's easy to see gaps. An Extraction Tasks table lists every past task with its date range, scanned/found counts, credits consumed, and actions (Cancel, Continue, Restart).

Completed tasks can include a Review pending link if any receipts are awaiting approval, and a Review blocked link for emails your sender rules blocked (you can recover any of those manually).

Duplicate handling

History extraction uses the same deduplication as the rest of SparkReceipt:

  • Within the same mailbox, an email already imported by automatic scanning won't be imported a second time.
  • Across your different mailboxes and forwarded emails, SparkReceipt compares content digests — the same receipt that arrived via two accounts or was also forwarded manually is only turned into a document once.

Duplicates are counted in the Duplicates column and kept for audit, but they do not create extra documents and do not need your approval.

Cost and credits

History extraction is the only part of email scanning that consumes credits, because it potentially scans thousands of old messages.

Each eligible workspace gets a one-off lifetime allowance of free history emails — by default 10,000 emails that can be processed without touching credits. Once that allowance is used up, additional emails are billed at a fractional per-email rate (by default, 0.3 credits per email) out of your monthly renewable credits or any extra credits you've purchased.

On the Start New Extraction card, before you click Start extraction, SparkReceipt shows exactly how the batch will be paid for:

  • Included quota: X of Y remaining
  • This batch: N from included quota, or N from included quota + M credits, or M credits
  • After extraction: ... so you can see the remaining balance.

If the batch would require more credits than you have, the card shows Requires X credits (only Y available) and a Purchase credits button instead of Start extraction.

Why does history extraction cost credits?

A backlog import isn't just a mailbox listing. Every candidate message has to be opened, read, and run through the same AI pipeline that processes a single forwarded receipt: deciding whether the email actually contains a receipt or invoice, extracting line items, classifying the merchant, and assigning a category. Doing that across thousands — sometimes tens of thousands — of historical messages takes real compute, and the credit cost reflects that.

For context: with a 1,000-credit pack at $12 and the default rate of 0.3 credits per email, processing history works out to roughly $3.60 per 1,000 emails once your free 10,000-email allowance is exhausted.

If the task pauses

If the free allowance and your credit balance both run out mid-task, SparkReceipt automatically pauses the job rather than failing it. The status switches to Paused with the note:

Import paused — free emails and credits used up. Add credits to continue.

Top up credits and click Continue on the task to resume from where it stopped. You can also Cancel a paused task; the emails already pulled in are kept.

Feature availability

History extraction is controlled by a global feature flag. If the feature is disabled for your workspace or not included in your plan, the History Import section on a source's settings page shows Coming soon and the button to open the extraction screen is hidden.