You can use the /v1/devices/inventory API to set the tags on a device.
For example, an HTTP PUT to /ws/v1/devices/inventory/00000000-00000000-00409DFF-00000000
"tags" : [ "first tag", "second tag" ]
will set two tags for that particular device.
If you prefer XML you can use the following (or set the Accept header to application/xml).
HTTP PUT to /ws/v1/devices/inventory/00000000-00000000-00409DFF-00000000.xml with payload
Both of the above will replace any existing tags. There is currently no way to simply add a new tag. You can check out some other examples in the programming guide under v1/devices (http://ftp1.digi.com/support/documentation/html/90002008/Current/Default.htm#Reference/R_ws_v1_devices.htm)