Skip to main content
Contributor I
November 15, 2022
Solved

How long is a page cursor available for usage - when requesting filtered events from the Klaviyo API?

  • November 15, 2022
  • 4 replies
  • 386 views

Hey dear Klaviyo community, 
As the title of the question suggests, we would like to know, what is the lifespan of a generated next page cursor when sending a request for the events EP? how long does it last? , request example:
https://a.klaviyo.com/api/events?filter=greater-than(datetime,1970-01-01T11:00:00Z)

Thanks!

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

    Hi @DanielChn, thanks for your question and details on your use case!

    While we can't provide an exact lifespan, your code should not count on pagination tokens being permanent, and should account for pagination tokens expiring after a period of time. A good rule of thumb here is three days.

    Will that timeframe work for your retry mechanism?

    Ezra

    4 replies

    Brian Turcotte
    Klaviyo Alum
    November 16, 2022

    Hi @DanielChn and welcome to the Community!

     

    When you make a call that gives paginated results, you get the next and prev links. Just to clarify the use case, are you asking if you have to use that next link in a certain time frame before it becomes invalid?

     

    If so, I will check with our engineering team to investigate if that time limit exists and get back to the thread. Would you be willing to share more about how this information will be applied to your use case? It may help to understand the basis of the question better.

     

    Thanks for using the Community!

     

    -Brian

    DanielChnAuthor
    Contributor I
    November 16, 2022

    Hey @Brian Turcotte, thanks for the comment

    - “Just to clarify the use case, are you asking if you have to use that next link in a certain time frame before it becomes invalid?”
    Yes

    - “Would you be willing to share more about how this information will be applied to your use case?”
    Sure. We want to be able to use the next page cursor, after a period of extended period of time, as we want to store requests that failed in a dlq kind of mechanism, that will be retried and continue from the page that it was stopped. 

    Thanks!

    DanielChnAuthor
    Contributor I
    November 23, 2022

    Hey @Brian Turcotte, thanks again for the help:), did this reached the relevant developer?

     

    ezraAnswer
    Klaviyo Employee
    November 29, 2022

    Hi @DanielChn, thanks for your question and details on your use case!

    While we can't provide an exact lifespan, your code should not count on pagination tokens being permanent, and should account for pagination tokens expiring after a period of time. A good rule of thumb here is three days.

    Will that timeframe work for your retry mechanism?

    Ezra