500 error using the API to update a variable set

So I am trying to codify the modification of octopus variables in our pipeline. I have some powershell code that pulls down an existing variable set, modifies it and attempts to push it back up after making the changes. I get a 500 error when doing this. For the record I make sure that the variable name and scoping match up before updating the value. Then bump the version number by 1 and use a PUT with the following url “https://myOctopusServer.myDomain.com/api/variables/variableset-LibraryVariableSets-221” with the json as the body of the message.

what am I doing wrong?

I gave up. I am now using the client.dll to perform these actions.

Hi @btucker,

Thanks for getting in touch! I’m sorry for the delay in getting back to you. Generally we suggest the use of the Octopus.Client for interacting with the API where possible. It was designed to take a lot of the pain out of interacting with the Octopus API.

I’m glad to hear that the Octopus.Client is working for what you need.

Let me know if you have any questions here.

Best regards,
Daniel