# Retrieves all site groups with their configuration details

`GET /api/configuration/site-groups`

- **Success:** `200 OK`
- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Retrieves all site groups with their configuration details](https://support.gladstonesoftware.cloud/reference/configuration/retrieves-all-site-groups-with-their-configuration-details)

## Overview

Lists every site group in the environment, each with the sites that belong to it. A **site group** is an operator-defined bundle of sites — typically a region, a brand or a billing collection — used wherever a rule needs to apply to several venues at once, for example a discount that is valid across a group rather than at one venue.

A site can belong to more than one group, and a group can be empty. There is no nesting: groups are a flat list, not a hierarchy, despite what "administrative structure" might suggest.

Groups and their membership are operator-defined and specific to the environment, so treat both the group ids and their contents as data to read at runtime rather than constants. Ids are strings, not numbers, and are stored upper-cased.

**One field is not usable: `sites[].isActive` is always `true`.** The query that builds this response does not load each site's inactive flag, and the mapping treats "not known to be inactive" as active — so every site in every group reports as active regardless of its real state. If you need to know whether a site is trading, read the site itself with [Get site by id](get-site-by-id.md) or [Get all sites with optional filtering](get-all-sites-with-optional-filtering.md).

Every group is returned, active or not — there is no filter and no paging.

## Endpoint

`GET {base_url}/api/configuration/site-groups`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Sample request

```bash title="cURL"
curl -X GET '{base_url}/api/configuration/site-groups' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `[].id` | string | The site group's code, and the value other endpoints expect wherever they take a site group id — for example the discount site group mappings. A string rather than a number, maximum 15 characters, chosen by the operator when the group was created rather than generated. **It is stored and returned upper-cased**, and the write endpoints upper-case whatever you send, so compare case-insensitively and never assume the casing you supplied is preserved. |
| `[].description` | string | The group's human-readable label, maximum 25 characters — short enough that operators tend to abbreviate, so do not rely on it reading well in a customer-facing interface. No uniqueness constraint, so two groups can share a description and only `id` distinguishes them. |
| `[].eftCollection` | boolean | Whether the group is an EFT collection group — a grouping used for Electronic Funds Transfer collection (direct debit) rather than for general site organisation. Derived from a stored indicator that is `true` only when that indicator is exactly `1`; any other value, including null, reports `false`. A group is not required to be one or the other, so both kinds appear in this list together and you should filter by this flag if you only want one. |
| `[].sites` | array of object | The sites belonging to this group. **Always present, and an empty array `[]` for a group with no sites** — never null. Order is not defined. A site appearing in one group does not stop it appearing in others, so the same site id can show up under several groups in a single response. |
| `[].sites[].id` | string | The site's code, matching the `id` used by the site endpoints, so you can join this straight onto [Get site by id](get-site-by-id.md). A string, not a number. |
| `[].sites[].name` | string | The site's name, taken from the site record. Present for display so you do not have to fetch each site just to label it. |
| `[].sites[].isActive` | boolean | **Always `true`, whatever the site's real state.** The query that populates this response omits the site's inactive flag, and the mapping reports active whenever that flag is not explicitly true — so a closed or disabled site still appears as active here. Ignore this field and check the site record instead. |

## Sample response

```json title="200 OK"
[
  {
    "id": "string",
    "description": "string",
    "eftCollection": true,
    "sites": [
      {
        "id": "string",
        "name": "string",
        "isActive": true
      }
    ]
  }
]
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `200` | OK | Success. An environment with no site groups returns `200` with an empty JSON array `[]` — it returns `200` rather than `204` for an empty result. |
| `500` | Internal server error | Any unexpected server-side failure while reading the list, such as an outage. The response has no body. There is no request input to correct, so retry rather than adjust the call. |
