I need to add over 200 users to my Klaviyo newsletter list using the API. While I know the manual process of uploading a CSV file, I want to automate this weekly task via the API. The endpoint I plan to use is:
https://a.klaviyo.com/api/lists/{List ID}/relationships/profiles/
However, it requires a user profile ID, which I don't have. I can retrieve the profile ID using the following endpoint:
https://a.klaviyo.com/api/profiles?filter=equals(email,"abc@gmail.com")
But, given the large number of users, I want to avoid making individual API calls for each email to fetch the profile ID.
MUST be checked against unsubscribe list in Klaviyo before added. When contacts are added to a list, they are subscribed even if they have previously unsubscribed. This is a critical step to comply with spam rules.