# Region

A region is a group of districts, supported by a Region Advisor. It is identified by its number.

The region endpoint reports each district in the region with its payments, club counts and recognition figures.

Base URL: `https://tm-api.devinpearson.me`

## Get region data

`GET /api/region/{region}`

Retrieve data for a region by region identifier

**Path parameters**

- `region` (string, required): Region identifier

**Query parameters**

- `fiscalYear` (string, optional): Fiscal year (YYYY-YYYY); defaults to the current fiscal year
- `fiscalMonth` (integer, optional): Fiscal month (1 = July); defaults to each district's latest month
- `latest` (enum, optional, default true): false returns every monthly row instead of each district's latest month. true also skips the cached response. One of: `true`, `false`.

**Returns**

- `data` (object)
  - `districts` (array of objects)
    - `average_members_per_club` (number): Average normalized active membership across all club rows in the district snapshot
    - `average_new_members_per_club` (number): Average normalized new_members plus add_new_members across all club rows in the district snapshot
    - `potential_distinguished_clubs` (integer): Non-suspended clubs in the district snapshot with 20+ active members whose goals_met meets the monthly DCP target for the snapshot's fiscal month (Jul–Sep 1, Oct–Nov 2, Dec–Jan 3, Feb–Mar 4, Apr–Jun 5). Includes clubs that are already Distinguished.

**Errors**

- `422`: A path or query parameter has an invalid value
- `500`: Internal server error

**Example request**

```bash
curl "https://tm-api.devinpearson.me/api/region/11"
```

**Example response**

```json
{
  "data": {
    "districts": [
      {
        "average_members_per_club": 0,
        "average_new_members_per_club": 0,
        "potential_distinguished_clubs": 0
      }
    ]
  }
}
```
