Skip to main content
Version: Enterprise (1.2.0)

API Overview

WebXTerm provides a RESTful API for integrating with your applications and automating machine management. The API is served by two services:

  • vsay-auth — handles all authentication, user management, groups, roles, admin, and audit; proxies all other requests to the machine backend
  • vsay-machine-backend — handles machines, terminals, sessions, dashboard, profile, and community

All requests go through a single base URL.

Base URL

https://your-webxterm-instance.com/api

Authentication

All API requests (except auth endpoints) require a JWT Bearer token issued by vsay-auth:

curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
https://your-webxterm-instance.com/api/machines

Getting a Token

  1. Login via POST /api/auth/login
  2. Use the returned token in the Authorization header
  3. Tokens expire after 24 hours — use POST /api/auth/refresh to renew

Response Format

Responses are flat JSON objects. Fields vary by endpoint.

Successful responses:

{
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": { ... }
}

Error responses:

{
"error": "Error message here"
}

HTTP Status Codes

CodeDescription
200Success
201Created
400Bad Request — missing or invalid fields
401Unauthorized — missing or expired token
403Forbidden — insufficient role/permissions
404Not Found
409Conflict — duplicate username/organization
500Internal Server Error

Complete Endpoint Reference

Authentication (Public — vsay-auth)

MethodEndpointDescription
POST/api/auth/signupCreate new account and organization
POST/api/auth/loginLogin — returns token, OTP challenge, or tenant selection
POST/api/auth/select-tenantSelect organization for multi-tenant accounts
POST/api/auth/verify-otpVerify email OTP and receive JWT (UI logins)
POST/api/auth/logoutLogout current session
POST/api/auth/refreshRefresh JWT token
GET/api/auth/oidc/microsoftInitiate Microsoft OIDC/OAuth2 login (Enterprise)
GET/api/auth/oidc/githubInitiate GitHub OIDC/OAuth2 login (Enterprise)

Machines (Protected — machine backend)

MethodEndpointDescription
GET/api/machinesList all machines
POST/api/machinesCreate pending machine (get registration token)
GET/api/machines/by-id/:machine_idGet machine by MongoDB ObjectID
GET/api/machines/:agent_idGet machine details
DELETE/api/machines/:agent_idDelete machine
POST/api/machines/:agent_id/commandExecute command on machine
GET/api/machines/:agent_id/logsGet command execution logs
GET/api/machines/:agent_id/logs/searchSearch command logs
GET/api/machines/:agent_id/sessionsGet all sessions for machine
GET/api/machines/:agent_id/sessions/activeGet active sessions for machine
GET/api/machines/:agent_id/access/usersList users with access
POST/api/machines/:agent_id/access/grantGrant user access
POST/api/machines/:agent_id/access/revokeRevoke user access

Terminal (Protected — machine backend)

MethodEndpointDescription
WS/api/terminal/:agent_id/wsWebSocket terminal connection
GET/api/terminal/sessionsList active terminal sessions
DELETE/api/terminal/sessions/:session_idClose a terminal session
GET/api/sessions/:session_idGet session details and command log

Dashboard (Protected — machine backend)

MethodEndpointDescription
GET/api/dashboard/statsOverview statistics (machines, CPU, memory, disk)
GET/api/dashboard/recent-machinesLast 5 active machines
GET/api/dashboard/recent-activityLast 10 command activities

Profile (Protected — machine backend)

MethodEndpointDescription
GET/api/profileGet current user profile
POST/api/profile/regenerate-api-keyGenerate new API key
POST/api/profile/reset-passwordChange password
POST/api/profile/upload-avatarUpdate profile avatar

Community (Protected — machine backend)

MethodEndpointDescription
GET/api/community/issuesList all issues
POST/api/community/issuesCreate new issue
GET/api/community/issues/:idGet issue details
PUT/api/community/issues/:idUpdate issue
DELETE/api/community/issues/:idDelete issue
GET/api/community/issues/:id/fixesList fixes for issue
POST/api/community/issues/:id/fixesPost a fix
POST/api/community/issues/:id/fixes/:fix_id/likeLike a fix
DELETE/api/community/issues/:id/fixes/:fix_id/likeRemove like
POST/api/community/issues/:id/fixes/:fix_id/acceptAccept fix as solution
POST/api/community/uploadUpload image attachment

Users (Protected — vsay-auth, Enterprise)

MethodEndpointDescription
GET/api/users/meGet current user profile
GET/api/usersList organization users (admin)
GET/api/users/:idGet user by ID
POST/api/usersCreate user (admin)
PUT/api/users/:idUpdate user (admin)
DELETE/api/users/:idDelete user (admin)
GET/api/users/:id/rolesGet user roles
POST/api/users/:id/rolesAssign user roles (admin)

Roles (Protected — vsay-auth, Enterprise)

MethodEndpointDescription
GET/api/rolesList all roles
GET/api/roles/portalList portal-level roles
GET/api/roles/machineList machine-level roles

Groups (Protected — vsay-auth, Enterprise)

MethodEndpointDescription
GET/api/groupsList all groups
GET/api/groups/:idGet group details
POST/api/groupsCreate group (admin)
PUT/api/groups/:idUpdate group (admin)
DELETE/api/groups/:idDelete group (admin)
GET/api/groups/:id/membersList group members
POST/api/groups/:id/membersAdd member (admin)
DELETE/api/groups/:id/membersRemove member (admin)
GET/api/groups/:id/machinesList group machines
POST/api/groups/:id/machinesAdd machines to group (admin)
DELETE/api/groups/:id/machines/:machine_idRemove machine from group (admin)

Audit (Protected — vsay-auth, Enterprise, company_admin+)

MethodEndpointDescription
GET/api/auditGet audit logs (filterable)
GET/api/audit/tenantsList tenants in audit scope

Admin — Organizations (Protected — vsay-auth, super_admin only)

MethodEndpointDescription
GET/api/admin/organizationsList all organizations
POST/api/admin/organizationsCreate organization
GET/api/admin/organizations/:idGet organization
PUT/api/admin/organizations/:idUpdate organization
DELETE/api/admin/organizations/:idDelete organization
GET/api/admin/organizations/:id/statsOrganization statistics
GET/api/admin/organizations/:id/usersList organization users
GET/api/admin/organizations/:id/groupsList organization groups

Health (Public)

MethodEndpointDescription
GET/healthHealth check — no auth required

WebSocket Terminal

For real-time terminal access, connect via WebSocket:

wss://your-webxterm-instance.com/api/terminal/:agent_id/ws?token=YOUR_JWT_TOKEN

API Reference Sections

  • Authentication — Login, signup, OTP, tenant selection, OIDC/OAuth2
  • Machines — Machine management and access control
  • Sessions — Terminal sessions and dashboard stats
  • Profile — User profile and API keys
  • Community — Issue tracker and fixes
  • Users & Roles — User management and role assignment (Enterprise)
  • Groups — Group management (Enterprise)
  • Admin — Organization administration (super admin)
  • Audit Logs — Audit log access (Enterprise)