In the v6.5 and v6.7 Developer Guides, there was a page for Manipulating Teams Programatically in a Logic Hook or Job Queue. I'm going to assume this still works in v7x, but is there a better way?
This page is still available in the 7.6 guide, but it is in a different place based on changes to the 6.x to 7.x guides: Manipulating Teams Programatically
This page is still available in the 7.6 guide, but it is in a different place based on changes to the 6.x to 7.x guides: Manipulating Teams Programatically