Skip to main content
Contributor II
November 8, 2024
Solved

Understanding webhook url and header.

  • November 8, 2024
  • 6 replies
  • 346 views

 

Lead scoring in klaviyo?

4 different flows that adds certain amount of points to the lead score property value.
I need help answering these 6 questions.

But I won't seam to get it to work.
The Json body is all done but that's about it. (Source https://www.klaviyo.com/blog/solution-recipe-13-lead-scoring-in-klaviyo)

{
    "token": "[public key]",
    "properties": {
      "$email": "{{ person.email }}",
      "Lead_Score": {{ person|lookup:'Lead_Score'|default:0|add:'2'}}
    }
}

  1. Destination url? how do I find it or what is it? Tried reading but don’t understand
  2. Header? what to write?
  3. The business public api or make a private api?
  4. Change the "token" in the json body?
  5. If i want to remove points from the value, what word do I replace the “add” with?

 

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

Hi @

Thank you for posting in the Community!

You could try the following: 

  1. Destination url? how do I find it or what is it? Tried reading but don’t understand
    - https://a.klaviyo.com/api/track
     
  2. Header? what to write?
  • Content-Type": "application/json"
  1. The business public api or make a private api?-
  • I would go with the public API. 
  1. 4. Change the "token" in the json body?
  • { "token": "YOUR_PUBLIC_API_KEY", "properties": { "$email": "{{ person.email }}", "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|add:'2' }}" } }
  1. If i want to remove points from the value, what word do I replace the “add” with?
  • You could try with this function: "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|subtract:'2' }}"

Hope that helps! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov

6 replies

DavidSandel
Partner - Silver
Partner - Silver
November 8, 2024

Unfortunately, that article is out of date. Which means your JSON body is too.

It asks you to call the Identify API which no longer exists. Instead, you have to use the Update Profile endpoint with the email address.

Klaviyo Silver Master --> LowGravitySolutions.com
eligus1Author
Contributor II
November 8, 2024

Okay thank you. 

Will edit my text :) 

eligus1Author
Contributor II
November 8, 2024

The Json body is the least of my problem though. 

I have no idea what to put in the header or destination url? 

Christiannoerbjerg
Expert Problem Solver II
2025 Champion
November 9, 2024

Hi @

Thank you for posting in the Community!

You could try the following: 

  1. Destination url? how do I find it or what is it? Tried reading but don’t understand
    - https://a.klaviyo.com/api/track
     
  2. Header? what to write?
  • Content-Type": "application/json"
  1. The business public api or make a private api?-
  • I would go with the public API. 
  1. 4. Change the "token" in the json body?
  • { "token": "YOUR_PUBLIC_API_KEY", "properties": { "$email": "{{ person.email }}", "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|add:'2' }}" } }
  1. If i want to remove points from the value, what word do I replace the “add” with?
  • You could try with this function: "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|subtract:'2' }}"

Hope that helps! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov

eligus1Author
Contributor II
November 11, 2024

Hi @

Thank you for posting in the Community!

You could try the following: 

  1. Destination url? how do I find it or what is it? Tried reading but don’t understand
    - https://a.klaviyo.com/api/track
     
  2. Header? what to write?
  • Content-Type": "application/json"
  1. The business public api or make a private api?-
  • I would go with the public API. 
  1. 4. Change the "token" in the json body?
  • { "token": "YOUR_PUBLIC_API_KEY", "properties": { "$email": "{{ person.email }}", "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|add:'2' }}" } }
  1. If i want to remove points from the value, what word do I replace the “add” with?
  • You could try with this function: "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|subtract:'2' }}"

Hope that helps! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov

 

“This Klaviyo endpoint is retiring”
Tried with https://a.klaviyo.com/api/events/ instead.

Tried that header and Json body and got a 401 error message..

DavidSandel
Partner - Silver
Partner - Silver
November 21, 2024

@eligus1 - As I mentioned in the very first reply...2 weeks ago….which contains everything you’re asking….

 

You need the create or update profile endpoint:

The headers are also listed in plain sight at the top of the page in their payload example:

  • Authorization: Klaviyo-API-Key XXXXXXXXXXX
  • accept: application/vnd.api+json
  • content-type: application/vnd.api+json
  • revision: 2024-10-15

This is going through their PUBLIC API, but you need to provide your private API key from your account settings. This is not a private app.

Klaviyo Silver Master --> LowGravitySolutions.com