# Get aggregated area changelog

`GET /api/district/{district}/area/{division}/{area}/changelog`

Groups normalized club changelog events by metric across the selected period. Each metric contains its total numeric delta and affected clubs with names, club totals, and dated source changes. Lifecycle groups are included and use null numeric totals.

**Path parameters**

- `district` (string, required)
- `division` (string, required)
- `area` (string, required)

**Query parameters**

- `fiscalYear` (string, optional): Toastmasters fiscal year. Defaults to the current fiscal year.
- `fiscalMonth` (integer, optional)
- `date` (date, optional)
- `startDate` (date, optional)
- `endDate` (date, optional)
- `category` (enum, optional) One of: `lifecycle`, `membership`, `education`, `status`, `renewals`.
- `metric` (string, optional)
- `limit` (integer, optional, default 1000): Maximum number of records to return
- `offset` (integer, optional, default 0): Number of records to skip
- `sortOrder` (enum, optional, default desc) One of: `asc`, `desc`.
- `view` (enum, optional): day: the daily timeline. Each group is one metric on one day, payment totals that a more specific change explains are left out, each group has member_removal (the October/April removal of unpaid members, or null), and pages count day groups. One of: `day`.

**Returns**

- `success` (boolean)
- `area` (object)
  - `district` (string)
  - `division` (string)
  - `area` (string)
- `data` (array of objects)
  - `category` (enum) One of: `lifecycle`, `membership`, `education`, `status`, `renewals`.
  - `metric` (string)
  - `event_count` (integer)
  - `clubs_affected` (integer)
  - `total_delta` (nullable number): Sum of numeric deltas across the selected area and period; null when the metric is non-numeric.
  - `first_comparison_date` (date)
  - `last_comparison_date` (date)
  - `clubs` (array of objects)
    - `club_number` (string)
    - `club_name` (nullable string)
    - `division` (nullable string)
    - `area` (nullable string)
    - `event_count` (integer)
    - `total_delta` (nullable number): Sum of numeric event deltas for this club; null for non-numeric metrics such as lifecycle events.
    - `first_comparison_date` (date)
    - `last_comparison_date` (date)
    - `changes` (array of objects)
      - `comparison_date` (date)
      - `previous_date` (date)
      - `change_type` (enum) One of: `increased`, `decreased`, `changed`, `club_added`, `club_removed`.
      - `old_value` (nullable string)
      - `new_value` (nullable string)
      - `old_value_numeric` (nullable number)
      - `new_value_numeric` (nullable number)
      - `delta_numeric` (nullable number)
  - `member_removal` (nullable object): view=day only: members removed for unpaid dues, when this is an October or April active-member drop; otherwise null.
    - `period` (enum) One of: `October`, `April`.
    - `removed` (integer): Members removed (the drop in active members).
    - `clubs` (integer): Clubs whose active members fell.
- `pagination` (object): Pagination returned by member-payments endpoints. total is the total matching records.
  - `total` (integer): Total matching records
  - `limit` (integer): Number of records per page
  - `offset` (integer): Number of records to skip
  - `has_more` (boolean): Whether there are more records available
- `filters` (object)
- `timestamp` (timestamp)

**Errors**

- `422`: Invalid area changelog query
- `500`: Internal server error

**Example request**

```bash
curl "https://tm-api.devinpearson.me/api/district/74/area/A/01/changelog"
```

**Example response**

```json
{
  "success": true,
  "area": {
    "district": "74",
    "division": "A",
    "area": "01"
  },
  "data": [
    {
      "category": "lifecycle",
      "metric": "string",
      "event_count": 1,
      "clubs_affected": 1,
      "total_delta": 0,
      "first_comparison_date": "2026-11-19",
      "last_comparison_date": "2026-11-19",
      "clubs": [
        {
          "club_number": "113",
          "club_name": "Example Toastmasters Club",
          "division": "A",
          "area": "01",
          "event_count": 1,
          "total_delta": 0,
          "first_comparison_date": "2026-11-19",
          "last_comparison_date": "2026-11-19",
          "changes": [
            {}
          ]
        }
      ],
      "member_removal": {
        "period": "October",
        "removed": 0,
        "clubs": 0
      }
    }
  ],
  "pagination": {
    "total": 0,
    "limit": 0,
    "offset": 0,
    "has_more": true
  },
  "filters": {},
  "timestamp": "2026-11-19T04:30:00.000Z"
}
```
