Sessions
Bash in a browser: its live screen, a voice call, or the whole of Bash inside your app.
GET/v1/sessions/{session_id}Whether a session is still open, and what it was opened with.
Your key, or the session's own token.
Request1 field
Path
session_idstringrequiredThe session's id (ses_...).
- Type
string
Answers 20011 fields
idstringThe session (ses_...).
- Example
ses_8h2
object"session"Always session.
- Type
"session"
user_idstring | nullYour id for its user; null on your company's own Bash.
- Type
string | null
conversation_idstring | nullIts conversation (conv_...); null for a screen opened alone.
- Type
string | null
chatbooleanWhether it shows the conversation.
- Type
boolean
screenfalse | "view" | "control"Its screen: view, control, or false for none.
- Type
false | "view" | "control"
voicebooleanWhether your user can talk by voice.
- Type
boolean
memorybooleanWhether it shows what Bash remembers.
- Type
boolean
expires_atstringWhen the token stops working, 15 minutes after it was made, as an ISO 8601 time.
- Type
string
status"live" | "expired" | "revoked"live: its token works. expired: its 15 minutes are up. revoked: it was ended early.
- Type
"live" | "expired" | "revoked"
screen_pausedtruemay be absentA view-only screen while it is private: a person signs in on that computer (a browser fetch with front, a hand-off), or a private fetch runs or keeps its tab. Nothing shows, and GET /v1/sessions/{session_id}/screen answers 409 browser_in_use, until it is done. Absent otherwise.
- Type
true
const session = await vestra.sessions.get('ses_8h2');session = vestra.sessions.get("ses_8h2")# Open a session on your server. Do this for the user signed in to your app. It gives them chat, approvals,# the live screen and voice. The response has a url and a token, valid for 15 minutes. Put the url in an# iframe with allow="microphone".curl "$VESTRA_BASE_URL/v1/sessions" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "user_id": "traveller-42", "chat": true, "screen": "view", "voice": true }' # Check the session. See whether it is still open.curl "$VESTRA_BASE_URL/v1/sessions/ses_8h2" \ -H "Authorization: Bearer $VESTRA_API_KEY" # End the session. Its token stops working at once.curl -X DELETE "$VESTRA_BASE_URL/v1/sessions/ses_8h2" \ -H "Authorization: Bearer $VESTRA_API_KEY"{ "method": "tools/call", "params": { "name": "embed", "arguments": { "user": "traveller-42", "memory": true } }}No sample in your language for this route, so here it is over HTTP.
# Open a session on your server. Do this for the user signed in to your app. It gives them chat, approvals,# the live screen and voice. The response has a url and a token, valid for 15 minutes. Put the url in an# iframe with allow="microphone".curl "$VESTRA_BASE_URL/v1/sessions" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "user_id": "traveller-42", "chat": true, "screen": "view", "voice": true }' # Check the session. See whether it is still open.curl "$VESTRA_BASE_URL/v1/sessions/ses_8h2" \ -H "Authorization: Bearer $VESTRA_API_KEY" # End the session. Its token stops working at once.curl -X DELETE "$VESTRA_BASE_URL/v1/sessions/ses_8h2" \ -H "Authorization: Bearer $VESTRA_API_KEY"