Add Tag to folder per webdav/api

Is there a way to add a tag to a folder per webdav or any API?

I can set them manually in a very uncomfortable way over the webui, i have a script that automatically uploads files to folders. The folders are named with uniqe identifiers that are not human readable, so adding a tag to the folder with a humand readable name would makes way more comfortable.

I cant find any Documentation on this Topic

It looks like a supported WebDAV property oc:tags.

https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html?highlight=tag#supported-properties

Possibly (probably?) can be set the same way as in this example for a different property:

https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html?highlight=tag#settings-favorites