Admin Portal

Lookup Location

Resolve a GHL location id to its owning agency.

Admin utility: "someone gave me a location id, which agency does it belong to?". Tries four sources so the fast paths satisfy most lookups without paying a GHL round-trip:

  1. installations.sub_account_id match
  2. installations.settings->>location_id match (legacy rows)
  3. agency_inventory.ghl_location_id match (bulk sweep cache)
  4. Async parallel GHL /oauth/installedLocations scan across every agency install (no cap), with early exit on first match and a hard wall-clock budget so the endpoint stays responsive

Whenever the lookup finds an agency whose name is still a synthetic placeholder (raw company id, "Unknown agency", etc.), the response triggers :func:_resolve_agency_name_from_ghl against the agency install row so the admin page picks up a real name on the next refresh — locating by id therefore doubles as a per-row name backfill.

When the scan resolves a location that was not yet in Supabase, the discovery is written back into agency_inventory (including the location name from the GHL entry) so the next lookup for the same location is served instantly by the fast path.

get/api/admin-portal/lookup/location

Request

  • Base URL: https://api.sympana.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.sympana.ai/api/admin-portal/lookup/location
  • Auth: none declared

Query parameters

location_idstring required

Headers

Authorizationstring nullable

Response

Successful Response

object required

Changes

No recorded changes to this operation across all 1 revision of this API.