Insights
AI Studio
The ai studio operations of the Core API.
Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.
| Method | Path | Operation |
|---|---|---|
| POST | /api/ai-studio/query | Execute query |
Execute query
POST/api/ai-studio/query
Execute an ad-hoc read-only SELECT against the caller's org schema and return the result set with column metadata. Powers the AI Studio chat data layer.
Access. Send a bearer token or an API key. The caller needs the Insights view permission.
Request body
Send JSON with the shape ExecuteSqlRequest. Request body for the AI Studio ad-hoc query endpoint.
| Field | Type | Required | Description |
|---|---|---|---|
sql | string | No | A single read-only SELECT statement to run against the caller's org schema. |
maxRows | integer (int32) | No | Defaults to 1000 when omitted. |
Response
200. Returns a SingleResult envelope. The data field is SqlQueryResponse.
curl -X POST "https://api.miridia.io/api/ai-studio/query" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"sql": "string",
"maxRows": 0
}'{
"message": "string",
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
],
"data": {
"columns": [
{}
],
"rows": [
{
"key": {}
}
],
"rowCount": 0,
"queryMs": 0
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Models
The operations on this page use these object types. Select a type to see its fields.
SqlColumnResponse
| Field | Type | Description |
|---|---|---|
name | string | |
label | string | |
type | string | |
role | string |
SqlQueryResponse
API response for an AI Studio ad-hoc query.
| Field | Type | Description |
|---|---|---|
columns | SqlColumnResponse[] | |
rows | map<string, object>[] | |
rowCount | integer (int32) | |
queryMs | integer (int64) |