V2.0 Query body must contain a query hash

Hi,

I’m trying to do a conversations/search POST request (v2.0), with body:

{"query": {"operator": "AND", "value": [{"field": "updated_at", "operator": ">", "value": 1577836800 }, {"field": "updated_at", "operator": "<", "value": 1577923200 }]}}

This results in a “Bad request” with the following error message:

{"type":"error.list","request_id":"***","errors":[{"code":"invalid_query","message":"Query body must contain a query hash"}]}

Any idea what I might be doing wrong here?

I just had the same issue, and discovered that I wasn’t passing the header…

content-type: application/json

This solved it for me.

Thanks! That was it, I was passing just the Accept header but was missing Content-Type.