Skip to main content
Question

GET api/templates, 500 server error when fetching all templates

  • December 11, 2025
  • 3 replies
  • 44 views

Forum|alt.badge.img

Getting 500 server error. Probably some problematic template/s thats been causing the issue. I have attached a screenshot of the curl request/response which narrows it down.

  • Current date: 2025/12/11
  • Filter `created -> less-than 2025-12-11` outputs 200 with the list
  • Filter `created -> greater-than 2025-12-11` or even `greater-or-equal` outputs 500 with the error
    Same thing if no filter or fields are provided.

What is the solution for this? Is there a way to find the problematic template causing this error?

 

3 replies

whereisjad
Expert Problem Solver IV
Forum|alt.badge.img+16
  • Expert Problem Solver IV
  • December 12, 2025

@Sujan first off do you actually have templates created after 2025-12-11.  Have you tried greater-than for a date before that?


cadence
Expert Problem Solver II
Forum|alt.badge.img+9
  • Expert Problem Solver II
  • December 12, 2025

For what it’s worth, I do a call to GET /api/templates?filter=created(greater-than,”2025-12-12”), I.e. today’s date, and even though I have no templates created greater than this date the API responds with an empty list ([]) as expected. In the case where I try to pass a future date (2025-12-13), the API returns a 400 error as expected too. 

I’m thinking ​@Sujan’s theory is correct that there is a problematic template causing problems here. 
@Sujan, do you have access to the account you’re making the API requests in? You could try to call GET Template on all templates created on or after 2025-12-11 to find the bad apple, remove it, and your problem should be solved.

If you don’t have access, then I think the only way for this to get resolved is through the Klaviyo team investigating and patching the root cause of the 500.  cc ​@Byrne C 

 

Cadence / Book a demo


 


Byrne C
Community Manager
Forum|alt.badge.img+27
  • Community Manager
  • December 16, 2025

Hi ​@Sujan,

Thanks for reaching out about the error! I want to confirm what you and ​@cadence mentioned, that there may be a problematic template that’s causing this. That being said, in some situations, 500 server errors need to be investigated and patched on our end. It might be a good idea to reach out to us at Klaviyo.com/support, so we can take a look and determine the cause of this error, and if action is needed on our end.