> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Background and Foreground Aggregation

> You cannot run a new aggregation within three hours of a successful aggregation, whether foreground or background.

We suggest that, if needed, you spread traffic to the API every three hours based on the user instead of running your entire platform. Pay attention to the `aggregated_at` and `successfully_aggregated_at` member fields while you're developing your product with the API.

## Background Aggregation

MX automatically aggregates each `member` approximately every 24 hours through **background aggregation**, keeping end user data current. If `successfully_aggregated_at` shows activity within the last 24 hours, you can skip foreground aggregation and proceed directly to reading account and transaction data.

Background aggregation can be disabled globally (contact MX to configure) or per-member by setting `background_aggregation_is_disabled` to `true` when creating or updating a member. For Connect Widget users, use the `disable_background_agg` configuration option.

Background aggregation is disabled by default for members created in verification mode. Override this by setting `disable_background_agg` to `false` (affects new members only).

Background aggregation requires:

* The data source must support background aggregation (most do)
* The `member` must not have been aggregated in the last 20 hours
* The `member` must have a `connection_status` of `CONNECTED`, `UPDATED`, or `CREATED`

## Foreground Aggregation

Manually trigger foreground aggregation when end users are present. End users **must** be available to respond to MFA challenges, credential updates, terms agreements, or other prompts.

<Warning>
  You cannot run a new aggregation within three hours of a successful aggregation (foreground or background). Monitor `aggregated_at` and `successfully_aggregated_at` fields.
</Warning>

<Info>
  Disabled `user` objects prevent all aggregation—re-enable before attempting. MX may suspend background aggregation after consecutive failures, but foreground aggregation remains available on suspended `member` objects.
</Info>
