Workspace 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.
GET /v1/{workspace_id}/data_queries HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"description": "text",
"sql_template": "text",
"parameter_count": 1,
"timeout_ms": 1,
"last_invoked_at": "2026-01-01T00:00:00.000Z",
"deployed_at": "2026-01-01T00:00:00.000Z",
"deployed_by": "123e4567-e89b-12d3-a456-426614174000"
}
],
"has_more": true,
"continuation_token": null
}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
POST /v1/{workspace_id}/data_queries HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 301
{
"name": "text",
"description": "text",
"sql_template": "text",
"parameters": [
{
"name": "text",
"type": "string",
"description": "text",
"default": "text",
"authorization_binding": {
"source": "text",
"resource_type": "text",
"access": "read",
"encoding": "csv"
},
"authorization_binding_test_value": "text"
}
],
"timeout_ms": 5000
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"description": "text",
"sql_template": "text",
"parameters": [
{
"name": "text",
"type": "string",
"description": "text",
"default": "text",
"authorization_binding": {
"source": "text",
"resource_type": "text",
"access": "read",
"encoding": "csv"
},
"authorization_binding_test_value": "text"
}
],
"timeout_ms": 1,
"last_invoked_at": "2026-01-01T00:00:00.000Z",
"deployed_at": "2026-01-01T00:00:00.000Z",
"deployed_by": "123e4567-e89b-12d3-a456-426614174000"
}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
GET /v1/{workspace_id}/data_queries/{query_id} HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"description": "text",
"sql_template": "text",
"parameters": [
{
"name": "text",
"type": "string",
"description": "text",
"default": "text",
"authorization_binding": {
"source": "text",
"resource_type": "text",
"access": "read",
"encoding": "csv"
},
"authorization_binding_test_value": "text"
}
],
"timeout_ms": 1,
"last_invoked_at": "2026-01-01T00:00:00.000Z",
"deployed_at": "2026-01-01T00:00:00.000Z",
"deployed_by": "123e4567-e89b-12d3-a456-426614174000"
}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
DELETE /v1/{workspace_id}/data_queries/{query_id} HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
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
PATCH /v1/{workspace_id}/data_queries/{query_id} HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 298
{
"name": "text",
"description": "text",
"sql_template": "text",
"parameters": [
{
"name": "text",
"type": "string",
"description": "text",
"default": "text",
"authorization_binding": {
"source": "text",
"resource_type": "text",
"access": "read",
"encoding": "csv"
},
"authorization_binding_test_value": "text"
}
],
"timeout_ms": 1
}{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"description": "text",
"sql_template": "text",
"parameters": [
{
"name": "text",
"type": "string",
"description": "text",
"default": "text",
"authorization_binding": {
"source": "text",
"resource_type": "text",
"access": "read",
"encoding": "csv"
},
"authorization_binding_test_value": "text"
}
],
"timeout_ms": 1,
"last_invoked_at": "2026-01-01T00:00:00.000Z",
"deployed_at": "2026-01-01T00:00:00.000Z",
"deployed_by": "123e4567-e89b-12d3-a456-426614174000"
}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
POST /v1/{workspace_id}/data_queries/{query_id}/invoke HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 48
{
"input": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}{
"result": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"duration_ms": 0,
"row_count": 0
}Last updated
Was this helpful?

