Skip to main content
Solved

400 error for invalid field 'City' in event post (data/attributes/profile/data/attributes/location/city)


Forum|alt.badge.img

I’m updating/testing our POST event for a placed order call.  I’ve been stepping through some errors and fixing them.  However, this one doesn’t make sense to me:

Filecontent: {"errors":[{"id":"259b79a7-d644-45e4-a4d9-4785397cb306","status":400,"code":"invalid","title":"Invalid input.","detail":"'City' is not a valid field for the resource 'profile'.","source":{"pointer":"/data/attributes/profile/data/attributes/location/City"},"links":{},"meta":{}}]}

According to the Create Event documentation (https://developers.klaviyo.com/en/reference/create_event) ‘City’ should be a valid field, inside the location object.  So, I don’t know why I’m getting this error returned. 

Any help would be greatly appreciated here.

Thanks!

Best answer by ChristianPaget

Hi there,

I believe the issue is that city is capitalized in the event you sent. If you make it not a capitalized, it should work.

Best,

Christian

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

2 replies

ChristianPaget
Klaviyo Employee
Forum|alt.badge.img+1
  • Klaviyo Employee
  • 6 replies
  • Answer
  • March 7, 2025

Hi there,

I believe the issue is that city is capitalized in the event you sent. If you make it not a capitalized, it should work.

Best,

Christian


Forum|alt.badge.img
  • Author
  • Contributor I
  • 4 replies
  • March 8, 2025

Thanks for the reply Christian!  I thought of that...But we have other fields with caps, that didn’t throw errors. 

However, I went ahead and changed all the location fields to be lower case and my initial test went through without errors.  So, looks like that was the fix here!

Appreciate the help here!