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.
{"client_code":4603,"message":"Region must be activated","timestamp":"2024-03-27T10:56:06Z"}
{"client_code":4609,"message":"Stream is not active","timestamp":"2024-03-27T10:59:53Z"}
{"client_code":4610,"message":"Stream capacity management method must be Cost Optimized - on_demand","timestamp":"2024-03-27T10:57:19Z"}
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.
If you try to start a Stream Machine for Availability Optimized or Balanced streams, you will get a 4610 error from the endpoint.
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.
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.
{"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"}
{"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"}
Activate / run an existing Stream to make it available.
Path Parameters
Headers
{"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"}
Pause / stop an existing Stream to make it unavailable.
Path Parameters
Headers
{"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"}
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.
// Import the VagonPinger classimport VagonPinger from"https://app.vagon.io/helpers/VagonPinger.js";// Ping all regions and log the resultsVagonPinger.getRegionPings().then(({ regionPings, bestRegion }) => {console.log("Region pings:", regionPings);console.log("Best region:", bestRegion); })// Ping specific regions and log the resultsVagonPinger.getRegionPings(["dublin","frankfurt","north_virginia"]).then(({ regionPings, bestRegion }) => {console.log("Region pings:", regionPings);console.log("Best region:", bestRegion); })
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Stream Machine Status
Details
Name
Type
Description
Name
Type
Description
Name
Type
Description
Region Name
Parameter Value
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Attributes
Values
Description
Name
Type
Description
Name
Type
Description
Name
Type
Options
Name
Type
Description
Name
Type
Description
Name
Type
Options
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
page*
1
per_page*
100
Authorization*
HMAC {key}:{signature}:{nonce}:{timestamp}
Content-Type
application/json
page
1
per_page
100
application_id*
String
Content-Type
application/json
Authorization
HMAC {key}:{signature}:{nonce}:{timestamp}
stream_id*
String
page
1
per_page
10
Content-Type
application/json
Authorization*
HMAC {key}:{signature}:{nonce}:{timestamp}
waiting
Stream is still booting up and preparing for connection.
available
Stream is ready for assigning and then connecting.
assigned
Stream is assigned to a User, but not connected yet.
connected
Stream is connected, and there is an active session.
terminated
Stream is turned off, and terminated.
proxy-in-migration
Stream is getting ready for the next visitor.
stream_id*
String
Content-Type*
application/json
Authorization*
HMAC {key}:{signature}:{nonce}:{timestamp}
region*
String
Stream Machine Location
Dublin
dublin
North Virginia
north_virginia
Oregon
oregon
Ohio
ohio
Montreal
montreal
California
california
Sao Paolo
sao_paolo
Stockholm
stockholm
Frankfurt
frankfurt
Bahrain
bahrain
Mumbai
mumbai
Seoul
seoul
Tokyo
tokyo
Singapore
singapore
Sydney
sydney
Jakarta
jakarta
Dubai
uae
Cape Town
cape_town
Hong Kong
hong_kong
stream_id*
String
Content-Type*
application/json
Authorization
HMAC {key}:{signature}:{nonce}:{timestamp}
region*
String
user_id
String
user_id can be generated via Create Visitor endpoint
Content-Type*
application/json
Authorization*
HMAC {key}:{signature}:{nonce}:{timestamp}
machine_id*
String
Content-Type
application/json
Authorization
HMAC {key}:{signature}:{nonce}:{timestamp}
email
visitor@vendor.com
Email address of the user, who will connect to the Stream