Agents now connect to datahashi over OAuth — scoped tokens, no API keys to paste
datahashi
Open console
← Docs

REST API & authentication

The two planes — control plane and engine — the endpoints on each, the three credential types, and the error envelope.

Updated

datahashi runs as two processes with two API surfaces. They are separated on purpose — see Architecture.

Control plane — hashi-api

Browser-reachable. Manages workspaces, membership, sources and connections, semantic models, and credentials. It holds the key that seals warehouse credentials and it never runs SQL.

EndpointPurpose
POST /v1/orgs/{orgId}/api-keysmint a data-plane key (mode: governed | explore)
GET /v1/orgs/{orgId}/api-keyslist keys by metadata — never returns secrets
key revoke / rotateinvalidate or roll a credential without downtime
authoring + publish routesapply a draft model, publish an artifact

Authentication: a console session, or a control-plane token, depending on the route.

Engine — hashi-engine

Holds the live warehouse connections and compiles SQL. Never exposed to a browser. This is where queries actually run.

EndpointMethodFunction
/v1/queryPOSTrun a Semantic Query
/v1/modelsGETlist semantic model names
/v1/catalogGETmetrics, dimensions, views (measures in explore mode)
/v1/describeGETlook up one metric, dimension, or measure
/v1/tenants/{id}/usage/summaryGETmetered usage over a window
/mcpthe MCP protocol surface

Authentication: Authorization: Bearer <data-plane key>. The key’s claims are identity only — your workspace and mode. The warehouse a query reaches, its row-level security, and its cost limits are resolved server-side.

Credentials

CredentialCarried whereUsed for
Console sessioncookiea member driving the console and playground
Query-time JWTAuthorization, exp ≤ 120sthe control plane proxying a member’s playground query to the engine — identity travels here, never in the body
Data-plane API keyAuthorization: Bearera REST or MCP consumer; scoped to a principal and a mode

Error envelope

Data-plane errors are JSON:

{ "error": { "code": "not_found", "message": "unknown metric: revenu" } }

Stable codes: bad_request, unauthenticated, forbidden, not_found, over_budget, overloaded, internal. Router-level errors (wrong method or path) return a plain-text 404/405 outside this envelope.