Unable to update app key from REST API

Hello! I am unable to use the TTN Rest API to update my devices appkey. I get a successful updated response back from the URL but the app key never changes. Any ideas? Here is my https request.

msg.method = "PUT";
msg.url = "https://nam1.cloud.thethings.network/api/v3/as/applications/<application-id>/devices/<device-id>";
msg.headers = {
    "Authorization": "Bearer <api-access-token>",
    "Content-Type": "application/json"
};
msg.payload = {
    "end_device": {
      "ids": {
        "device_id": "<device-id>",
        "application_ids": {
          "application_id": "<application-id>"
        }
      },
      "root_keys": {
        "app_key": {
          "key": "<new-app-key>"
        }
      }
    },


};
return msg;

Do it on the console with the developer console open to see how it works there. Then replicate that in your code.

1 Like

Very cool. I did not realize I could trace it like that using browser developer tools. Thanks Nick!