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?
Teams and TeamSets have not changed in Sugar 7 from Sugar 6. I hope that something is done in a future release with teams as this is the biggest slow down in the system.
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