Klaviyo Webhook Payload Issue

Author
Charlotte Brown Author
|
7 hours ago Asked
|
3 Views
|
0 Replies
0

I'm trying to fire a custom event using Klaviyo's webhook action in a flow, specifically targeting the /api/track endpoint. I'm hitting a consistent 400 Bad Request, even after reviewing the API documentation for event tracking.

It seems to struggle with the specific payload structure when including certain nested properties. Here's a simplified version of the payload and the error I'm seeing:

POST /api/track
Host: track.klaviyo.com
Content-Type: application/json

{
  "token": "YOUR_PUBLIC_API_KEY",
  "event": "Custom Event Name",
  "customer_properties": {
    "$email": "[email protected]"
  },
  "properties": {
    "product_id": "PROD123",
    "metadata": {
      "source": "internal_app",
      "status": "processed"
    }
  }
}

HTTP/1.1 400 Bad Request
Content-Type: application/json

{
  "message": "Invalid JSON or malformed request."
}

Is there a specific way to structure nested JSON objects within the properties field for Klaviyo's track API via webhooks, or am I missing a critical header for this type of data?

Any expert insights would be greatly appreciated.

0 Answers

No answers yet.

Be the first to provide a helpful answer!

Your Answer

You must Log In to post an answer and earn reputation.