Purge though API error

I am trying to purge through cloudflare API using
curl -X POST "https://api.cloudflare.com/client/v4/zones/xxx/purge_cache" -H "Authorization: Bearer xxx" --data '{"hosts":["dev.mydomain.co.uk"]'

But it is giving me an error
{"success":false,"errors":[{"code":1012,"message":"Request must contain one of \"purge_everything\", \"files\", \"tags\", \"hosts\" or \"prefixes\""}],"messages":[],"result":null}%

I don’t understand because hosts in part of the request?

You are missing the closing curly brace…
--data '{"hosts":["dev.mydomain.co.uk"]}'

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.