Yes, you can associate tags to a server using API.
In the monitor update API, assign the tag IDs that you wish to associate with the server.
tag_ids: ["1653100027038929", "1653000027372008", "1654000018924453"]
Hope this helps. Let us know for further queries, if any.