Skip to main content
Version: 1.1.0

API Overview

VSAY Terminal provides a RESTful API for integrating with your applications and automating machine management.

Base URL

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

Authentication

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

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

Getting a Token

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

Response Format

Successful responses:

{
"message": "Success",
"data": { ... }
}

Error responses:

{
"error": "Error message here"
}

HTTP Status Codes

CodeDescription
200Success
201Created
400Bad Request
401Unauthorized
404Not Found
500Internal Server Error

Available Endpoints

Authentication (Public)

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

Machines (Protected)

MethodEndpointDescription
GET/api/machinesList all machines
GET/api/machines/:agent_idGet machine details
GET/api/machines/:agent_id/logsGet command logs
POST/api/machines/:agent_id/commandExecute command
DELETE/api/machines/:agent_idDelete machine

Dashboard (Protected)

MethodEndpointDescription
GET/api/dashboard/statsGet statistics
GET/api/dashboard/recent-machinesRecent machines
GET/api/dashboard/recent-activityRecent activity

Profile (Protected)

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

Terminal Sessions (Protected)

MethodEndpointDescription
GET/api/terminal/sessionsList active sessions
DELETE/api/terminal/sessions/:idClose session
WS/api/terminal/:agent_id/wsWebSocket terminal

WebSocket Terminal

For real-time terminal access:

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

API Sections