Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview

Run a tenant-scoped virtual SQL query

Runs one read-only SELECT against the virtual catalog for the authenticated organization and project. DAL catalog restrictions and limits of 1,000 rows and 5 MiB apply.

POST/v1/projects/{projectId}/sql
Authorization
AuthorizationPersonal API key · headerrequired

Your personal API key from Settings > Personal API Keys, sent as Bearer <key>.

X-Organization-IdOrganization ID · headerrequired

The organization to act in. Copy it with Copy organization ID in the organization menu or the settings sidebar.

Path parameters
projectIdstringrequired
Request body
requiredapplication/json
sqlstringrequired
min length 1 · max length 50000 · matches \S
Responses
200

Response for status 200

catalog_versionstringrequired
columnsobject[]required
Show properties
Array of object
namestringrequired
typestringrequired
nullablebooleanrequired
rowsobject[]required

SQL integers outside the JavaScript safe range (-(2^53 - 1) to 2^53 - 1) are returned as exact decimal strings, including in nested values. Column types retain the original SQL types.

row_countintegerrequired
elapsed_msnumberrequired
400

Response for status 400

errorstringrequired
messagestringrequired
hintstring
401

Response for status 401

errorstringrequired
messagestringrequired
hintstring
403

Response for status 403

errorstringrequired
messagestringrequired
hintstring
404

Response for status 404

errorstringrequired
messagestringrequired
hintstring
422

Response for status 422

errorstringrequired
messagestringrequired
hintstring
429

Response for status 429

errorstringrequired
messagestringrequired
hintstring
502

Response for status 502

errorstringrequired
messagestringrequired
hintstring
503

Response for status 503

errorstringrequired
messagestringrequired
hintstring
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.judgmentlabs.ai/v1/projects/YOUR_PROJECT_ID/sql' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Organization-Id: YOUR_ORGANIZATION_ID' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "sql": "string"
}'
Response
{
  "catalog_version": "string",
  "columns": [
    {
      "name": "string",
      "type": "string",
      "nullable": true
    }
  ],
  "rows": [
    {}
  ],
  "row_count": 0,
  "elapsed_ms": 0
}

Was this page helpful?