> ## 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.

# Aggregation

Aggregation webhooks notify you when any new data is available after a successful aggregation. The webhook will include a count of new transactions and updated transactions.

These webhooks fire only after a completed aggregation, *including background aggregations*. Actions performed on the `member` through other endpoints will not trigger the webhook.

| Field                        | Data type | Description                                                                                                                                                                  |
| :--------------------------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `action`                     | String    | The action that triggered the webhook, e.g., `member_data_updated`.                                                                                                          |
| `completed_at`               | Integer   | The date and time at which the process that triggered the webhook was finished. Given in Unix time.                                                                          |
| `completed_on`               | String    | The date on which the process that triggered the webhook was finished.                                                                                                       |
| `is_background`              | Boolean   | This indicates whether the aggregation was performed manually in the foreground or automatically in the background.                                                          |
| `job_guid`                   | String    | The unique identifier for MX's internal aggregation process. Defined by MX.<br /><br />This field is not relevant for partners using the Platform API and should be ignored. |
| `member_guid`                | String    | The unique identifier for the member which has new or updated transaction data. Defined by MX.                                                                               |
| `transactions_created_count` | Integer   | The number of newly created transactions.                                                                                                                                    |
| `transactions_updated_count` | Integer   | The number of newly updated transactions.                                                                                                                                    |
| `type`                       | String    | The type of webhook being delivered. Current possible values are `AGGREGATION`, `BALANCE`, `HISTORY`, and `STATEMENT`; however, additional values may be added at any time.  |
| `user_guid`                  | String    | The unique identifier for the user with which the data is associated. Defined by MX.                                                                                         |
| `user_id`                    | String    | The unique partner-defined identifier for the user associated with the aggregation.                                                                                          |

**Example Payload**

```json JSON theme={null}
{
  "action": "member_data_updated",
  "completed_at": 1531947410,
  "completed_on": "2018-07-18",
  "is_background": true,
  "job_guid": "JOB-823ab268-5107-4a67-97c8-60292572ac2e",
  "member_guid": "MBR-48d9a481-f2a2-7e13-2685-62869cf0d33a",
  "transactions_created_count": 3,
  "transactions_updated_count": 2,
  "type": "AGGREGATION",
  "user_guid": "USR-eaf4ac68-d17d-5e9b-7b46-959a5b315a9e",
  "user_id": "partner-defined-id"
}
```

## Analytics Events

| Field                            | Data Type | Definition                                                                                                                |
| :------------------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------ |
| `action`                         | String    | A description of the type of action that was taken by the user.                                                           |
| `app_name`                       | String    | The name of the user's application.                                                                                       |
| `app_version`                    | String    | The version of the user's application.                                                                                    |
| `category`                       | String    | A description of the feature the user interacted with.                                                                    |
| `client_id`                      | String    | The unique partner-defined identifier for the client.                                                                     |
| `created_at`                     | Integer   | The date and time at which the event occurred.                                                                            |
| `data_source`                    | String    | Where the event originated from: web for a web application or app for a mobile application.                               |
| `duration`                       | Integer   | Duration of the event in milliseconds.                                                                                    |
| `host`                           | String    | The host name of the server.                                                                                              |
| `interval`                       | Integer   | Length of time of a timed event in milliseconds.                                                                          |
| `name`                           | String    | The name of the page in the case of a pageview, or in the case of an analytics\_event, a description of the action taken. |
| `path`                           | String    | The relative URL path of the event.                                                                                       |
| `screen_resolution`              | String    | The resolution of screen size in pixels, for example, 1200x1600.                                                          |
| `session_id`                     | String    | The unique identifier of the session.                                                                                     |
| `type`                           | String    | The type of analytics event. One of four values: "analyticsevent", "pageview", "screenview", and "timedevent".            |
| `user_agent_string` (deprecated) | String    | Text identifying the user's browser and operating system. Deprecated in favor of `user_agent`.                            |
| `user_agent`                     | String    | Text identifying the user's browser and operating system.                                                                 |
| `user_guid`                      | String    | The unique identifier for the member. Defined by MX.                                                                      |
| `user_id`                        | String    | The unique partner-defined identifier for the user.                                                                       |
| `user_ip_address`                | String    | The IP address of the user.                                                                                               |
| `value`                          | String    | The value used by the user, if applicable.                                                                                |
| client\_guid                     | String    | The unique identifier of the client. Defined by MX.                                                                       |

**Example Payload**

```json JSON theme={null}
{
  "_json": [
    {
      "action": "click",
      "app_name": nil,
      "app_version": "widgets-v2",
      "category": "MX - Connect Credentials",
      "client_id": "C-1234",
      "client_guid": "CLT-71f54gf5-2f89-bbc6-de7d-a31ef8c6abd6",
      "created_at": 1523397481,
      "data_source": "web",
      "duration": 0,
      "host": nil,
      "interval": nil,
      "name": "Submit Credentials",
      "path": nil,
      "screen_resolution": nil,
      "session_id": "ANS-66ea8d88-0606-9e61-1036-399f6cf301c3",
      "type": "analyticsevent",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36",
      "user_agent_string": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36",
      "user_id": "U-1234",
      "user_guid": "USR-4758d481-3e0a-aefd-5f09-03aaam347317a",
      "user_ip_address": "127.0.0.1",
      "value": null
    }
  ]
}
```
