In Php, empty associative array are JSON encoded as "[]" and so, sending:
POST https://api.intercom.io/events
{"created_at":1430841996,"event_name":"merchant_created","metadata":[],"user_id":"1"}
Gives
{
"type": "error.list",
"request_id": "7e654619-03e4-43e8-aaef-8d0c82850bf2",
"errors": [
{
"code": "parameter_invalid",
"message": "found unpermitted parameters: metadata"
}
]
}
A possible solution would be to remove metadata field is it's empty.