How do I PUT data to the API? Upgrading k8s version

Hi.

I have managed to create a global token, and using that managed to authenticate and GET data from the API.

Now, I would like to use the same procedure to update the k8s version on one of my clusters. This is the procedure where you in the gui select Edit on your cluster, go down to Cluster Options and select a new kubernetes version from the drop down, like ‘v1.18.20-rancher1-2’ or something similar. But, how do I do that using a PUT or POST with cURL or Ansible?

I tried this:

curl -X PUT -H “Authorization: Bearer token-xxx:yyyyy” https://rancher-test.fqdn/v3/clusters/c-dgcsk -d ‘{“Cluster name”:“c-dgcsk”,“kubernetesVersion”:“v1.18.20-rancher1-2”}’

and got back:

{“baseType”:“error”,“code”:“MissingRequired”,“fieldName”:“Cluster name”,“message”:“”,“status”:422,“type”:“error”}

I thought I was providing the Cluster name, but apparently not? I tried with the human readable one as well, and got the same result. I have checked in the gui, that specific version is available.

Any suggestions?