Hey guys,
Is there a way to access the list of segments via API? I have tried the GET request for Lists but it only fetches details of lists and not the segments. Is there a specific request to get a list of segments?
The code that I am using for fetching lists:
import requests
url = "https://a.klaviyo.com/api/v2/list/LIST_ID/exclusions/all?api_key=API_KEY"
headers = {"Accept": "application/json"}
response = requests.request("GET", url, headers=headers)
print(response.text)