groups > modifyGroupMembers

Use the modifyGroupMembers command in the groups namespace to add players to and remove players from a group. In response to this command, Sonos first adds players to the group, then removes players from the group.


Endpoint

POST


Request Parameters

This command requires a groupId to determine the target of the command. See the Control documentation for details.

See the table below for descriptions of parameters in the body.

Parameter Type Value
playerIdsToAdd array An array of player ID strings of players to add to the group.
playerIdsToRemove array An array of player ID strings of players to remove from the group.

Response

Returns a groupInfo object, which currently only includes a group object. The groupInfo object may include additional information in the future.

In the event of a failure, returns a globalError.


Example

Request

In the example below, the original group is PID0, PID1, and PID2.

Response