Question

Why am I getting 413 errors when using the HTTP API?

  • 10 September 2020
  • 1 reply
  • 126 views

Badge +3

I sent this question to support but haven’t gotten a response so I’m posting it here too. 

We're using the HTTP API for sending events to Mixpanel, and just started getting this error: "HTTPError: 413 Client Error: Request Entity Too Large"

Is there a max size to the events we can send?  

1 reply

Userlevel 6
Badge +3

Hi @aaron - 

I confirmed that you were working with out support team on this, but for anyone else stumbling into the same error message here are the first few steps you can take to see if you can debug what is going on:

  • We do have limits with requests to our APIs
    • If the GET request URL is over 19K characters (around 19 KB+) it will be blocked.
    • ~15KB for the header
    • ~20MB for the body of the request.
    • In addition, each event can have up to 255 event properties.

If the request being made is larger than the limit, 413 will be returned.

  • When sending in events with our Ingestion API, are you using GET requests? (For example, data sent in via the URL parameters: curl -v https://api.mixpanel.com/track/?data=yourEventData)
    • If so, I would suggest instead sending your event data in the payload body of a POST request as the limit is 20MB for the body.
curl -v https://api.mixpanel.com/track/ \ -d data='yourEventData'
  • If this doesn’t resolve,  you can consider sending all events to our Ingestion API in POST requests to avoid the 413 error.

You can  send data=base64encodedevent in the payload of a POST request as we allow a larger size for the payload body.

 

Reply


Mixpanel