Skip to content

Run chart queries

POST
/v1/yac/query
curl --request POST \
--url https://example.com/v1/yac/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "package": "example", "selections": {}, "queries": [ { "vizId": "example", "source": {}, "transformation": [ {} ], "displayDataOnly": true, "offset": 1 } ] }'

Run every visible chart’s transformation pipeline as SQL, in one batch.

The server-side counterpart of the toolkit’s in-browser executor: each query is compiled to SQL against the package’s backend, with the current selections applied.

Media typeapplication/json
YACQueryRequest

Stateless batched query: every visible viz spec + the current selection state, in one request. Mirrors the toolkit’s createRemoteBackend wire contract (packages/grammar/queryBackend.ts).

object
package
Any of:
string
selections
Selections
object
key
additional properties
object
key
additional properties
any
queries
required
Queries
Array<object>
YACQueryItem
object
vizId
required
Vizid
string
source
required
Any of:
Array<object>
object
key
additional properties
any
transformation
Any of:
Array<object>
object
key
additional properties
any
displayDataOnly
Any of:
boolean
offset
Any of:
integer

Successful Response

Media typeapplication/json
QueryResponse
object
results
required
Results

One result per query, keyed by vizId. A query that fails carries {error} instead of rows; the others still succeed.

object
key
additional properties
object
key
additional properties
any

Example generated

{
"results": {
"additionalProperty": {}
}
}

Missing, invalid or expired token (detail).

Media typeapplication/json
ErrorResponse

An error body. Authentication failures carry FastAPI’s detail instead of error.

object
error
Any of:
string
code
Any of:
string
errors
Any of:
Array<string>
detail
Any of:
string

Example generated

{
"error": "example",
"code": "example",
"errors": [
"example"
],
"detail": [
{}
]
}

database_forbidden: the database rejected the caller’s forwarded identity (JWT passthrough).

Media typeapplication/json
ErrorResponse

An error body. Authentication failures carry FastAPI’s detail instead of error.

object
error
Any of:
string
code
Any of:
string
errors
Any of:
Array<string>
detail
Any of:
string

Example generated

{
"error": "example",
"code": "example",
"errors": [
"example"
],
"detail": [
{}
]
}

no_backend: no query backend is configured for the package.

Media typeapplication/json
ErrorResponse

An error body. Authentication failures carry FastAPI’s detail instead of error.

object
error
Any of:
string
code
Any of:
string
errors
Any of:
Array<string>
detail
Any of:
string

Example generated

{
"error": "example",
"code": "example",
"errors": [
"example"
],
"detail": [
{}
]
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}

The identity provider’s keys could not be fetched (JWT_JWKS_URL).

Media typeapplication/json
ErrorResponse

An error body. Authentication failures carry FastAPI’s detail instead of error.

object
error
Any of:
string
code
Any of:
string
errors
Any of:
Array<string>
detail
Any of:
string

Example generated

{
"error": "example",
"code": "example",
"errors": [
"example"
],
"detail": [
{}
]
}