If you are getting an "invalid payload" error for sending events to the insights API, we would recommend reviewing that your event data parameters are in the expected format.
//eventType must be a string
eventName: 'Article clicked',
//eventName must be a string
//index must be a string, it's the same as the index name used by the search engine
//userToken must be a string
//objectIDs is optional, must be an array
//Position must be an integer
//Click positions start at 1, not 0.
//This is required if a queryID is provided. You must provide one position for each objectID
//queryID must be a string, this is required when an event is tied to a search
//timestamp must be an integer, expressed in milliseconds
//timestamp has to be within the last four days. If not, the event will be rejected
For more information on Send Events Parameters, please review the documentation here.