Thanks a lot.
For whoever is interested, here's the working code:
require 'curb' require 'json' payload = { 'custom_collection' => {'title' => 'Test' } } c = Curl.post('https://<REDACTED>:<REDACTED>@<REDACTED>.myshopify.com/admin/custom_collections.json';, payload.to_json) do |http| http.headers['Content-Type'] = 'application/json' http.headers['Accept'] = '*/*' end puts c.body_str