# API Documentation

## **Applications**

<mark style="color:blue;">`GET`</mark> `https://api.vagon.io/app-stream-management/v2/applications`

Returns all applications in Developer account. Application IDs will be used for other endpoints.

#### Query Parameters

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| page<mark style="color:red;">\*</mark>      | 1    |             |
| per\_page<mark style="color:red;">\*</mark> | 100  |             |

#### Headers

| Name                                            | Type                                       | Description |
| ----------------------------------------------- | ------------------------------------------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | HMAC {key}:{signature}:{nonce}:{timestamp} |             |
| Content-Type                                    | application/json                           |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "applications": [
    {
      "id": "11421",
      "type": "application",
      "attributes": {
        "id": 11421,
        "name": "Test Application",
        "status": "active",
        "banner_url": null,
        "logo_url": null,
        "friendly_status": "no_streams",
        "os": "windows",
        "active_executable": {
          "id": "122411",
          "type": "executable",
          "attributes": {
            "executable_name": "Application",
            "launch_arguments": null,
            "restart_arguments": null,
            "file": "Application.zip",
            "version": 1,
            "active": true,
            "created_at": "2024-03-07T14:40:23.744Z",
            "images": []
          }
        },
        "performance": "Pro - G2",
        "enterprise": null,
        "pro": null
      }
    }
  ],
  "count": 7,
  "page": 1,
  "client_code": 200,
  "timestamp": "2024-03-27T10:29:25Z"
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "message": "Not Found",
  "client_code": 404,
  "timestamp": "2024-03-27T10:11:43Z"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```json
```

{% endtab %}
{% endtabs %}

## **Streams**

Streams endpoints allow you to manage your Stream Machines according to your custom workflow.&#x20;

You have to create a Stream link from `Vagon Dashboard` to use `Streams` endpoints to manage your `Streams Machines`.

<mark style="color:blue;">`GET`</mark> `https://api.vagon.io/app-stream-management/v2/streams`

Returns all Streams and Streams details under the selected application

#### Query Parameters

| Name                                              | Type   | Description |
| ------------------------------------------------- | ------ | ----------- |
| page                                              | 1      |             |
| per\_page                                         | 100    |             |
| application\_id<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "streams": [
    {
      "id": "138681",
      "type": "stream",
      "attributes": {
        "id": 138681,
        "name": "Stream",
        "status": "active",
        "uid": "416d2b18-90av-a71k-2034-9f282c3f8603",
        "resolution": "res_1080p",
        "collect_info": false,
        "dark_mode": null,
        "password_protection": false,
        "sound": "user_can_activate",
        "microphone": "user_can_activate",
        "launch_arguments": null,
        "dock_position": "bottom",
        "keyboard_layout": null,
        "user_session_data": false,
        "boost_enabled": false,
        "pixel_streaming_enabled": false,
        "port_access_enabled": false,
        "maximum_session_duration": "off",
        "idle_duration": "off",
        "auto_turn_off_duration": "5_min",
        "application": {
          "id": "11421",
          "type": "application",
          "attributes": {
            "id": 11421,
            "name": "Test Application",
            "status": "active",
            "banner_url": null,
            "logo_url": null,
            "friendly_status": "live",
            "os": "windows",
            "active_executable": {
              "id": "122411",
              "type": "executable",
              "attributes": {
                "executable_name": "Application",
                "launch_arguments": null,
                "restart_arguments": null,
                "file": "Application.zip",
                "version": 1,
                "active": true,
                "created_at": "2024-03-07T14:40:26.896Z",
                "images": []
              }
            },
            "performance": "Pro - G2",
            "enterprise": null,
            "pro": null
          }
        },
        "in_active_time_range": true
      }
    }
  ],
  "count": 2,
  "page": 1,
  "client_code": 200,
  "timestamp": "2024-03-27T10:36:47Z"
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
	"message": "Not Found",
	"client_code": 404,
	"timestamp": "2024-03-27T10:11:43Z"
}
```

{% endtab %}
{% endtabs %}

## **Stream Machines**

<mark style="color:blue;">`GET`</mark> `https://api.vagon.io/app-stream-management/v2/streams/{stream_id}/machines`

Returns all Stream Machines and their status under the Streams

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| stream\_id<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name      | Type | Description |
| --------- | ---- | ----------- |
| page      | 1    |             |
| per\_page | 10   |             |

#### Headers

| Name                                            | Type                                       | Description |
| ----------------------------------------------- | ------------------------------------------ | ----------- |
| Content-Type                                    | application/json                           |             |
| Authorization<mark style="color:red;">\*</mark> | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "machines": [
    {
      "id": "9462282",
      "type": "machine",
      "attributes": {
        "start_at": "2024-03-27T08:48:46.948Z",
        "end_at": "2024-03-27T08:55:12.763Z",
        "status": "stopped",
        "friendly_status": "off",
        "connection_status": "terminated",
        "region": "dublin",
        "uid": "4df05d4e-af92-ad82-2034-2f2cc0f57ea2",
        "cost": "0.182",
        "duration": 385,
        "application_name": "Test Application",
        "application_id": 1151,
        "stream_id": 1364,
        "stream_name": "Stream #2240",
        "machine_type": "Pro - G2",
        "public_ip_address": null
      }
    }
  ],
  "count": 5,
  "page": 1,
  "client_code": 200,
  "timestamp": "2024-03-27T10:39:43Z"
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "message": "Not Found",
  "client_code": 404,
  "timestamp": "2024-03-27T10:40:45Z"
}
```

{% endtab %}
{% endtabs %}

#### **Stream Machine Status Details**

<table><thead><tr><th width="272.97701149425285">Stream Machine Status</th><th>Details</th></tr></thead><tbody><tr><td><strong><code>waiting</code></strong></td><td>Stream is still booting up and preparing for connection. </td></tr><tr><td><strong><code>available</code></strong></td><td>Stream is ready for assigning and then connecting.</td></tr><tr><td><strong><code>assigned</code></strong></td><td>Stream is assigned to a User, but not connected yet.  </td></tr><tr><td><strong><code>connected</code></strong></td><td> Stream is connected, and there is an active session. </td></tr><tr><td><strong><code>terminated</code></strong> </td><td>Stream is turned off, and terminated.</td></tr><tr><td><strong><code>proxy-in-migration</code></strong></td><td>Stream is getting ready for the next visitor.</td></tr></tbody></table>

{% hint style="info" %}
When you use the generated iframe or URL link from the Streams Dashboard, all Stream Machine operations will be done by Streams itself according to your preferences.
{% endhint %}

## **Start Stream Machine**

<mark style="color:green;">`POST`</mark> `https://api.vagon.io/app-stream-management/v2/streams/{stream_id}/start-machine`

Starts a Stream Machine under the given Streams.

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| stream\_id<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                                            | Type                                       | Description |
| ----------------------------------------------- | ------------------------------------------ | ----------- |
| Content-Type<mark style="color:red;">\*</mark>  | application/json                           |             |
| Authorization<mark style="color:red;">\*</mark> | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

#### Request Body

<table><thead><tr><th width="155.66015625">Name</th><th width="149.55078125">Type</th><th>Description</th></tr></thead><tbody><tr><td>region<mark style="color:red;">*</mark></td><td>String</td><td><p>Stream Machine Location. </p><p>Available regions can be checked via <a data-mention href="../../guides/performance-types">performance-types</a>page for the selected performance type, and the regions must be active in Stream Configurations.</p></td></tr><tr><td>regions</td><td>Array of String</td><td>Alternative Stream Machine Locations, only available for Automated Setup.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "94683",
  "type": "machine",
  "attributes": {
    "start_at": "2024-03-27T10:52:13.858Z",
    "end_at": null,
    "status": "pending",
    "friendly_status": "turning_on",
    "connection_status": "waiting",
    "region": "dublin",
    "uid": "11a17688-221c-4707-94dd-a2af9116d7d0",
    "cost": "0.0",
    "duration": 0,
    "application_name": "Test Application",
    "application_id": 1143,
    "stream_id": 1381,
    "stream_name": "Stream #1381",
    "machine_type": "Starter",
    "public_ip_address": null
  },
  "client_code": 200,
  "timestamp": "2024-03-27T10:52:15Z"
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "client_code": 404,
  "message": "Not Found",
  "timestamp": "2024-03-27T10:53:28Z"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "client_code": 4601,
  "message": "Insufficient Capacity",
  "timestamp": "2024-03-27T10:54:53Z"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "client_code": 4603,
  "message": "Region must be activated",
  "timestamp": "2024-03-27T10:56:06Z"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

```json
{
  "client_code": 4609,
  "message": "Stream is not active",
  "timestamp": "2024-03-27T10:59:53Z"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

```json
{
  "client_code": 4610,
  "message": "Stream capacity management method must be Cost Optimized - on_demand",
  "timestamp": "2024-03-27T10:57:19Z"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
This endpoint can only be used with **Cost Optimized** Streams. For **Availability Optimized** or **Balanced** Streams, the system will automatically handle the capacity management.

Capacity Management configuration can be updated via Streams Dashboard.&#x20;

If you try to start a Stream Machine for **Availability Optimized** or **Balanced** streams, you will get a **4610** error from the endpoint.
{% endhint %}

<table><thead><tr><th>Region Name</th><th>Parameter Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Dublin</td><td>dublin</td><td></td></tr><tr><td>North Virginia</td><td>north_virginia</td><td></td></tr><tr><td>Oregon</td><td>oregon</td><td></td></tr><tr><td>Ohio</td><td>ohio</td><td></td></tr><tr><td>Montreal</td><td>montreal</td><td></td></tr><tr><td>California</td><td>california</td><td></td></tr><tr><td>Sao Paolo</td><td>sao_paolo</td><td></td></tr><tr><td>Stockholm</td><td>stockholm</td><td></td></tr><tr><td>Frankfurt</td><td>frankfurt</td><td></td></tr><tr><td>Bahrain</td><td>bahrain</td><td></td></tr><tr><td>Mumbai</td><td>mumbai</td><td></td></tr><tr><td>Seoul</td><td>seoul</td><td></td></tr><tr><td>Tokyo</td><td>tokyo</td><td></td></tr><tr><td>Singapore</td><td>singapore</td><td></td></tr><tr><td>Sydney</td><td>sydney</td><td></td></tr><tr><td>Jakarta</td><td>jakarta</td><td></td></tr><tr><td>Dubai</td><td>uae</td><td></td></tr><tr><td>Cape Town</td><td>cape_town</td><td></td></tr><tr><td>Hong Kong</td><td>hong_kong</td><td></td></tr></tbody></table>

## **Assign Stream Machine**

After running the Stream, Developer must assign the session to a User. As a response of this request, the system will automatically assign a Stream to the User, API will return a Session Link, and the client will be able to give access to the User by embedding Session Link to an iframe.

<mark style="color:green;">`POST`</mark> `https://api.vagon.io/app-stream-management/v2/streams/{stream_id}/assign-machine`

Assigns an available Streams Machine to your Visitor

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| stream\_id<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                                           | Type                                       | Description |
| ---------------------------------------------- | ------------------------------------------ | ----------- |
| Content-Type<mark style="color:red;">\*</mark> | application/json                           |             |
| Authorization                                  | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

#### Request Body

<table><thead><tr><th width="131.9140625">Name</th><th width="165.13671875">Type</th><th>Description</th></tr></thead><tbody><tr><td>region<mark style="color:red;">*</mark></td><td>String</td><td><p>Stream Machine Location. </p><p>Available regions can be checked via <a data-mention href="../../guides/performance-types">performance-types</a>page for the selected performance type, and the regions must be active in Stream Configurations.</p></td></tr><tr><td>regions</td><td>Array of String</td><td>Alternative Stream Machine Locations, only available for Automated Setup.</td></tr><tr><td>user_id</td><td>String</td><td><code>user_id</code> can be generated via Create Visitor endpoint</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "client_code": 200,
  "connection_link": "https://sb-app.vagon.io/stream/bf96fb3b-9420-asf2-8dc5-b8477fd52303",
  "machine": {
    "id": "946869128",
    "type": "machine",
    "attributes": {
      "start_at": "2024-03-27T11:05:42.144Z",
      "end_at": null,
      "status": "pending",
      "friendly_status": "turning_on",
      "connection_status": "assigned",
      "region": "dublin",
      "uid": "bf96fb3b-9420-asf2-8dc5-b8477fd52303",
      "cost": "0.0",
      "duration": 0,
      "application_name": "Test Application",
      "application_id": 1143,
      "stream_id": 1381,
      "stream_name": "Stream #138241",
      "machine_type": "Pro - G2",
      "public_ip_address": null
    }
  },
  "message": null,
  "timestamp": "2024-03-27T11:05:49Z"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "client_code": 4603,
  "message": "Region must be activated",
  "timestamp": "2024-03-27T11:06:35Z"
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "client_code": 404,
  "message": "Not Found",
  "timestamp": "2024-03-27T11:08:03Z"
}
```

{% endtab %}
{% endtabs %}

## **Stop Stream Machine**

<mark style="color:green;">`POST`</mark> `https://api.vagon.io/app-stream-management/v2/streams/stop-machine`

Turns off a running Streams Machine

#### Headers

| Name                                            | Type                                       | Description |
| ----------------------------------------------- | ------------------------------------------ | ----------- |
| Content-Type<mark style="color:red;">\*</mark>  | application/json                           |             |
| Authorization<mark style="color:red;">\*</mark> | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

#### Request Body

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| machine\_id<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "client_code": 200,
  "timestamp": "2024-03-27T11:10:38Z"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "client_code": 400,
  "timestamp": "2024-03-27T11:10:44Z"
}
```

{% endtab %}
{% endtabs %}

## **Create User**

Developer must create User(s) to give access to a Stream for each User. You can provide an email address to identify your Users, or you can send the request by leaving that parameter blank.

Sending an email is not a mandatory field, but it will help you to track User usage.

<mark style="color:green;">`POST`</mark> `https://api.vagon.io/app-stream-management/v2/users`

Creates Visitor information to monitor their Streams usages

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

#### Request Body

| Name  | Type                 | Description                                               |
| ----- | -------------------- | --------------------------------------------------------- |
| email | <visitor@vendor.com> | Email address of the user, who will connect to the Stream |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "7D4F4EA7F4",
  "type": "user",
  "attributes": {
    "email": "team@vagon.io"
  },
  "client_code": 200,
  "timestamp": "2024-03-27T11:18:26Z"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```json
{
  "message": "Parameter must match email format",
  "client_code": 400,
  "timestamp": "2024-03-27T11:19:06Z"
}
```

{% endtab %}
{% endtabs %}

## **Remove User**

<mark style="color:red;">`DELETE`</mark> `https://api.vagon.io/app-stream-management/v2/users/{user_id}`

Delete a previously created Visitor record

#### Path Parameters

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| user\_id | String |             |

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "client_code": 200,
  "timestamp": "2024-03-27T11:20:09Z"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}
{% endtabs %}

## **Stream Machine Stats**

<mark style="color:blue;">`GET`</mark> `https://api.vagon.io/app-stream-management/v2/machines`

Retrieve all running and previously active Stream Machines with stats

#### Query Parameters

| Name            | Type                   | Description                            |
| --------------- | ---------------------- | -------------------------------------- |
| start\_at       | yyyy-MM-dd'T'HH:mm:ssZ | ***Sample:*** 2023-09-15T06:42:36.564Z |
| end\_at         | yyyy-MM-dd'T'HH:mm:ssZ | ***Sample:*** 2023-09-15T06:42:36.564Z |
| page            | Integer                | ***Default:*** 1                       |
| per\_page       | Integer                | ***Default:*** 20                      |
| application\_id | Integer                |                                        |
| stream\_id      | Integer                |                                        |

#### Headers

| Name                                            | Type                                       | Description |
| ----------------------------------------------- | ------------------------------------------ | ----------- |
| Content-Type<mark style="color:red;">\*</mark>  | application/json                           |             |
| Authorization<mark style="color:red;">\*</mark> | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "machines": [
    {
      "id": "94688",
      "type": "machine",
      "attributes": {
        "start_at": "2024-03-27T11:05:42.144Z",
        "end_at": "2024-03-27T11:10:29.548Z",
        "status": "stopped",
        "friendly_status": "off",
        "connection_status": "terminated",
        "region": "dublin",
        "uid": "bf96fb3b-edc3-43ce-8dc5-b8477fd52303",
        "cost": "0.13",
        "duration": 287,
        "application_name": "Test Application",
        "application_id": 1143,
        "stream_id": 1381,
        "stream_name": "Stream #1381",
        "machine_type": "Pro - G2",
        "public_ip_address": null
      }
    }
  ],
  "count": 6,
  "page": 1,
  "client_code": 200,
  "timestamp": "2024-03-27T11:21:44Z"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

```
// Returns when application_id and stream_id are requested at the same time
```

{% endtab %}
{% endtabs %}

## **Single Stream Machine Stats**

<mark style="color:blue;">`GET`</mark> `https://api.vagon.io/app-stream-management/v2/machines/{machine_uid}`

Retrieve a specific Stream Machines with stats.

#### Headers

| Name                                            | Type                                       | Description |
| ----------------------------------------------- | ------------------------------------------ | ----------- |
| Content-Type<mark style="color:red;">\*</mark>  | application/json                           |             |
| Authorization<mark style="color:red;">\*</mark> | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "94688",
  "type": "machine",
  "attributes": {
    "start_at": "2024-03-27T11:05:42.144Z",
    "end_at": "2024-03-27T11:10:29.548Z",
    "status": "stopped",
    "friendly_status": "off",
    "connection_status": "terminated",
    "region": "dublin",
    "uid": "bf96fb3b-edc3-43ce-8dc5-b8477fd52303",
    "cost": "0.13",
    "duration": 287,
    "application_name": "Test Application",
    "application_id": 1143,
    "stream_id": 1381,
    "stream_name": "Stream #1381",
    "machine_type": "Pro - G2",
    "public_ip_address": null
  },
  "client_code": 200,
  "timestamp": "2024-03-27T11:21:44Z"
}
```

{% endtab %}
{% endtabs %}

## **Visitor Session Stats**

<mark style="color:blue;">`GET`</mark> `https://api.vagon.io/app-stream-management/v2/sessions`

Retrieve all Visitor Sessions with additional stats

#### Query Parameters

| Name            | Type                   | Description                            |
| --------------- | ---------------------- | -------------------------------------- |
| start\_at       | yyyy-MM-dd'T'HH:mm:ssZ | ***Sample:*** 2023-09-15T06:42:36.564Z |
| end\_at         | yyyy-MM-dd'T'HH:mm:ssZ | ***Sample:*** 2023-09-15T06:42:36.564Z |
| page            | Integer                | ***Default:*** 1                       |
| per\_page       | Integer                | ***Default:*** 20                      |
| application\_id | Integer                |                                        |
| stream\_id      | Integer                |                                        |

#### Headers

| Name                                            | Type                                       | Description |
| ----------------------------------------------- | ------------------------------------------ | ----------- |
| Content-Type<mark style="color:red;">\*</mark>  | application/json                           |             |
| Authorization<mark style="color:red;">\*</mark> | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "sessions": [
    {
      "id": "9150",
      "type": "vendor_customer_session",
      "attributes": {
        "start_at": "2024-03-11T08:03:47.735Z",
        "end_at": "2024-03-11T08:07:17.645Z",
        "region": "dublin",
        "ping": 98,
        "audio_state": "muted",
        "audio_input": {
          "kind": "audioinput",
          "label": "",
          "groupId": "",
          "deviceId": "default"
        },
        "audio_output": {
          "kind": "audiooutput",
          "label": "",
          "groupId": "",
          "deviceId": "default"
        },
        "duration": 4,
        "readable_duration": "4 minutes",
        "city": null,
        "country": null,
        "os": null,
        "device_type": null,
        "customer": "CUS_9150",
        "application_name": "Test Application",
        "application_id": 1143,
        "stream_id": 1369,
        "stream_name": "Stream #1369",
        "machine_type": "Pro - G2"
      }
    }
  ],
  "count": 23,
  "page": 1,
  "next_page": 2,
  "client_code": 200,
  "timestamp": "2024-03-27T11:25:44Z"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}

{% tab title="400: Bad Request" %}

```
// Returns when application_id and stream_id are requested at the same time
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th>Attributes</th><th width="283.3333333333333">Values</th><th>Description</th></tr></thead><tbody><tr><td>start_at</td><td>2023-09-14T14:00:39.834Z</td><td></td></tr><tr><td>end_at</td><td>2023-09-14T14:03:09.894Z</td><td></td></tr><tr><td>region</td><td>dublin</td><td></td></tr><tr><td>ping</td><td>78.625</td><td></td></tr><tr><td>audio_state</td><td><code>muted</code> <br><code>playing</code> <br><code>not_collected</code> </td><td></td></tr><tr><td>audio_input</td><td><pre class="language-json"><code class="lang-json">{
  "kind": "audioinput",
  "label": "",
  "groupId": "",
  "deviceId": ""
}
</code></pre></td><td></td></tr><tr><td>audio_output</td><td><pre class="language-json"><code class="lang-json">{
  "kind": "audioinput",
  "label": "",
  "groupId": "",
  "deviceId": ""
}
</code></pre></td><td></td></tr><tr><td>duration</td><td>3</td><td>minutes</td></tr><tr><td>readable_duration</td><td>3 minutes</td><td></td></tr><tr><td>city</td><td>San Francisco</td><td><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> Data Collection must be enabled</td></tr><tr><td>country</td><td>US</td><td><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> Data Collection must be enabled</td></tr><tr><td>os</td><td>Windows 11</td><td><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> Data Collection must be enabled</td></tr><tr><td>device_type</td><td>desktop</td><td><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> Data Collection must be enabled</td></tr><tr><td>customer</td><td>CUS_625289</td><td><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> Email Collection must be enabled for Visitor Email address</td></tr><tr><td>application_name</td><td>AwesomeApp</td><td></td></tr><tr><td>application_id</td><td>870</td><td></td></tr><tr><td>stream_id</td><td>587</td><td></td></tr><tr><td>stream_name</td><td>Stream #587</td><td></td></tr><tr><td>machine_type</td><td>Pro - G2</td><td></td></tr></tbody></table>

## **Configure Application Settings**

<mark style="color:orange;">`PUT`</mark> `https://api.vagon.io/app-stream-management/v2/applications/{application_id}`

Configure existing application settings.

#### Path Parameters

| Name            | Type   | Description |
| --------------- | ------ | ----------- |
| application\_id | String |             |

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

#### Request Body

| Name                     | Type    | Options                                                                                                                           |
| ------------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
| application\_name        | String  |                                                                                                                                   |
| key\_mapping\_selection  | String  | `click` `game_mode`                                                                                                               |
| changeable\_key\_mapping | Boolean |                                                                                                                                   |
| machine\_type\_id        | Integer | <p><code>Starter - 9</code> </p><p><code>Pro - 17</code> </p><p><code>Starter G2 - 12</code> </p><p><code>Pro G2 - 13</code> </p> |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "1143",
  "type": "application",
  "attributes": {
    "id": 1143,
    "name": "Test Application",
    "status": "active",
    "banner_url": null,
    "logo_url": null,
    "friendly_status": "live",
    "os": "windows",
    "active_executable": {
      "id": "1222",
      "type": "executable",
      "attributes": {
        "executable_name": "Application",
        "launch_arguments": null,
        "restart_arguments": null,
        "file": "Application.zip",
        "version": 1,
        "active": true,
        "created_at": "2024-03-07T14:40:26.896Z",
        "images": []
      }
    },
    "performance": "Pro - G2",
    "enterprise": null,
    "pro": null
  },
  "client_code": 200,
  "timestamp": "2024-03-27T11:35:18Z"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
  "message": "Not Found",
  "client_code": 404,
  "timestamp": "2024-03-27T11:37:44Z"
}
```

{% endtab %}
{% endtabs %}

## **Configure Stream Settings**

<mark style="color:orange;">`PUT`</mark> `https://api.vagon.io/app-stream-management/v2/streams/{stream_id}`

Configure existing Stream settings.

#### Path Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| stream\_id | String |             |

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

#### Request Body

<table><thead><tr><th width="266">Name</th><th width="252">Type</th><th>Options</th></tr></thead><tbody><tr><td>resolution</td><td>String</td><td><code>res_scale</code> <code>res_720p</code>  <code>res_1080p</code>  <code>res_2160p</code> </td></tr><tr><td>name</td><td>String</td><td></td></tr><tr><td>sound</td><td>String</td><td><code>off</code> <code>activate_on_start</code> <code>user_can_activate</code></td></tr><tr><td>microphone</td><td>String</td><td><code>off</code> <code>activate_on_start</code> <code>user_can_activate</code></td></tr><tr><td>auto_turn_off_duration</td><td>String</td><td><code>off</code> <code>immediately</code> <code>2_min</code> <code>5_min</code> <code>30_min</code> <code>1_hour</code> <code>3_hour</code> <code>6_hour</code></td></tr><tr><td>maximum_session_duration</td><td>String</td><td><code>off</code> <code>5_min</code> <code>10_min</code> <code>15_min</code> <code>30_min</code> <code>1_hour</code></td></tr><tr><td>idle_duration</td><td>String</td><td><code>off</code> <code>1_min</code> <code>5_min</code> <code>10_min</code></td></tr><tr><td>launch_arguments</td><td>String</td><td></td></tr><tr><td>dark_mode</td><td>Boolean</td><td></td></tr><tr><td>collect_info</td><td>Boolean</td><td></td></tr><tr><td>password</td><td>String</td><td></td></tr><tr><td>password_protection</td><td>String</td><td></td></tr><tr><td>dock_position</td><td>String</td><td><code>hide</code> <code>bottom</code> <code>top</code> <code>left</code></td></tr><tr><td>keyboard_layout</td><td>String</td><td></td></tr><tr><td>user_session_data</td><td>Boolean</td><td></td></tr><tr><td>boost_enabled</td><td>Boolean</td><td></td></tr><tr><td>pixel_streaming_enabled</td><td>Boolean</td><td></td></tr><tr><td>port_access_enabled</td><td>Boolean</td><td></td></tr><tr><td>capacity_type</td><td>String</td><td><code>on_demand</code> <code>balanced</code> <code>always_on</code></td></tr><tr><td>capacities</td><td>Array of Objects</td><td><pre><code>[
  {
    "region": "dublin",
    "total_capacity": "5"
  }
]
</code></pre></td></tr><tr><td>restart_application</td><td>Boolean</td><td></td></tr><tr><td>auto_start_application</td><td>Boolean</td><td></td></tr><tr><td>collect_application_logs</td><td>Boolean</td><td></td></tr><tr><td>game_engine</td><td>String</td><td><code>unreal</code> <code>unity</code></td></tr><tr><td>project_name</td><td>String</td><td>Required for Unreal Engine Apps</td></tr><tr><td>company_name</td><td>String</td><td>Required for Unity Apps</td></tr><tr><td>product_name</td><td>String</td><td>Required for Unity Apps</td></tr><tr><td>region_optimization</td><td>Boolean</td><td></td></tr><tr><td>show_play_page</td><td>Boolean</td><td></td></tr><tr><td>vispr3_streaming</td><td>Boolean</td><td></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "1364",
  "type": "stream",
  "attributes": {
    "id": 1364,
    "name": "Stream Name",
    "status": "active",
    "uid": "57f01de3-910a-aa25-2055-cf4a6aef093c",
    "resolution": "res_1080p",
    "collect_info": false,
    "dark_mode": null,
    "password_protection": false,
    "sound": "user_can_activate",
    "microphone": "off",
    "launch_arguments": null,
    "dock_position": "bottom",
    "keyboard_layout": null,
    "user_session_data": false,
    "boost_enabled": false,
    "pixel_streaming_enabled": false,
    "port_access_enabled": false,
    "maximum_session_duration": "off",
    "idle_duration": "off",
    "auto_turn_off_duration": "5_min",
    "restart_application": false,
    "auto_start_application": true,
    "collect_application_logs": true,
    "game_engine": "unity",
    "project_name": "project_name",
    "company_name": "company_name",
    "product_name": "product_name",
    "region_optimization": true,
    "show_play_page": false
    "application": {
      "id": "1151",
      "type": "application",
      "attributes": {
        "id": 1151,
        "name": "Test Application",
        "status": "active",
        "banner_url": null,
        "logo_url": null,
        "friendly_status": "live",
        "os": "windows",
        "active_executable": {
          "id": "1230",
          "type": "executable",
          "attributes": {
            "executable_name": "Application",
            "launch_arguments": null,
            "restart_arguments": null,
            "file": "Application.zip",
            "version": 1,
            "active": true,
            "created_at": "2024-03-08T11:56:45.103Z",
            "images": []
          }
        },
        "performance": "Starter",
        "enterprise": null,
        "pro": null
      }
    },
    "in_active_time_range": true
  },
  "client_code": 200,
  "timestamp": "2024-03-27T09:24:35Z"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
  "message": "Not Found",
  "client_code": 404,
  "timestamp": "2024-03-27T11:37:44Z"
}
```

{% endtab %}
{% endtabs %}

## **Stream Configurations**

<mark style="color:blue;">`GET`</mark> `https://api.vagon.io/app-stream-management/v2/streams/{{stream_uid}}`

Retrieve most recent Stream configurations.

#### Path Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| stream\_uid | String |             |

Headers

| Name                                            | Type                                       | Description |
| ----------------------------------------------- | ------------------------------------------ | ----------- |
| Content-Type<mark style="color:red;">\*</mark>  | application/json                           |             |
| Authorization<mark style="color:red;">\*</mark> | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "1384",
  "type": "stream",
  "attributes": {
    "id": 1384,
    "status": "active",
    "uid": "75313492-95a9-4acd-82d1-f20a154d8d3c",
    "resolution": "res_1080p",
    "collect_info": false,
    "dark_mode": null,
    "password_protection": false,
    "sound": "user_can_activate",
    "microphone": "user_can_activate",
    "launch_arguments": null,
    "dock_position": "bottom",
    "keyboard_layout": null,
    "user_session_data": false,
    "boost_enabled": false,
    "pixel_streaming_enabled": false,
    "port_access_enabled": false,
    "maximum_session_duration": "off",
    "idle_duration": "off",
    "auto_turn_off_duration": "5_min",
    "capacities": [
      {
        "id": "dublin",
        "type": "vendor_capacity",
        "attributes": {
          "region": "dublin",
          "machine_type_id": 11,
          "capacity_type": "on_demand",
          "reserve_capacity": 0,
          "total_capacity": 10,
          "used_capacity": 1,
          "assignable_machine_count": 0
        }
      }
    ],
    "texts": {
      "initializing_text": "Initializing Stream",
      "session_expired_text": "Session expired, you can reconnect again.",
      "invalid_email_text": "Visitor information is invalid, contact your system admin.",
      "invalid_password_text": "Stream password is incorrect.\nCheck the password or contact your system admin.",
      "not_active_text": "Stream is not active at the moment.\nContact your system admin to check availability.",
      "reconnect_text": "Connection expired, you can reconnect again.",
      "queue_text": "Waiting in queue",
      "installing_application_text": "Installing Application",
      "connecting_text": "Connecting...",
      "idle_text": "Connection expired due to inactivity. \nYou can reconnect again."
    },
    "application": {
      "id": "1144",
      "type": "application",
      "attributes": {
        "id": 1144,
        "name": "Test Application",
        "status": "active",
        "banner_url": null,
        "logo_url": null,
        "friendly_status": "live",
        "os": "windows",
        "active_executable": {
          "id": "1223",
          "type": "executable",
          "attributes": {
            "executable_name": "Application",
            "launch_arguments": null,
            "restart_arguments": null,
            "file": "Application.zip",
            "version": 1,
            "active": true,
            "created_at": "2024-03-07T14:41:13.719Z",
            "images": []
          }
        },
        "performance": "Starter",
        "enterprise": null,
        "pro": null
      }
    },
    "in_active_time_range": true
  },
  "client_code": 200,
  "timestamp": "2024-03-27T13:24:19Z"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
  "message": "Not Found",
  "client_code": 404,
  "timestamp": "2024-03-27T11:37:44Z"
}
```

{% endtab %}
{% endtabs %}

## **Create Stream**

<mark style="color:green;">`POST`</mark> `https://api.vagon.io/app-stream-management/v2/streams`

Creates Stream with provided configurations.

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

#### Request Body

<table><thead><tr><th width="249">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>application_id</td><td>String</td><td></td></tr><tr><td>capacities</td><td>Array of Objects</td><td><pre><code>[
  {
    "region": "dublin",
    "total_capacity": "5"
  }
]
</code></pre></td></tr><tr><td>capacity_type</td><td>String</td><td><code>on_demand</code> <code>balanced</code> <code>always_on</code></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "1385",
  "type": "stream",
  "attributes": {
    "id": 1385,
    "status": "active",
    "uid": "4c3771e7-a875-40aa-b5ea-bbb2a429a34e",
    "resolution": "res_1080p",
    "collect_info": false,
    "dark_mode": null,
    "password_protection": false,
    "sound": "user_can_activate",
    "microphone": "user_can_activate",
    "launch_arguments": null,
    "dock_position": "bottom",
    "keyboard_layout": null,
    "user_session_data": false,
    "boost_enabled": false,
    "pixel_streaming_enabled": false,
    "port_access_enabled": false,
    "maximum_session_duration": "off",
    "idle_duration": "off",
    "auto_turn_off_duration": "5_min",
    "capacities": [
      {
        "id": "dublin",
        "type": "vendor_capacity",
        "attributes": {
          "region": "dublin",
          "machine_type_id": 11,
          "capacity_type": "on_demand",
          "reserve_capacity": 0,
          "total_capacity": 5,
          "used_capacity": 0,
          "assignable_machine_count": 0
        }
      }
    ],
    "texts": {
      "initializing_text": "Initializing Stream",
      "session_expired_text": "Session expired, you can reconnect again.",
      "invalid_email_text": "Visitor information is invalid, contact your system admin.",
      "invalid_password_text": "Stream password is incorrect.\nCheck the password or contact your system admin.",
      "not_active_text": "Stream is not active at the moment.\nContact your system admin to check availability.",
      "reconnect_text": "Connection expired, you can reconnect again.",
      "queue_text": "Waiting in queue",
      "installing_application_text": "Installing Application",
      "connecting_text": "Connecting...",
      "idle_text": "Connection expired due to inactivity. \nYou can reconnect again."
    },
    "application": {
      "id": "1144",
      "type": "application",
      "attributes": {
        "id": 1144,
        "name": "Test Application",
        "status": "active",
        "banner_url": null,
        "logo_url": null,
        "friendly_status": "live",
        "os": "windows",
        "active_executable": {
          "id": "1223",
          "type": "executable",
          "attributes": {
            "executable_name": "Application",
            "launch_arguments": null,
            "restart_arguments": null,
            "file": "Application.zip",
            "version": 1,
            "active": true,
            "created_at": "2024-03-07T14:41:13.719Z",
            "images": []
          }
        },
        "performance": "Starter",
        "enterprise": null,
        "pro": null
      }
    },
    "in_active_time_range": true
  },
  "client_code": 200,
  "timestamp": "2024-03-27T13:27:54Z"
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "message": "Not Found",
  "client_code": 404,
  "timestamp": "2024-03-27T11:37:44Z"
}
```

{% endtab %}
{% endtabs %}

## **Delete Stream**

#### Delete Stream

<mark style="color:red;">`DELETE`</mark> `https://api.vagon.io/app-stream-management/v2/streams/{stream_id}`

Delete a previously created Stream

#### Path Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| stream\_id | String |             |

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "client_code": 200,
  "timestamp": "2024-03-27T11:20:09Z"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
  "message": "Not Found",
  "client_code": 404,
  "timestamp": "2024-03-27T11:37:44Z"
}
```

{% endtab %}
{% endtabs %}

## **Activate Stream**

<mark style="color:orange;">`PUT`</mark> `https://api.vagon.io/app-stream-management/v2/streams/{stream_id}/activate`

Activate / run an existing Stream to make it available.

#### Path Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| stream\_id | String |             |

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "1384",
  "type": "stream",
  "attributes": {
    "id": 1384,
    "status": "active",
    "uid": "75313492-95a9-4acd-82d1-f20a154d8d3c",
    "resolution": "res_1080p",
    "collect_info": false,
    "dark_mode": null,
    "password_protection": false,
    "sound": "user_can_activate",
    "microphone": "user_can_activate",
    "launch_arguments": null,
    "dock_position": "bottom",
    "keyboard_layout": null,
    "user_session_data": false,
    "boost_enabled": false,
    "pixel_streaming_enabled": false,
    "port_access_enabled": false,
    "maximum_session_duration": "off",
    "idle_duration": "off",
    "auto_turn_off_duration": "5_min",
    "capacities": [
      {
        "id": "dublin",
        "type": "vendor_capacity",
        "attributes": {
          "region": "dublin",
          "machine_type_id": 11,
          "capacity_type": "on_demand",
          "reserve_capacity": 0,
          "total_capacity": 10,
          "used_capacity": 1,
          "assignable_machine_count": 0
        }
      }
    ],
    "texts": {
      "initializing_text": "Initializing Stream",
      "session_expired_text": "Session expired, you can reconnect again.",
      "invalid_email_text": "Visitor information is invalid, contact your system admin.",
      "invalid_password_text": "Stream password is incorrect.\nCheck the password or contact your system admin.",
      "not_active_text": "Stream is not active at the moment.\nContact your system admin to check availability.",
      "reconnect_text": "Connection expired, you can reconnect again.",
      "queue_text": "Waiting in queue",
      "installing_application_text": "Installing Application",
      "connecting_text": "Connecting...",
      "idle_text": "Connection expired due to inactivity. \nYou can reconnect again."
    },
    "application": {
      "id": "1144",
      "type": "application",
      "attributes": {
        "id": 1144,
        "name": "Test Application",
        "status": "active",
        "banner_url": null,
        "logo_url": null,
        "friendly_status": "live",
        "os": "windows",
        "active_executable": {
          "id": "1223",
          "type": "executable",
          "attributes": {
            "executable_name": "Application",
            "launch_arguments": null,
            "restart_arguments": null,
            "file": "Application.zip",
            "version": 1,
            "active": true,
            "created_at": "2024-03-07T14:41:13.719Z",
            "images": []
          }
        },
        "performance": "Starter",
        "enterprise": null,
        "pro": null
      }
    },
    "in_active_time_range": true
  },
  "client_code": 200,
  "timestamp": "2024-03-27T13:29:21Z"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

{% endtab %}
{% endtabs %}

## **Pause Stream**

<mark style="color:orange;">`PUT`</mark> `https://api.vagon.io/app-stream-management/v2/streams/{stream_id}/pause`

Pause / stop an existing Stream to make it unavailable.

#### Path Parameters

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| stream\_id | String |             |

#### Headers

| Name          | Type                                       | Description |
| ------------- | ------------------------------------------ | ----------- |
| Content-Type  | application/json                           |             |
| Authorization | HMAC {key}:{signature}:{nonce}:{timestamp} |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "id": "1384",
  "type": "stream",
  "attributes": {
    "id": 1384,
    "status": "paused",
    "uid": "75313492-95a9-4acd-82d1-f20a154d8d3c",
    "resolution": "res_1080p",
    "collect_info": false,
    "dark_mode": null,
    "password_protection": false,
    "sound": "user_can_activate",
    "microphone": "user_can_activate",
    "launch_arguments": null,
    "dock_position": "bottom",
    "keyboard_layout": null,
    "user_session_data": false,
    "boost_enabled": false,
    "pixel_streaming_enabled": false,
    "port_access_enabled": false,
    "maximum_session_duration": "off",
    "idle_duration": "off",
    "auto_turn_off_duration": "5_min",
    "capacities": [
      {
        "id": "dublin",
        "type": "vendor_capacity",
        "attributes": {
          "region": "dublin",
          "machine_type_id": 11,
          "capacity_type": "on_demand",
          "reserve_capacity": 0,
          "total_capacity": 10,
          "used_capacity": 1,
          "assignable_machine_count": 0
        }
      }
    ],
    "texts": {
      "initializing_text": "Initializing Stream",
      "session_expired_text": "Session expired, you can reconnect again.",
      "invalid_email_text": "Visitor information is invalid, contact your system admin.",
      "invalid_password_text": "Stream password is incorrect.\nCheck the password or contact your system admin.",
      "not_active_text": "Stream is not active at the moment.\nContact your system admin to check availability.",
      "reconnect_text": "Connection expired, you can reconnect again.",
      "queue_text": "Waiting in queue",
      "installing_application_text": "Installing Application",
      "connecting_text": "Connecting...",
      "idle_text": "Connection expired due to inactivity. \nYou can reconnect again."
    },
    "application": {
      "id": "1144",
      "type": "application",
      "attributes": {
        "id": 1144,
        "name": "Test Application",
        "status": "active",
        "banner_url": null,
        "logo_url": null,
        "friendly_status": "live",
        "os": "windows",
        "active_executable": {
          "id": "1223",
          "type": "executable",
          "attributes": {
            "executable_name": "Application",
            "launch_arguments": null,
            "restart_arguments": null,
            "file": "Application.zip",
            "version": 1,
            "active": true,
            "created_at": "2024-03-07T14:41:13.719Z",
            "images": []
          }
        },
        "performance": "Starter",
        "enterprise": null,
        "pro": null
      }
    },
    "in_active_time_range": true
  },
  "client_code": 200,
  "timestamp": "2024-03-27T13:29:21Z"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

{% endtab %}
{% endtabs %}

## Vagon Pinger.js

Vagon Pinger allows you to find the best region to find the lowest latency location for a better experience for your `Visitors`.

Import VagonPinger to your project by adding the following code piece to your code. Then, use the `bestRegion` parameter value for `Start Streams` and/or `Assign Streams` endpoints.

```javascript
// Import the VagonPinger class
import VagonPinger from "https://app.vagon.io/helpers/VagonPinger.js";

// Ping all regions and log the results
VagonPinger.getRegionPings()
  .then(({ regionPings, bestRegion }) => {
    console.log("Region pings:", regionPings);
    console.log("Best region:", bestRegion);
  })


// Ping specific regions and log the results
VagonPinger.getRegionPings(["dublin", "frankfurt", "north_virginia"])
  .then(({ regionPings, bestRegion }) => {
    console.log("Region pings:", regionPings);
    console.log("Best region:", bestRegion);
  })
```
