Simply use keys_unsorted
(or keys
if you want them sorted). See e.g. Convert JSON array into CSV using jq or How to convert arbitrary simple JSON to CSV using jq? for two SO examples. There are many others too.
CLICK HERE to find out more related problems solutions.