> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SubscriptionChangeMessage real-time messages type

> SubscriptionChangeMessage type for PlayFab real-time messages, reporting subscribe or unsubscribe results like SubscribeSuccess or NoSubscription.

> [!NOTE]
>
> The REST and SignalR APIs documented here are more complex than the client SDKs. Consider using the [Lobby C++ SDK](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md) or [Matchmaking C++ SDK](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members.md) instead, unless those SDKs don't meet your needs.

```json theme={null}
{
    "entityType": "title_player_account",
    "entityId": "6C6B908A2B5B9A4",
    "topic": "Opaque~Topic~String~6183258",
    "status": "SubscribeSuccess",
    "unsubscribeReason": "ResourceOwningServiceDefinedReason",
    "traceId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
```

## Members

**`entityType`**   string

The [type of the
entity](https://docs.xbox.com/services/playfab/live-service-management/game-configuration/entities/available-built-in-entity-types.md#title_player_account)
whose subscription changed. Clients may only care about this field if they
[added multiple entities](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/server-methods/add-entity-to-session.md) to the
same session.

Example: `title_player_account`

**`entityId`**   string

The [ID of the
entity](https://docs.xbox.com/services/playfab/live-service-management/game-configuration/entities/available-built-in-entity-types.md#title_player_account)
whose subscription changed. Clients may only care about this field if they
[added multiple entities](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/server-methods/add-entity-to-session.md) to the
same session.

Example: `6C6B908A2B5B9A4`

**`topic`**   string

A topic string, matching the topic string returned when [subscribing to
resources](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/subscribing-to-resources.md). This field allows the client to keep
track of which messages are for which resources they subscribed to.

Example: `Opaque~Topic~String~6183258`

**`status`**   string

The status of the subscription change.

| Possible Values | Description |
| - | - |
| `SubscribeSuccess` | The subscription succeeded. The client can assume they'll receive all messages for the topic from this point on. |
| `SubscribeFailure` | The subscription failed. The client can retry [subscribing to the resource](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/subscribing-to-resources.md). |
| `AlreadySubscribed` | The client is already subscribed to the resource it attempted to subscribe to again. |
| `UnsubscribeSuccess` | The unsubscription succeeded. |
| `UnsubscribeFailure` | The unsubscription failed. The client can retry [unsubscribing from the resource](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/subscribing-to-resources.md). |
| `NoSubscription` | The client isn't subscribed to the resource it attempted to unsubscribe from. |

**`unsubscribeReason`**   string *optional*

A reason for unsubscription, that can be optionally provided by the service
handling the unsubscribe request.

Example: `ResourceOwningServiceDefinedReason`

**`traceId`**   string

A [W3C TraceContext trace-id](https://www.w3.org/TR/trace-context/#trace-id).
The client should log this field so it can be included if you need to send a bug
report to the PlayFab team.

Example: `4bf92f3577b34da6a3ce929d0e0e4736`

## See also

* Client method
  [ReceiveSubscriptionChangeMessage](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/client-methods/receive-subscription-change-message.md)
* [Real-time messages SignalR Hub](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/signalr-hub.md)
* [Real-time messages for Lobby and Matchmaking APIs](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/overview.md)


## Related topics

- [StartOrRecoverSessionRequest real-time messages type](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/types/start-or-recover-session-request.md)
- [StartOrRecoverSessionResponse real-time messages type](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/types/start-or-recover-session-response.md)
- [Message real-time messages type](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/types/message.md)
- [EndSessionRequest real-time messages type](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/types/end-session-request.md)
- [EndSessionResponse real-time messages type](https://docs.xbox.com/services/playfab/multiplayer/real-time-messages/types/end-session-response.md)
