Skip to content
hs-sql-agent
2.0.2
Docs 2.0.2
Docs Reference

Admin HTTP API Reference

Source-backed hs-sql-agent 2.0.1 HTTP controller surface used by the bundled Admin UI.

Auth & identity Sign-in, refresh, OIDC, MFA, password recovery, account, sessions, members, and roles.
Runtime control Databases, MCP keys, semantic metadata, custom tools, security policy, audit, and operability.
MCP is separate The /mcp Streamable HTTP transport is not part of this Admin REST reference.

This page documents the actual controller routes in the hs-sql-agent 2.0.1 source. The bundled Admin UI uses this surface.

Authentication and authorization

Most Admin routes require an authenticated Admin identity. Protected runtime actions additionally use path/action permission checks such as /runtime/db-managementview or /auth/roleedit.

Anonymous exceptions exist for flows that must begin before an Admin session exists, including first-run/sign-in/sign-up, selected OIDC endpoints, password recovery, and MFA challenge completion.

See Permissions.

Auth — /api/Auth

MethodRoutePurpose
GET/api/Auth/first-runinspect initial-setup state
POST/api/Auth/sign-inauthenticate Admin credentials
POST/api/Auth/sign-upcreate the first Admin during allowed first-run flow
POST/api/Auth/refresh-tokenexchange a refresh credential
POST/api/Auth/sign-outend the current session
GET/api/Auth/sessionslist current user’s sessions
DELETE/api/Auth/sessions/{sessionId}revoke one session
DELETE/api/Auth/sessionsrevoke other sessions
GET/api/Auth/oidc/statusinspect OIDC availability
GET/api/Auth/oidc/loginstart OIDC login
GET/api/Auth/oidc/callbackexternal-login callback
POST/api/Auth/oidc/exchangeexchange the short-lived OIDC login code
GET/api/Auth/mfa/statusinspect MFA state
POST/api/Auth/mfa/setupbegin TOTP setup
POST/api/Auth/mfa/confirmconfirm TOTP setup
POST/api/Auth/mfa/disabledisable TOTP after validation
POST/api/Auth/mfa/verifycomplete an MFA sign-in challenge
POST/api/Auth/forgot-passwordrequest password reset
POST/api/Auth/reset-passwordconsume reset token and set new password
GET/api/Auth/accountread current account profile
PUT/api/Auth/accountupdate username/email
PUT/api/Auth/account/passwordchange current password

Members — /api/Member

MethodRoutePermission
POST/api/Member/auth/usercreate
GET/api/Member/auth/userview
PUT/api/Member/{id}/roles/auth/useredit
PUT/api/Member/{id}/status/auth/useredit
DELETE/api/Member/{id}/sessions/auth/useredit
PUT/api/Member/{id}/password-change-required/auth/useredit
DELETE/api/Member/{id}/auth/userdelete

See Members & Roles for self-lockout and lifecycle guardrails.

Roles — /api/Role

MethodRoutePermission
GET/api/Role/auth/roleview
POST/api/Role/auth/rolecreate
PUT/api/Role/{id}/auth/roleedit
DELETE/api/Role/{id}?force=false/auth/roledelete
GET/api/Role/{id}/dependencies/auth/roleview
GET/api/Role/permission-action-templates/auth/roleview

Database Management — /api/DbManagement

MethodRoutePermission
GET/api/DbManagement/runtime/db-managementview
GET/api/DbManagement/{id}/runtime/db-managementview
POST/api/DbManagement/runtime/db-managementcreate
PUT/api/DbManagement/{id}/runtime/db-managementedit
DELETE/api/DbManagement/{id}/runtime/db-managementdelete
GET/api/DbManagement/{id}/schemas/runtime/db-managementview
GET/api/DbManagement/{id}/tables?schema=.../runtime/db-managementview
GET/api/DbManagement/{id}/columns?schema=...&table=.../runtime/db-managementview

Semantic metadata — /api/DbSemantic

MethodRoutePermission
GET/api/DbSemantic/{dbManagementId}semantic view
GET/api/DbSemantic/{dbManagementId}/modelsemantic view
POST/api/DbSemanticsemantic edit
DELETE/api/DbSemantic/{id}semantic edit
POST/api/DbSemantic/relationshipsemantic edit
DELETE/api/DbSemantic/relationship/{id}semantic edit
POST/api/DbSemantic/metricsemantic edit
DELETE/api/DbSemantic/metric/{id}semantic edit

Here semantic means /runtime/db-management/semantic.

MCP-key runtime — /api/runtime

MethodRoutePermission
GET/api/runtime/mcp-keysMCP keys view
GET/api/runtime/mcp-keys/available-tools?dbManagementId=...MCP keys view
POST/api/runtime/mcp-keysMCP keys create
PUT/api/runtime/mcp-keys/{id}MCP keys edit
POST/api/runtime/mcp-keys/{id}/rotateMCP keys edit
POST/api/runtime/mcp-keys/{id}/cloneMCP keys create
POST/api/runtime/mcp-keys/{id}/revokeMCP keys revoke
POST/api/runtime/mcp-keys/test-db-connectionone of the configured MCP-key/DB create-edit permissions
GET/api/runtime/client-configMCP keys view

The client-config endpoint returns the configured MCP public endpoint used to generate client setup.

Custom Tools — /api/CustomSqlTool

MethodRoutePurpose
GET/api/CustomSqlToollist tools
GET/api/CustomSqlTool/{id}get one tool
POST/api/CustomSqlToolcreate draft
PUT/api/CustomSqlTool/{id}edit draft
DELETE/api/CustomSqlTool/{id}delete tool
GET/api/CustomSqlTool/{id}/revisionslist revisions
GET/api/CustomSqlTool/{id}/impactinspect impact/dependencies
POST/api/CustomSqlTool/{id}/publishvalidate and publish
POST/api/CustomSqlTool/{id}/disabledisable published tool
POST/api/CustomSqlTool/{id}/rollback/{revisionId}validate and roll back
POST/api/CustomSqlTool/test-executetest execution; DML test path previews and does not commit

These routes use /runtime/custom-tools with view, create, edit, or delete as appropriate.

Audit and operability — /api/runtime

AreaRoutes
Audit/audit, /audit/daily-summary, /audit/export, /audit/retention, /audit/retention/dry-run, /audit/retention/execute
Operability/operability/metrics, /operability/db-health, /operability/key-usage, /operability/deliveries, /operability/deliveries/{id}/retry

See Audit and Operability for filters, response fields, and permissions.

Security Policy — /api/runtime/security

MethodRoutePermission
GET/api/runtime/security/runtime/securityview
PUT/api/runtime/security/runtime/securityedit

Credential status

GET /api/Credential/status exists in 2.0.1 and returns a simple Credential API running status. The controller itself has no [Authorize] attribute. Treat it as a narrow status endpoint, not as an authenticated credential-management API.

Errors and compatibility

Controllers use ordinary HTTP status codes such as 400 for validation, 401/403 for authentication/authorization, 404 for missing resources, 409 for conflicting tool/role state, 413 for oversized audit export, and 429 for bounded SQL-operation pressure where applicable.

For client automation, pin to 2.0.1 and validate the actual response model you consume. This page intentionally documents routes and important contracts without pretending that every Admin view model is a permanently versioned external SDK.