GET
/v1/queries/{queryId}betaauthenticatedworkspace
When to use
Check an existing SQL execution without starting another query.
For agents
Use the queryId from submission. When completed, read result.rows; when failed, inspect error.code, message and details. Recheck current permissions before interpreting a missing or denied result.
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.getQuery('qry_abcdefghijklmnopqrstuvwx');Response
{
"data": {
"queryId": "qry_abcdefghijklmnopqrstuvwx",
"status": "running",
"statusUrl": "/v1/queries/qry_abcdefghijklmnopqrstuvwx",
"pollAfterMs": 1500
}
}