# Connectivity

### Connection endpoints <a href="#mtsconnectivity-v3.0-connectionendpoints" id="mtsconnectivity-v3.0-connectionendpoints"></a>

WebSocket over TLS 1.2/1.3 secure connection

<table><thead><tr><th>Transaction 3.0 API</th><th>Transaction Stream</th></tr></thead><tbody><tr><td>WebSocket connection to send transaction v3.0 API requests and receive responses</td><td>WebSocket connection to receive transactions over Transaction stream</td></tr><tr><td><p><strong>Client integration environment</strong><br>Host: </p><pre data-overflow="wrap"><code>wss.dataplane-nonprod.sportradar.dev
</code></pre><p>Port: </p><pre data-overflow="wrap"><code>443
</code></pre></td><td><p><strong>Client integration environment</strong><br>Host: </p><pre data-overflow="wrap"><code>wss-feedmesh.dataplane-nonprod.sportradar.dev
</code></pre><p>Port: </p><pre data-overflow="wrap"><code>443
</code></pre></td></tr><tr><td><p><strong>Production environment</strong></p><p>Host: </p><pre data-overflow="wrap"><code>wss.dataplane.sportradar.com
</code></pre><p>Port: </p><pre data-overflow="wrap"><code>443
</code></pre></td><td><p><strong>Production environment</strong></p><p>Host: </p><pre data-overflow="wrap"><code>wss-feedmesh.dataplane.sportradar.com
</code></pre><p>Port: </p><pre data-overflow="wrap"><code>443
</code></pre></td></tr></tbody></table>

### Authentication <a href="#mtsconnectivity-v3.0-authentication" id="mtsconnectivity-v3.0-authentication"></a>

Before connecting to the above connection endpoints, the client must obtain a token. To obtain the token, a POST request must be made to **<https://auth.sportradar.com/oauth/token>**. The request must include a Content-Type header and in the body, 4 url encoded key-value pairs are required.

{% hint style="warning" %}
**Note**

If you are establishing both the Transaction 3.0 API and the Transaction stream WebSocket connections, you must request two separate tokens. However, the client\_id and client\_secret are the same for both connections.
{% endhint %}

<table><thead><tr><th width="271.69091796875"></th><th width="139.685791015625">Attribute name</th><th>Attribute value</th></tr></thead><tbody><tr><td>Header</td><td>Content-Type</td><td>application/x-www-form-urlencoded</td></tr><tr><td>Body - url encoded key value pair</td><td>client_id</td><td>&#x3C;Sportradar provided client id></td></tr><tr><td>Body - url encoded key value pair</td><td>client_secret</td><td>&#x3C;Sportradar provided client secret></td></tr><tr><td>Body - url encoded key value pair</td><td>audience</td><td><p>Transaction 3.0 API, <br>Client integration environment:</p><pre data-overflow="wrap"><code>mbs-dp-non-prod-wss
</code></pre></td></tr><tr><td></td><td></td><td><p>Transaction 3.0 API, <br>Production  environment:</p><pre><code>mbs-dp-production-wss
</code></pre></td></tr><tr><td></td><td></td><td><p>Transaction stream, <br>Client integration environment:</p><pre data-overflow="wrap"><code>mbs-dp-non-prod-feed-mesh-wss
</code></pre></td></tr><tr><td></td><td></td><td><p>Transaction stream, <br>Production environment:</p><pre data-overflow="wrap"><code>mbs-dp-production-feed-mesh-wss
</code></pre></td></tr><tr><td>Body - url encoded key value pair</td><td>grant_type</td><td>client_credentials</td></tr></tbody></table>

**Example using cURL:**

```xml
curl -L -X POST 'https://auth.sportradar.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<provided client id>' \
--data-urlencode 'client_secret=<provided client secret>' \
--data-urlencode 'audience=mbs-dp-non-prod-wss' \
--data-urlencode 'grant_type=client_credentials'
```

The request returns a JSON response with "access\_token" field/attribute that is necessary to establish a WebSocket connection:

```json
{
    "access_token": "GENERATED_TOKEN",
    "expires_in": 300,
    "token_type": "Bearer"
}
```

When establishing a connection to the WebSocket, the value of access\_token must be provided in an Authorization header. Value of the header must be: Bearer GENERATED\_TOKEN, where GENERATED\_TOKEN must be replaced with the value obtained from the JSON response.

**Example using wscat:**

```xml
wscat -H "Authorization: Bearer GENERATED_TOKEN" --connect wss://wss.dataplane-nonprod.sportradar.dev
```

The access\_token must be included in the Authorization header of all subsequent API requests. Tokens are valid for a relatively short timeframe (5 mins) and **must be reused during their validity timeframe**. If the token has expired, follow the procedure outlined above to generate a new one.

{% hint style="danger" %}
**Note**

Clients must reuse non-expired tokens. A new token should be requested only a few seconds before the existing one has expired.&#x20;
{% endhint %}

{% hint style="info" %}
**Note**

If you believe your credentials have been compromised or accessed without authorization, please contact your Operational Account Manager (OAM), Service Delivery Manager (SDM), or email <MTS-servicedelivery@sportradar.com> and we will rotate your Client ID and/or Client Secret.
{% endhint %}

### Transaction stream (subscribe message)

Once a Transaction stream WebSocket connection has been established, send the subscribe message based on the template below. Send the actual operatorid (client identification). Value of channelid should be one of the following: "all", "final", "full", "cashout", depending on the setup and the type of requested information.

{% code overflow="wrap" %}

```json
{
    "operation": "subscription",
    "client": {
        "subscribe": true,
        "operatorid": "xxxx",
        "channelid": ["yyy"]
    }
}
```

{% endcode %}

If the subscription is successful, you will receive a message similar to the one below.

<figure><img src="/files/zMmy5rSoVYtFxvCuqUSY" alt=""><figcaption></figcaption></figure>

Once messages are available, you will start receiving them in the following format:

{% code overflow="wrap" %}

```json
{
  "originalKey": "internalId",
  "originalTimestamp": 1764990951652,
  "transformedData": {
    "payload": {
      "field1": "value1",
      "field2": {
        "subfield1": "subvalue1",
        "subfield2": "subvalue2"
      }
    }
  }
```

{% endcode %}

### Connections <a href="#mtsconnectivity-v3.0-connections" id="mtsconnectivity-v3.0-connections"></a>

To establish the connection, a token is required (see above). Maximum connection duration is 2h. After 2h, the connection is automatically terminated, and a new connection must be established with a new token. Each client's node should establish at least one WebSocket connection to the MTS endpoint. MTS servers will reply with a response through the same connection on which the request was received. In the event of an unexpected connection termination, the client should resend all requests for which a response was not received. For such requests, MTS will reply with an original response (the same response as it would be received if the termination of a connection did not occur).

### Rate Limiting <a href="#mtsconnectivity-v3.0-ratelimiting" id="mtsconnectivity-v3.0-ratelimiting"></a>

MTS performs the client request rate limiting described below. The values are valid:

* Per client
* For all request types (operation types) combined

| Requests per second | Requests per minute |
| ------------------- | ------------------- |
| 500                 | 5.000               |

### Limitations <a href="#mtsconnectivity-v3.0-limitations" id="mtsconnectivity-v3.0-limitations"></a>

The maximum supported size of a WebSocket frame is 32 KB. The maximum supported size of the message payload is 128 KB. Because of the WebSocket frame-size quota of 32 KB, a message larger than 32 KB must be split into multiple frames, each 32 KB or smaller (maximum number of frames is 4). If a larger message (or larger frame size) is received, the connection is closed with code 1009.

### Avoid IP-based whitelisting

{% hint style="danger" %}
Clients should avoid IP-based whitelisting for WebSocket connections to MBS Dataplane because WebSocket connections are provided through the AWS API Gateway. AWS dynamically manages the underlying infrastructure, so IPs may change without notice. Attempting to whitelist specific IPs may result in unintended connectivity failures. Any issues resulting from such configurations are the sole responsibility of the client and are considered a known risk.\
Instead, clients should rely on TLS-secured WebSocket (wss\://) connections with MBS Dataplane. There is a valid server certificate from the TLS handshake, which clients should verify based on the Fully Qualified Domain Name (FQDN) they are connecting to: <wss://wss.dataplane.sportradar.com/>

By verifying the server certificate against this FQDN, clients ensure a secure and trusted connection without relying on static IPs.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sportradar.com/transaction30api/api-description/connectivity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
