POST
/v1/queriesbetaapiKeyworkspace
When to use
Run read-only SQL when you already know the exact table names and source IDs.
For agents
Use after source inspection for exact rows. For natural-language questions, start an answer job first.
Example
import { PermuteClient } from '@permute/sdk';
const orgClient = new PermuteClient({
apiKey: process.env.PERMUTE_API_KEY!,
});
const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);
const result = await client.query({
"sourceIds": [
"data_abc123",
"conn_hubspot123"
],
"sql": "SELECT * FROM \"blok_revenue\" LIMIT 10",
"limit": 100
});Request body
{
"sourceIds": [
"data_abc123",
"conn_hubspot123"
],
"sql": "SELECT * FROM \"blok_revenue\" LIMIT 10",
"limit": 100
}Response
{
"data": {
"queryId": "qry_abc123",
"sourceIds": [
"data_abc123",
"conn_hubspot123"
],
"sql": "SELECT * FROM \"blok_revenue\" LIMIT 10",
"columns": [
{
"name": "month"
},
{
"name": "revenue"
}
],
"rows": [
{
"month": "2026-03",
"revenue": 120000
}
],
"rowCount": 1,
"truncated": false,
"executionMs": 18
}
}