Skip to main content
Contributor I
October 1, 2021
Solved

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

  • October 1, 2021
  • 14 replies
  • 4950 views

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….
 

 

    This topic has been closed for replies.
    Best answer by shtlrs

    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.

    14 replies

    David To
    Klaviyo Employee
    Klaviyo Employee
    October 4, 2021

    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

    shtlrsAuthorAnswer
    Contributor I
    October 4, 2021

    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.

    David To
    Klaviyo Employee
    Klaviyo Employee
    October 4, 2021

    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

    Contributor I
    October 15, 2021

    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

     

    David To
    Klaviyo Employee
    Klaviyo Employee
    October 15, 2021

    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 suggestion 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

    Contributor II
    November 8, 2021

    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

    David To
    Klaviyo Employee
    Klaviyo Employee
    November 8, 2021

    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

    Contributor II
    November 9, 2021

    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

    Contributor I
    April 8, 2022

    Hey, this endpoint doesn’t seem to work for me.
    I’ve tried the following with a valid email address that’s in my profiles:
    https://a.klaviyo.com/api/v2/people/search?api_key={api_key}&email={email}

    However, I get the following response: There is no profile matching the given parameters.
     

    Any idea?

    David To
    Klaviyo Employee
    Klaviyo Employee
    April 8, 2022

    Hey @ReeceC,

    I would first suggest double checking and making sure the API Key you’re using is one generated from the respective account you are testing in. I’ve seen a number of instances where users who have access to multiple accounts inadvertently use the incorrect key associated within a different account. 

    Additionally, I would also ensure that the email address/profile you’re searching for is in fact a profile within your respective Klaviyo account. The simplest way to confirm this would be entering the email address into the search bar at the top of the Klaviyo interface and seeing the results that are returned. Using the in-app search tool would function similarly to the endpoint where if there is no contact/profile within your Klaviyo account which has this email address, you’ll receive a “We couldn't find anyone matching your search” notice.

    David