---
title: "List TGFL-anchored location associations for a facility"
method: GET
path: "/facilities/{id}/relationships/locations"
tags: ["Facility"]
---

# List TGFL-anchored location associations for a facility

`GET /facilities/{id}/relationships/locations`

Returns a paginated list of all tenant_group_facility_locations (TGFL) associations for the given facility. Each item in data[] contains the TGFL anchor row plus flat sibling entities: tenantGroupFacility, tenantFacility, tenantGroup, tenantGroupLocation, groupLocation, locationEntityAddresses, and tenantGroupLocationFacilityNetworks (TGLFN). All entity foreign-key references are wrapped as objects ({id, data}) to allow future schema evolution without breaking consumers. certifyGroupId: restrict to TGFLs whose group resolves to this certify group id. networkId: restrict to TGFLs that have a matching TGLFN row for this network id (EXISTS semantics — TGFL rows are never duplicated); the TGLFN array on each item is also filtered to the requested network when set. locationSearch: restrict to TGFLs whose resolved location name contains this text (case-insensitive substring match). Blank/omitted = no filter. Note: operationId retains the legacy plural form for OpenAPI stability; the Java method is getFacilityLocationRelationships.

## Path parameters

- `id` string, required

## Query parameters

- `certifyGroupId` string
- `locationSearch` string
- `networkId` string
- `page` integer
- `size` integer

## Headers

- `tenant-id` string, required

## Response `200`

Paginated TGFL location associations successfully retrieved.

- FacilityLocationsPagedResponse — Paginated list of TGFL-anchored facility location associations.
  - `data` FacilityLocationRelationship[], required — Items on the current page.
    - `tenantGroupFacilityLocation` FacilityEntityRef, required — Reference to a related entity with its unique id and OV data blob.
      - `id` string, required — Unique identifier of the related entity.
      - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
    - `tenantGroupFacility` FacilityEntityRef — Reference to a related entity with its unique id and OV data blob.
      - `id` string, required — Unique identifier of the related entity.
      - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
    - `tenantFacility` FacilityEntityRef — Reference to a related entity with its unique id and OV data blob.
      - `id` string, required — Unique identifier of the related entity.
      - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
    - `tenantGroup` FacilityTenantGroupRef — Tenant group record paired with the referenced group (core_groups_ov) display entity.
      - `id` string, required — Unique identifier of the tenant_groups row.
      - `data` object — Tenant group operational-value data blob (e.g. groupId, email, website).
      - `group` FacilityEntityRef — Reference to a related entity with its unique id and OV data blob.
        - `id` string, required — Unique identifier of the related entity.
        - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
    - `tenantGroupLocation` FacilityEntityRef — Reference to a related entity with its unique id and OV data blob.
      - `id` string, required — Unique identifier of the related entity.
      - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
    - `groupLocation` FacilityGroupLocationRef — Group location record paired with the referenced location (core_locations_ov) display entity.
      - `id` string, required — Unique identifier of the group_locations row.
      - `data` object — Group location operational-value data blob (e.g. locationId, groupId).
      - `location` FacilityEntityRef — Reference to a related entity with its unique id and OV data blob.
        - `id` string, required — Unique identifier of the related entity.
        - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
    - `locationEntityAddresses` FacilityLocationEntityAddressRef[] — Address rows for this location (location_entity_addresses). Includes service and office addresses. Each entry's own data blob carries addressType/isPrimary; the nested entityAddress ref carries the hydrated address fields (addressLine1/2, city, state, zip, county, country); entityAddress is null until DAL enrichment populates that join.
      - `id` string, required — Unique identifier of the location_entity_addresses row.
      - `data` object — Bridge row operational-value data blob (e.g. addressType, isPrimary).
      - `entityAddress` FacilityEntityRef — Reference to a related entity with its unique id and OV data blob.
        - `id` string, required — Unique identifier of the related entity.
        - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
    - `tenantGroupLocationFacilityNetworks` FacilityNetworkParticipationRef[] — Network-participation rows at this group-location (tenant_group_location_facility_networks, TGLFN). Each entry pairs a TGLFN record with its referenced network entity. When the networkId filter is active on the request, only the matching TGLFN entry is included here.
      - `id` string, required — Unique identifier of the TGLFN row.
      - `data` object — TGLFN operational-value data blob (e.g. effectiveDate, terminationDate, status).
      - `network` FacilityEntityRef — Reference to a related entity with its unique id and OV data blob.
        - `id` string, required — Unique identifier of the related entity.
        - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
    - `tenantGroupLocationNetworks` FacilityNetworkParticipationRef[] — Network-participation rows at this group-location, sourced from tenant_group_location_networks (TGLN) — the legacy group-location-scoped network table also read by GET /facilities/{id}/relationships/all. Serves as a fallback source for facilities that predate tenant_group_location_facility_networks (TGLFN, CP-29886) and therefore have no TGLFN rows yet. When the networkId filter is active on the request, only the matching TGLN entry is included here.
      - `id` string, required — Unique identifier of the TGLFN row.
      - `data` object — TGLFN operational-value data blob (e.g. effectiveDate, terminationDate, status).
      - `network` FacilityEntityRef — Reference to a related entity with its unique id and OV data blob.
        - `id` string, required — Unique identifier of the related entity.
        - `data` object — Operational-value data blob (schema-on-read; keys vary by entity type).
  - `links` PageLinks — HATEOAS-style pagination links.
    - `self` string — Link to the current page.
    - `next` string — Link to the next page; null on the last page.
    - `prev` string — Link to the previous page; null on the first page.
  - `totalCount` integer — Total number of matching TGFL records (across all pages).

## Other responses

- `401` — Unauthorized - Authentication required
- `403` — Forbidden - Insufficient permissions
- `404` — Facility OV not found for the given certify facility id.
- `500` — Internal server error

---

[API](https://skmtc.net/certifyos/apis/certify-api-layer.md) · [All operations](https://skmtc.net/certifyos/apis/certify-api-layer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/certifyos/certify-api-layer/revisions/563848e0ecc0/schema)
