---
title: "match"
method: POST
path: "/households/{householdId}/musicServiceAccounts/match"
tags: ["musicServiceAccounts"]
---

# match

`POST /households/{householdId}/musicServiceAccounts/match`

Use the match command in the musicServiceAccounts namespace to get the account ID of a music service user account from the player.

 All players in the household return the same accounts. Changes made to a player are automatically replicated throughout the household.

## Request body

- object
  - `userIdHashCode` string, required — Opaque hash of the user account. You must use the same algorithm used by your SMAPI server. See getDeviceAuthToken and getUserInfo SMAPI requests for details.
  - `nickname` string, required — The name for the music service account presented to the user when they view their account from the Sonos app.
  - `serviceId` string, required — The unique identifier for the music service. Maximum length of 20 characters.
  - `linkCode` string, nullable — (Optional) The link code generated for device authentication. Your SMAPI service can also send this to the player in the getAppLink SMAPI request. The player can send it back in the getDeviceAuthToken SMAPI request.
  - `linkDeviceId` string, nullable — (Optional) Private data associated with the link code to prevent phishing. Like linkCode, also sent in the getAppLink SMAPI request and returned in the getDeviceAuthToken SMAPI request.

## Response `200`

See the x-muse-error-codes extension for a list of muse errors that generate this response

- MusicServiceAccount — Describes the music service account.
  - `userIdHashCode` string, nullable — Opaque hash of the user account sent by your service in the match command.
  - `nickname` string, nullable — The name for the music service account presented to the user when they view their account from the Sonos app.
  - `id` string, nullable — The account ID for the music service account.
  - `isGuest` boolean, nullable — Indicates whether the account is a guest account or not. If true, the account is a guest account. If false, it is not.
  - `service` Service — No description available
    - `name` string, nullable — No description available
    - `id` string, nullable — No description available
    - `imageUrl` string, nullable — Replaced by the `images` parameter.

## Other responses

- `400` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `401` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `403` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `404` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `499` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `500` — See the x-muse-error-codes extension for a list of muse errors that generate this response
- `503` — See the x-muse-error-codes extension for a list of muse errors that generate this response

---

[API](https://skmtc.net/sonos/apis/authorization-api.md) · [All operations](https://skmtc.net/sonos/apis/authorization-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sonos/authorization-api/revisions/243132628620/schema)
