Quick Start
1
Get Your API Token
Login to SSMS Web, click your username, select "API Token"
2
Enable Password Storage
Your connection profile must have "Remember Password" enabled
3
Make API Calls
Use the endpoint format below with your token and profile
https://ms.sqlcloud.space/API/{token}/{profile}/{database}/{command}
Authentication
| Parameter | Description |
|---|---|
{token} |
Your 16-character API token (e.g., WUUBQQKQ07KUSUHO) |
{profile} |
Connection profile name, URL encoded (e.g., Main%20Server) |
{database} |
Target database name (e.g., MyDatabase) |
Keep your API token secure. Anyone with your token can access your databases.
API Endpoints
GET
/API/{token}/health
Check API status and validate token
GET
/API/{token}/profiles
List available connection profiles
GET
/API/{token}/{profile}/databases
List all databases on the server
GET
/API/{token}/{profile}/{database}/tables
List tables in the database
GET
/API/{token}/{profile}/{database}/views
List views in the database
GET
/API/{token}/{profile}/{database}/procedures
List stored procedures
GET
/API/{token}/{profile}/{database}/functions
List functions
GET
/API/{token}/{profile}/{database}/columns/{schema}/{table}
Get table column definitions
GET
/API/{token}/{profile}/{database}/script/{type}/{schema}/{name}
Generate CREATE script (type: table, view, procedure, function)
GET
/API/{token}/{profile}/version
Get SQL Server version
POST
/API/{token}/ai
AI assistant — accessible only with your API token (billed to your AI token balance)
Execute Query
POST
/API/{token}/{profile}/{database}/execute
Execute any SQL command (DDL, DQL, DML, DCL, TCL)
Request Body
{
"query": "SELECT * FROM Users WHERE Active = 1"
}
Response
{
"success": true,
"resultSets": [{
"columns": ["Id", "Username", "Email"],
"rows": [{ "Id": 1, "Username": "john", ... }],
"rowCount": 1
}],
"rowsAffected": -1,
"executionTimeMs": 45
}
Supported Commands
| Type | Commands |
|---|---|
| DDL | CREATE ALTER DROP TRUNCATE |
| DQL | SELECT |
| DML | INSERT UPDATE DELETE MERGE |
| DCL | GRANT REVOKE DENY |
| TCL | BEGIN TRAN COMMIT ROLLBACK |
AI Assistant
POST
/API/{token}/ai
Ask the AI assistant. Access is only through your API token — there is no keyless AI access. Each response is billed to your AI token balance (set by your administrator).
Request Body
{
"message": "Write a query to list the top 10 customers by orders",
"currentDatabase": "RetailVerse",
"currentSql": "SELECT * FROM Customer"
}
Example
curl -X POST https://ms.sqlcloud.space/API/{token}/ai \
-H "Content-Type: application/json" \
-d '{"message":"Explain what a clustered index is"}'
The AI is gated by your token: an invalid or missing token returns
401 Invalid API token. The underlying AI model/vendor is managed by the administrator and is never disclosed.
Examples
cURL
curl -X POST "https://ms.sqlcloud.space/API/YOUR_TOKEN/ProfileName/MyDatabase/execute" \
-H "Content-Type: application/json" \
-d '{"query": "SELECT TOP 10 * FROM Users"}'
JavaScript
const response = await fetch(
'https://ms.sqlcloud.space/API/YOUR_TOKEN/ProfileName/MyDatabase/execute',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query: 'SELECT * FROM Products' })
}
);
const data = await response.json();
Python
import requests
response = requests.post(
'https://ms.sqlcloud.space/API/YOUR_TOKEN/ProfileName/MyDatabase/execute',
json={'query': 'SELECT COUNT(*) FROM Orders'}
)
data = response.json()
Error Handling
| Status | Description |
|---|---|
401 |
Invalid or expired API token |
400 |
Bad request, profile not found, or missing password |
500 |
Server error or SQL execution error |
Error Response
{
"success": false,
"error": "Invalid object name 'Users'.",
"errorLine": 1
}