Solved

Is there a way to search for a profile by their email using the API ?

  • 1 October 2021
  • 8 replies
  • 115 views

Badge

Hi,

 

I’m using the API to search for profiles using their email but it appears to be not available.

Why is that ? It doesn’t make sense that we don’t have CRUD operations on profiles….
 

 

icon

Best answer by shtlrs 4 October 2021, 17:31

View original

8 replies

Userlevel 6
Badge +5

Hello @shtlrs,

Thanks for sharing your question with the Klaviyo Community!

To search for a profile via a user’s email address through API, you’ll first need to make a GET request for the List and Segment Members endpoint. This in turn will return a list of profile objects such as the profile’s ID, email address, phone number, etc. From here you would then be able to loop through the data in search of the profile that matches the email address you are searching for. 

@jallain has a great explanation and write up of this in a similar Community post which i’ve included below. I’ve also included some other Community post which touch upon this subject that may be helpful for you to review.

I hope this helps!

David

Badge

Hi @david.to , 

Thanks for the answer. But the problem is that I don’t want to search for a profile in a list. Because If I have 400 lists and I’m looking for 1 profile, it wouldn’t make sense to loop in all 400 to just look for one profile, that’s very resource intensive and unfortunate.

I just found out that we could use this endpoint

"https://a.klaviyo.com/api/v2/people/search?api_key={key}&email={email}"

But this isn’t documented, and I think it should.

Cheers,
Amrou.

Userlevel 6
Badge +5

Hello @shtlrs,

Thanks for surfacing that endpoint! I’ll share this detail with our Product Team to provide better documentation on this and to incorporate it into our API Documentation.

As always, thanks for providing your feedback and for being a part of the Klaviyo Community!

David

Hi David,

Any update to this endpoint being added the to API documentation?  I have created a support request in reference to this endpoint in hopes of batching email addresses for the search.  Best case the response would return email/id combos. 

Is that something that will be possible?

Thanks in advance,
Paul

 

Userlevel 6
Badge +5

Hello @paulfl,

Thanks for sharing your feedback! I have not received any updates regarding this endpoint being added to the API Documentation yet. However, I am aware that our engineering and product team has received the request!

I’ll further tack on your suggest surrounding returning email/id combos to the endpoint as well as at present, this is not yet feasible.

Thanks for your patience and for being a part of the Klaviyo Community!

David

Badge

Hi,

are there news about this endpoint? Is it safe to use it or still under testing as it has no documentation yet and may change?

We need to manage profiles and subscription/unsubscription via API and this call would match our needs: we would create a new profile to be assigned to a list if 404 is returned or manage its consent with unsubscribe/re-subscribe from/to list if 200 is returned.

 

Thank yuo

fabrizio

Userlevel 6
Badge +5

Hey @efferre68,

As our Klaviyo API usage grows, our documentation team is working hard towards collating any less frequently used endpoint to be included in our guides. Although this specific endpoint is not documented within our API Documentation, it is absolutely safe to use!

David

Badge

Thank you for reply David!

Our concern is that it might be changed for some reason as it is not documented yet, but if safe to use then more than fine.

I had already tested it and via Postman it was 100% matching our needs, just once implemented on our platform we got an error message, but think it might be due to a wrong call structure we’ve set, perhaps it has to be specified some other way.

fabrizio

Reply