/api/agent

POST /api/agent/v1/question

Changed on

Save a previously constructed query as a named question (card).

The query parameter accepts a query_handle (UUID) returned by construct_query (MBQL) or construct_native_query (native SQL), or a base64-encoded query string. MCP callers should always use the handle. Optionally specify display type, description, collection, and visualization settings. If collection_id is omitted the question is saved to the caller's personal collection. Pass an explicit null to save it to the root collection. The response collection_path is the saved location.

Saving a native (raw SQL) query requires native-query permission on the target database.

post/api/agent/v1/question

Request

  • Base URL
    (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    API key in header X-API-Key

Request body

collection_idinteger nullable

value must be an integer greater than zero.

descriptionstring nullable
display'table' | 'bar' | 'line' | 'pie' | 'scatter' | 'area' | 'row' | 'combo' | 'pivot' | 'scalar' | 'smartscalar' | 'gauge' | 'progress' | 'funnel' | 'map' | 'waterfall' | 'sankey'

Display types accepted by Card. Validates LLM-passed values so a bogus value (e.g. "potato") gets a 400 rather than persisting junk.

namestring required

value must be a non-blank string.

querystring required

value must be a non-blank string.

visualization_settingsobject nullable

Value must be a map.

Response

Successful response

collection_idinteger nullable required

value must be an integer greater than zero.

collection_pathstring required
descriptionstring nullable required
displaystring required
idinteger required

value must be an integer greater than zero.

namestring required

value must be a non-blank string.

urlstring required

Changes

    • breaking

      removed subschema #1 subschema #2 from the request property oneOf list

    • breaking

      removed subschema #1 subschema #2 from the request property oneOf list

    • breaking

      removed subschema #1 subschema #2 from the request property oneOf list

    • breaking

      removed subschema #1 subschema #2 from the request property oneOf list

    • info

      added subschema #2 to the request property anyOf list

    • info

      added subschema #1 subschema #2 to the request property anyOf list

    • info

      added subschema #1 subschema #2 to the request property anyOf list

    • info

      added subschema #1 subschema #2 to the request property anyOf list

    • info

      added subschema #1 subschema #2 to the response property anyOf list for the response status

    • info

      added subschema #1 subschema #2 to the response property anyOf list for the response status

    • info

      removed subschema #1 subschema #2 from the response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 from the response property oneOf list for the response status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      endpoint added