Base URL
All API endpoints are prefixed with:API Structure
The suSHi API is organized into the following sections:- Authentication - OAuth 2.0 endpoints for Google and GitHub login
- Machines - CRUD operations for SSH machine management
- SSH WebSocket - Real-time SSH terminal connections
Response Format
All API responses follow a consistent JSON structure:HTTP status text (e.g., “OK”, “Bad Request”, “Internal Server Error”)
Human-readable message describing the result
Response payload (structure varies by endpoint)
Authentication
Most endpoints require JWT authentication. After completing the OAuth flow, you’ll receive a JWT token in a cookie namedjwt.
Protected Endpoints
All endpoints under/api/v1/* (except /api/v1/auth/*) require authentication via JWT token.
The JWT token must be included as a cookie:
Public Endpoints
The following endpoints do NOT require authentication:GET /api/v1/auth/url- Get OAuth authorization URLGET /api/v1/auth/callback- OAuth callback handlerGET /api/v1/auth/logout- Logout endpoint
Error Responses
Error responses use standard HTTP status codes:| Status Code | Description |
|---|---|
| 400 | Bad Request - Missing or invalid parameters |
| 401 | Unauthorized - Invalid or missing JWT token |
| 404 | Not Found - Resource not found |
| 500 | Internal Server Error - Server-side error |