Skip to main content
Version: Community (1.0.0)

API Overview

WebXTerm Community Edition v1.0.0 provides a RESTful API for integrating with your applications and automating machine management. All requests go to the machine backend directly.

Base URL

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

Authentication

All API requests (except signup/login) require a JWT Bearer token:

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

Getting a Token

  1. Login via POST /api/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
401Unauthorized
403Forbidden
404Not Found
409Conflict
500Internal Server Error

Complete Endpoint Reference

Authentication (Public)

MethodEndpointDescription
POST/api/signupCreate new account
POST/api/loginLogin and get JWT token
POST/api/auth/refreshRefresh JWT token

Machines (Protected)

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)

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)

MethodEndpointDescription
GET/api/dashboard/statsOverview statistics
GET/api/dashboard/recent-machinesLast 5 active machines
GET/api/dashboard/recent-activityLast 10 command activities

Profile (Protected)

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

Users (Protected, admin only)

MethodEndpointDescription
GET/api/usersList all users (admin only)

Community (Protected)

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

Health (Public)

MethodEndpointDescription
GET/healthHealth check — no auth required

WebSocket Terminal

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

API Sections