[ MSP, APIs & integrations ]

Pagination, filtering and time windows in report exports

Export every intended report once by defining timestamp semantics, continuation rules and independently checkable boundaries.

By the EmailAuth research team · 3 min read

[ Key points ]

  • Export every intended report once by defining timestamp semantics, continuation rules and independently checkable boundaries.
  • Compare report identities as well as totals, preserve the selected timestamp field and follow the actual continuation contract.
On this page

Report exports become unreliable when a time filter, page boundary and late arrival are treated as unrelated details. A result that looks complete may omit records sharing a timestamp or count the same report twice. Write down the selection rules before building the export loop.

Choose the time being filtered

Aggregate reports have an evaluation period; the collector also has a receipt time. RFC 9990 defines the aggregate-report structure, including its date range. An export filtered by receipt time answers what arrived during the window, not necessarily what messages were evaluated during it. Name the chosen field and preserve both meanings when available.

Use UTC timestamps with an explicit boundary convention. The hypothetical receipt-time example below uses a half-open window: include start, exclude end. Adjacent daily exports then do not overlap solely because they share midnight. For a provider with different documented semantics, translate deliberately and deduplicate rather than pretending its end boundary is exclusive.

Follow the service's continuation mechanism

Do not guess that every endpoint uses page numbers or that a short page always ends the result. GitHub's pagination documentation demonstrates following Link headers where supplied. Other services use opaque cursors. Follow the actual contract, retain the active filter and stop only under its defined completion condition.

Ask whether pagination observes a stable snapshot. If new arrivals can change page membership, offset paging may skip or repeat records. Use stable ordering and snapshot-bound cursors where supported. For a proposed design, a stable receipt-time plus identity order and snapshot/filter-bound cursor can make continuation auditable. Use the provider’s full identity key as the tie-breaker; a report ID alone need not be unique across reporters. These are design recommendations, not verified vendor guarantees.

Test boundaries with known inputs

Assume a fixed snapshot for one reporter and tenant, filtered by receipt time for a UTC day. Report 0 arrived one second before the day and has 10 observations. Reports 1 and 2 arrived at noon and have 30 and 20 observations; report 3 arrived at 18:00 and has 50. Report 4 arrived exactly at the next midnight and has 50. Under an include-start/exclude-end rule, select IDs 1, 2 and 3: 30 + 20 + 50 = 100 observations. With the assumed page size of two and stable identity tie-breaker, those selected records occupy pages of two and one.

These are invented input facts and expected arithmetic, not an export or executed pagination test. Verify both identities and totals: substituting out-of-window report 4 for report 3 would preserve 100 but select the wrong set. This example filters whole report receipt times; it does not infer individual message timestamps from an aggregate report interval. A collection cut-off or historical-period query needs its own documented rules.

Preserve evidence of completeness

Store the original filter, version, continuation sequence, row count, distinct identities and final status with the exported data. If a page fails, label the export incomplete and resume or restart under the provider's supported mechanism. Never show a partial result as a complete monthly metric.

Review empty windows, changed filters, repeated cursors and cursor expiry. An expired cursor may require a fresh snapshot and reconciliation rather than continuing from a guessed page. For historical evaluation-period reports, allow a collection cut-off and explain late corrections. The reader should be able to tell both which observations were included and which expected sources were absent.

[ Takeaway ]

Compare report identities as well as totals, preserve the selected timestamp field and follow the actual continuation contract.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Test the exact edges

Boundary fixtures make lost rows visible.

Next steps

  1. Include same-time records.
  2. Record continuation state.
  3. Compare expected IDs.

CISO / SecOps

Retain audit context

A bare CSV conceals selection and access decisions.

Next steps

  1. Keep export metadata.
  2. Review scope controls.
  3. Track incomplete jobs.

Founder / Non-technical

Demand explainable totals

A metric is only as useful as its selection rules.

Next steps

  1. Approve the reporting window.
  2. Ask about late corrections.
  3. Reject unlabeled partial results.

[ FAQs ]

Frequently asked questions

Which timestamp should a daily export use?

Choose receipt time or evaluation-period semantics explicitly according to the reader task.

What is a half-open window?

It includes its start and excludes its end.

Why test equal timestamps?

A timestamp-only cursor can skip distinct records that share the same time.

Does a short page always mean completion?

Only if the actual API contract says so.

What are the hypothetical selected IDs?

IDs 1, 2 and 3: 30 + 20 + 50 = 100 observations, across assumed pages of two and one. No pagination test was executed.

Why compare identities and totals?

Opposite errors can cancel numerically while the dataset is still wrong.

What if a cursor expires?

Use the documented restart or resume process and reconcile identities.

Can a partial export support a final report?

Only if it is clearly labelled partial; it must not be presented as complete coverage.

[ Sources ]

Sources

  1. RFC 9990 DMARC Aggregate Reporting

    Sections §3.1 · §3.1.1.4 · §3.1.2 · §3.5.1 · §3.5.4 · §4 · §7 · §8

  2. GitHub REST API pagination

    Sections Using link headers · Changing the number of items per page

[ Glossary ]

Glossary

Half-open window
A time interval including its start and excluding its end.
Stable snapshot
A defined dataset whose membership remains fixed while it is paginated.

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base