---
title: "Get RTA nonce token"
method: GET
path: "/v2/rta"
tags: ["rta"]
---

# Get RTA nonce token

`GET /v2/rta`

Returns a nonce token for establishing a WebSocket connection to Xbox Live's Real-Time Activity (RTA) service.

## What is RTA?

Real-Time Activity is Xbox Live's push notification system that allows you to subscribe to real-time updates for:
- **Rich Presence** - Live status updates (what game, what activity)
- **Party Details** - Party membership changes
- **Multiplayer Activity** - Session join/leave events
- **Social Events** - Friend list changes

## WebSocket Connection

After obtaining the nonce, connect to the RTA WebSocket:

```javascript
const response = await fetch('https://api.xbl.io/v2/rta', {
  headers: { 'X-Authorization': 'YOUR_API_KEY' }
});
const nonce = await response.text();

const socket = new WebSocket(
  `wss://rta.xboxlive.com/connect?nonce=${nonce}`,
  'rta.xboxlive.com.V2'
);

socket.onopen = () => {
  // Subscribe to presence changes for a user
  socket.send('[1,0,"https://userpresence.xboxlive.com/users/xuid(2533274792093122)/richpresence"]');

  // Subscribe to party details
  socket.send('[1,1,"http://sessiondirectory.xboxlive.com/users/xuid(2533274792093122)/partydetails"]');

  // Subscribe to multiplayer activity
  socket.send('[1,2,"https://multiplayeractivity.xboxlive.com/users/xuid(2533274792093122)"]');

  // Subscribe to friend list changes
  socket.send('[1,3,"http://social.xboxlive.com/users/xuid(2533274792093122)/friends"]');
};

socket.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('RTA Event:', data);
};
```

## Subscription Message Format

`[1, subscriptionId, "resourceUri"]`

- **1** - Message type (subscribe)
- **subscriptionId** - Unique ID for this subscription (use incrementing integers)
- **resourceUri** - The Xbox Live resource to subscribe to

## Common Resource URIs

| Resource | URI Pattern |
|----------|------------|
| Rich Presence | `https://userpresence.xboxlive.com/users/xuid({xuid})/richpresence` |
| Party Details | `http://sessiondirectory.xboxlive.com/users/xuid({xuid})/partydetails` |
| Multiplayer | `https://multiplayeractivity.xboxlive.com/users/xuid({xuid})` |
| Friends | `http://social.xboxlive.com/users/xuid({xuid})/friends` |

## Response `200`

RTA nonce token for WebSocket connection

- ApiResponse — Standard API response wrapper. All endpoints return responses in this format.
  - `content` unknown, required
  - `code` integer, required — HTTP status code from the upstream API. Common values: 200 (success), 400 (bad request), 401 (unauthorized), 404 (not found), 410 (deprecated/gone), 429 (rate limited), 500 (server error)

## Other responses

- `401` — Invalid or missing API key
- `429` — Rate limit exceeded

---

[API](https://skmtc.dev/xbl/apis/openxbl-api.md) · [All operations](https://skmtc.dev/xbl/apis/openxbl-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/xbl/openxbl-api/revisions/e5df7bdca559/schema)
