Skip to main content
Solved

Number of Email Sent Flows API


Forum|alt.badge.img+2

I am trying to figure out how to pull the number of sent emails from flows endpoint - https://a.klaviyo.com/api/v1/flows

For campaigns endpoint , api returns it as num_recipients but couldn't find it in flows.

Can you help please?

Best answer by Dov

Hi @Become,

Thanks for sharing this question with us.

You could use the https://a.klaviyo.com/api/v1/metric/{metric_id}/export API to get the count of how many times a particular event happened, e.g. "Received Email". This also supports a "by" clause, so you could include a request that asks for results grouped by "$attributed_flow" and then sum these up to get the value across all flows. Here is our guide on querying event data.

Here's an example API call using the Received Email metric: https://a.klaviyo.com/api/v1/metric/(metric_id)/export?api_key=[private key]&measurement=count&by=$flow&start_date=2022-06-28&end_date=2022-07-01

And here's a snippet of the response:

"results": [
    {
        "segment": "Abandoned Cart Reminder - Standard (XXXXXX)",
        "data": [
            {
                "date": "2022-06-28 00:00:00",
                "values": [
                    2.0
                ]
            }

It shows that on 6/28, two emails were received from the Abandoned Cart Reminder - Standard flow. You could also make calls for the other email-related metrics, e.g.

 

I hope that’s helpful.

View original
Did this topic or the replies in the thread help you find an answer to your question?

6 replies

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • July 12, 2022

Hi @Become,

Thanks for sharing this question with us.

You could use the https://a.klaviyo.com/api/v1/metric/{metric_id}/export API to get the count of how many times a particular event happened, e.g. "Received Email". This also supports a "by" clause, so you could include a request that asks for results grouped by "$attributed_flow" and then sum these up to get the value across all flows. Here is our guide on querying event data.

Here's an example API call using the Received Email metric: https://a.klaviyo.com/api/v1/metric/(metric_id)/export?api_key=[private key]&measurement=count&by=$flow&start_date=2022-06-28&end_date=2022-07-01

And here's a snippet of the response:

"results": [
    {
        "segment": "Abandoned Cart Reminder - Standard (XXXXXX)",
        "data": [
            {
                "date": "2022-06-28 00:00:00",
                "values": [
                    2.0
                ]
            }

It shows that on 6/28, two emails were received from the Abandoned Cart Reminder - Standard flow. You could also make calls for the other email-related metrics, e.g.

 

I hope that’s helpful.


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 4 replies
  • August 8, 2022

As i understood the number of delivered emails is the sum of all the email metrics.
What about the number of total recipients for flows? How can i pull this?


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 4 replies
  • August 9, 2022
Become wrote:

As i understood the number of delivered emails is the sum of all the email metrics.
What about the number of total recipients for flows? How can i pull this?

I need to calculate the rates for each metrics - do i need to divide the metric amount with the number of recipients ? 


Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • August 9, 2022

Hi @Become,

Thanks for your question.

Indeed, a rate calculation would involve the metric amount divided by the number of recipients.

You may also find the following guides helpful:

How to Use Revenue per Recipient Benchmarks to Plan Sales Performance
Performance Benchmarks for Flow Emails
How to Export Flow Analytics

Thanks for being a community member.


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 4 replies
  • August 21, 2022

Thank you!
Another question - i am trying to pull all the opened emails for each campaign and the number i get is not exactly the same as the number i see in campaign reports here - 

Is the number of recipients supposed to be equal to the sum of all the opened emails?

i am using this endpoint - https://a.klaviyo.com/api/v1/metric/S5Cx35/export
metric id is the opened email metric id
where - [[“Campaign Name","=",{Camapign_name}]]
measurement - unique
unit - day
api_key - ***
Am i doing something wrong?


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 4 replies
  • August 24, 2022

As i understood you are showing uniques per month.
But when i change the unit to month its still not the same exact number .
Is there a way to pull it?