Connectty provides a RESTful API for managing connections, credentials, and groups.
All API endpoints (except login/register) require a valid JWT token in the Authorization header:
Authorization: Bearer <your-jwt-token>
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/login |
Login with username/password |
POST |
/api/auth/register |
Register new user (local auth only) |
GET |
/api/auth/verify |
Verify JWT token validity |
POST /api/auth/login
{
"username": "admin",
"password": "your-password",
"domain": "CORP" // Optional, for AD authentication
}{
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "uuid",
"username": "admin",
"email": "admin@example.com"
}
}Manage SSH and RDP connections.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/connections |
List all connections |
GET |
/api/connections/:id |
Get single connection |
POST |
/api/connections |
Create connection |
PUT |
/api/connections/:id |
Update connection |
DELETE |
/api/connections/:id |
Delete connection |
{
"id": "uuid",
"name": "Production Server",
"hostname": "192.168.1.100",
"port": 22,
"connectionType": "ssh", // "ssh" | "rdp"
"osType": "linux", // "linux" | "windows" | "unix" | "esxi"
"username": "root",
"credentialId": "uuid",
"group": "uuid",
"tags": ["production", "web"],
"description": "Main web server",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}Manage authentication credentials.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/credentials |
List credentials (secrets masked) |
GET |
/api/credentials/:id |
Get single credential |
POST |
/api/credentials |
Create credential |
PUT |
/api/credentials/:id |
Update credential |
DELETE |
/api/credentials/:id |
Delete credential |
{
"id": "uuid",
"name": "Linux Root",
"type": "password", // "password" | "privateKey" | "domain" | "agent"
"username": "root",
"domain": "CORP", // For domain credentials
"secret": "********", // Masked in responses
"autoAssignGroup": "group-uuid", // Auto-assign to hosts imported into this group
"autoAssignPatterns": ["web-*", "*-prod-*"],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}| Type | Description | Required Fields |
|---|---|---|
password |
Username/password auth | username, secret |
privateKey |
SSH private key auth | username, privateKey, passphrase (optional) |
domain |
Windows domain auth | username, secret, domain |
agent |
SSH agent forwarding | username |
Organize connections into groups.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/groups |
List all groups |
POST |
/api/groups |
Create group |
PUT |
/api/groups/:id |
Update group |
DELETE |
/api/groups/:id |
Delete group |
{
"id": "uuid",
"name": "Production",
"description": "Production servers",
"parentId": "uuid", // For nested groups
"color": "#e94560",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}Synchronize data between desktop client and server.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/sync/push |
Push local data to server |
GET |
/api/sync/pull |
Pull data from server |
GET |
/api/sync/export |
Export data (JSON/CSV) |
POST /api/sync/push
{
"connections": [...],
"credentials": [...],
"groups": [...]
}GET /api/sync/export?format=json&includeCredentials=false
| Parameter | Type | Description |
|---|---|---|
format |
string | json or csv |
includeCredentials |
boolean | Include credentials in export |
Connect to /ws for real-time SSH terminal sessions.
{ "type": "auth", "token": "your-jwt-token" }{ "type": "connect", "connectionId": "uuid" }{ "type": "data", "sessionId": "uuid", "data": "ls -la\n" }{ "type": "resize", "sessionId": "uuid", "cols": 80, "rows": 24 }{ "type": "disconnect", "sessionId": "uuid" }// Data received
{ "type": "data", "sessionId": "uuid", "data": "output..." }
// Connection closed
{ "type": "close", "sessionId": "uuid", "code": 0 }
// Error occurred
{ "type": "error", "sessionId": "uuid", "message": "Connection refused" }All errors follow this format:
{
"error": "Error message",
"code": "ERROR_CODE",
"details": {} // Optional additional info
}| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED |
401 | Invalid or missing token |
FORBIDDEN |
403 | Insufficient permissions |
NOT_FOUND |
404 | Resource not found |
VALIDATION_ERROR |
400 | Invalid request data |
INTERNAL_ERROR |
500 | Server error |