Error with putting a device environment variable

I am using the latest BalenaOS + openBalena and am currently trying to update my environment variables using this method.

My request looks like this:

curl --request PUT \
  --url "https://api.<URL>/v6/device_environment_variable(device='DEVICE_ID',name='whoa')" \
  --header 'Authorization: Bearer XXXXXXXXXXX' \
  --header 'Content-Type: application/json' \
  --data '{"value": "todayz"}'

When I run this command I am getting the error: “Can only call getAffectedIds with PATCH/DELETE requests”.

Any thoughts on what is going on? This should just delete and insert the new variable named “whoa” with value “todayz”

Should I report this on github issues instead?

Hi @panbanda,

I attempted your request with a PATCH request instead of PUT, and it succeeded. Could you try PATCH and let us know if it works for you?

Regards,
Christina