When managing attribute and attribute set data via the REST API, all the endpoints required to create a complete attribute set with attribute groups and attributes assigned to that set and those groups are present and available.
However, the reverse is not true. There is an endpoint missing in retrieving all of this data for an already existing attribute set. Specifically, the attribute group that each attribute in an attribute set belongs to. Attributes for an attribute set are retrieved by set and do not contain the attribute group they are present in either. This is largely obstructive to the process of fully and bi-directionally integrating the attribute set system with an external source.
In short, include the ID of the attribute group that an attribute belongs to in the returned JSON when listing attributes in an attribute set using the REST API. (Or otherwise include an endpoint that would make this information available).