Create/Update only one variable without overwrite all variables by API


Hello everyone,

I’m trying to update just one variable of an AWX host through the API, but the request is overwriting all variables. Can anyone confirm if this is possible or guide me on the best approach?

The request I’m sending is:

Method: PATCH
body: {“variables”: JSON.stringify({“teste”: “123”})}

Getting all host variables before editing to then send all in the request is not an option because the YAML to JSON conversion ends up altering other variables, hence the need to update just one.

Thank you all.