Sessions
Bash in a browser: its live screen, a voice call, or the whole of Bash inside your app.
GET/v1/users/{user_id}/screenshotThe latest frame of the user's browser, as a JPEG.
409 browser_in_use while a person finishes a sign-in on it (a browser fetch with front open): its page is for them alone. 409 payment_in_progress while the person pays for something in their browser, or just after.
Request1 field
Path
user_idstringrequiredYour own id for the user, as you named them.
- Type
string
Answers 200
const frame = await vestra.user('traveller-42').screenshot();frame = vestra.user("traveller-42").screenshot()# Watch the screen live. Create a session with a screen to watch, and open its url in a browser tab or an iframe.curl "$VESTRA_BASE_URL/v1/sessions" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "user_id": "traveller-42", "screen": "view" }' # Let a person take control. In a session opened with "screen": "control", the person can take over from Bash,# using the session's own token.curl "$VESTRA_BASE_URL/v1/sessions/ses_8h2/screen" \ -H "Authorization: Bearer $SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "action": "take" }' # Take a screenshot. You get the latest frame of the user's browser as a JPEG.curl "$VESTRA_BASE_URL/v1/users/traveller-42/screenshot" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -o screen.jpg{ "method": "tools/call", "params": { "name": "watch", "arguments": { "user": "traveller-42", "control": true } }}No sample in your language for this route, so here it is over HTTP.
# Watch the screen live. Create a session with a screen to watch, and open its url in a browser tab or an iframe.curl "$VESTRA_BASE_URL/v1/sessions" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "user_id": "traveller-42", "screen": "view" }' # Let a person take control. In a session opened with "screen": "control", the person can take over from Bash,# using the session's own token.curl "$VESTRA_BASE_URL/v1/sessions/ses_8h2/screen" \ -H "Authorization: Bearer $SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "action": "take" }' # Take a screenshot. You get the latest frame of the user's browser as a JPEG.curl "$VESTRA_BASE_URL/v1/users/traveller-42/screenshot" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -o screen.jpg