groups > createGroup

Use the createGroup command in the groups namespace to create a new group from a list of players. The player returns a group object with the group ID. This may be an existing group ID if an existing group is a subset of the new group. In this case, Sonos may build the new group by adding new players to the existing group.



Request Parameters

This command requires a householdId in the header 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
playerIds array An array of player ID strings to group.
musicContextGroupId string (Optional) The group containing the audio that you want to use. If empty or not provided, the new group will not contain any audio.


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.