Teams API (Settings, User Provisioning) should show child team ids
/settings/v3/users/teams
Or parent team ids, or both. Since there can be a hierarchy to HubSpot teams, that must be one of the properties on a team so it's kind of strange that the API doesn't return it already.