Links

API Documentation

Applications
get
https://api.vagon.io/app-stream-management/v2
/applications
Applications
Streams
Streams endpoints allow you to manage your Stream Machines according to your custom workflow.
You have to create a Stream link from Vagon Dashboard to use Streams endpoints to manage your Streams Machines.
get
https://api.vagon.io/app-stream-management/v2
/streams
Streams
Stream Machines
get
https://api.vagon.io/app-stream-management/v2
/streams/{stream_id}/machines
Stream Machines
Stream Machine Status Details
Stream Machine Status
Details
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.
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.
Start Stream Machine
post
https://api.vagon.io/app-stream-management/v2
/streams/{stream_id}/start-machine
Start Stream Machine
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 4601 error from the endpoint.
Region Name
Parameter Value
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
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.
post
https://api.vagon.io/app-stream-management/v2
/streams/{stream_id}/assign-machine
Assign Streams Machine
Stop Stream Machine
post
https://api.vagon.io/app-stream-management/v2
/streams/stop-machine
Stop Stream Machine
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.
post
https://api.vagon.io/app-stream-management/v2
/users
Create User
Remove User
delete
https://api.vagon.io/app-stream-management/v2
/users/{user_id}
Remove User
Stream Machine Stats
get
https://api.vagon.io/app-stream-management/v2
/machines
Stream Machine Stats
Visitor Session Stats
get
https://api.vagon.io/app-stream-management/v2
/sessions
Stream Session Stats
Attributes
Values
Description
start_at
2023-09-14T14:00:39.834Z
end_at
2023-09-14T14:03:09.894Z
region
dublin
ping
78.625
audio_state
muted - playing - not_collected -
audio_input
{
"kind": "audioinput",
"label": "",
"groupId": "",
"deviceId": ""
}
audio_output
{
"kind": "audioinput",
"label": "",
"groupId": "",
"deviceId": ""
}
duration
3
minutes
readable_duration
3 minutes
city
San Francisco
⚠️
Data Collection must be enabled
country
US
⚠️
Data Collection must be enabled
os
Windows 11
⚠️
Data Collection must be enabled
device_type
desktop
⚠️
Data Collection must be enabled
customer
CUS_625289
⚠️
Email Collection must be enabled for Visitor Email address
application_name
AwesomeApp
application_id
870
stream_id
587
stream_name
Stream #587
machine_type
Starter
Configure Application Settings
put
https://api.vagon.io/app-stream-management/v2
/applications/{application_id}
Configure Application Settings
Configure Stream Settings
put
https://api.vagon.io/app-stream-management/v2
/streams/{stream_id}
Configure Stream

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 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);
})