I’m having an issue with the Get Segment Profiles API endpoint.
I’m getting the following error: "'equals' is not an allowed filter operator for email." however it says in the API docs that it is allowed?
I should also note that I use this exact setup for the ‘https://a.klaviyo.com/api/profiles/’ endpoint where the filter works fine.
How would i go about appending a filter where the request only returns a profile with a specific email if I can’t use the “equals” filter on emails?
const options = {
method: 'GET',
headers: {
accept: 'application/json',
revision: '2023-02-22',
Authorization: `Klaviyo-API-Key ${process.env.KLAVIYO_PRIVATE_KEY}`
}
};
const params = new URLSearchParams({
'filter': `equals(email,"KNOWN_EMAIL_ADDRESS")`
});
const segmentID = 'SEGMENT_ID';
const segmentURL = `https://a.klaviyo.com/api/segments/${segmentID}/profiles/?${params}`
const { data: klaviyoSegment } = await fetch(segmentURL, options)
.then(res => res.json())
.catch(error => console.error(error))