Miridia
Portal
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.

MethodPathOperation
POST/api/ai-studio/queryExecute 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.

FieldTypeRequiredDescription
sqlstringNoA single read-only SELECT statement to run against the caller's org schema.
maxRowsinteger (int32)NoDefaults to 1000 when omitted.

Response

200. Returns a SingleResult envelope. The data field is SqlQueryResponse.

Request
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
}'
Response
{
  "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
FieldTypeDescription
namestring
labelstring
typestring
rolestring
SqlQueryResponse

API response for an AI Studio ad-hoc query.

FieldTypeDescription
columnsSqlColumnResponse[]
rowsmap<string, object>[]
rowCountinteger (int32)
queryMsinteger (int64)