It depends on the endpoint. Look it up in the swagger docs and see if there’s a patch option. There usually is. The key with patch is that LM wants you to include an opType query parameter, and it’s not clear what this does. Here’s the best documentation I could find:
Define custom properties for this device. Each property needs to have a name and a value. To add or update just one or a few device properties in the customProperties object, but not all of them, you’ll need to additionally use the opType query parameter. The opType query parameter can be set to add, refresh or replace. opType=add indicates that the properties included in the payload will be added, but all existing properties will remain the same. opType=replace indicates that the properties included in the request payload will be added if they don’t already exist, or updated if they do already exist, but all other existing properties will remain the same. opType=refresh indicates that the properties will be replaced with those included in the request payload.
Here’s my understanding:
It only has anything to do with patching the custom properties.
opType=add - this will add any new properties you have specified in the customProperties of your payload. New properties will be added. Existing properties will remain with their existing value for any properties that already exist that are specified in your payload. I don’t see the use case for this one and don’t use it.
opType=replace - this will add any new properties you have specified in the customProperties of your payload. New properties will be added. Existing properties will be overwritten with the value for that property in your payload. This one makes the most sense to me as it updates/creates the properties i specify in my payload and leaves everything else alone. This is the one i use almost exclusively.
opType=refresh - this is the nuclear option. This deletes all custom properties and adds the ones from your payload. This one is the most dangerous and is more like a PUT. Exactly like a PUT actually, but only when it comes to the customProperties. So it’s like PATCHing the device, but PUTting the customProperties.
GET-tweak-PUT should not be the go-to.