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.
Endpoint
POST
1 |
/households/{householdId}/groups/createGroup |
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. |
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
1 2 3 4 5 |
{ "playerIds" : [ "PID0", "PID1", "PID2","PID3" ] } |
Response
1 2 3 4 5 6 7 8 |
{ "group": { "playerIds": ["PID0","PID1", "PID2", "PID3" ], "coordinatorId": "PID0", "id": "XYZ-123abc456:12", "name": "player0 + 3" } } |