INNER CODE UNIT · Python
list_render_environment_groups
phasehq/console · backend/api/utils/syncing/render/main.py:83
def list_render_environment_groups(credential_id):
"""
List all Render Environment Groups available under the account associated with the API key.
Handles pagination using the 'cursor' field.
API DOCS: https://api-docs.render.com/reference/get-environment-groups
"""
url = f"{RENDER_API_BASE_URL}/env-groups"
headers = get_render_headers(credential_id)
params = {"limit": 100}
all_envgroups = []
cursor = None
while True:
if cursor:
params["cursor"] = cursor
else:
params.pop("cursor", None)
response = requests.get(url, headers=headers, params=params)