Workspace Data Queries
Register, manage, and invoke parameterized SQL queries against workspace custom tables.
Prerequisites
Endpoints
Permissions
Create a Data Query
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Create body — the authored shape of a new workspace data query.
The SQL template + parameters parity check + multi-statement /
session-state-command refusal runs inside :meth:_validate_template
so a bad payload surfaces as a Pydantic 422 with the standard wire
shape — no try/except in the handler.
^[a-z][a-z0-9_]*$5000Successful Response
Wire shape for the response of every read + create/update handler.
id (UUID) is the stable handle — every URL except list takes it.
name is the workspace-visible label (UNIQUE per workspace) and is
still what the LLM tool registry keys on (wsq_<name>), but it is
not the route identifier.
input_schema is deliberately NOT exposed — it is fully derivable
from parameters[]. UI consumers can build the JSON Schema view
locally if they need it.
A workspace data query with the given name already exists
Validation or precondition failure
Deploy-Time Validation
Example Request
Example Response
Update a Data Query
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
PATCH body — every field optional. Present ⇒ overwrite; absent ⇒ keep.
^[a-z][a-z0-9_]*$Successful Response
Wire shape for the response of every read + create/update handler.
id (UUID) is the stable handle — every URL except list takes it.
name is the workspace-visible label (UNIQUE per workspace) and is
still what the LLM tool registry keys on (wsq_<name>), but it is
not the route identifier.
input_schema is deliberately NOT exposed — it is fully derivable
from parameters[]. UI consumers can build the JSON Schema view
locally if they need it.
Workspace data query not found
A workspace data query with the given name already exists
Validation failure
List Data Queries
List every registered query for a workspace. Sort via repeated sort_by query params; each entry is +field or -field (allowed field: deployed_at). Default: -deployed_at. Cursor opaque — round-trip continuation_token unchanged with the same sort_by. Requires Workspace.view permission.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Sort axes, applied left-to-right. +field ascending, -field
descending. Defaults to [("deployed_at", -1)] (newest first).
[]Maximum number of queries to return per page.
50Opaque continuation token from a prior response. Treat as a black box — the server decodes it.
Successful Response
Missing or invalid API key.
Insufficient permissions.
Query parameter failed validation or continuation_token is unparseable.
Example Response
Get a Data Query
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Successful Response
Wire shape for the response of every read + create/update handler.
id (UUID) is the stable handle — every URL except list takes it.
name is the workspace-visible label (UNIQUE per workspace) and is
still what the LLM tool registry keys on (wsq_<name>), but it is
not the route identifier.
input_schema is deliberately NOT exposed — it is fully derivable
from parameters[]. UI consumers can build the JSON Schema view
locally if they need it.
Workspace data query not found
Validation Error
Delete a Data Query
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Successful Response
No content
Workspace data query not found
Validation Error
No content
Invoke a Data Query
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Successful Response
00Workspace data query not found
Validation Error
Execution failed
Example Request
Example Response
Agent Tool Registration
Last updated
Was this helpful?

