POST
/
query
curl --request POST \
  --url https://api.isofold.com/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "<string>",
  "warehouse": "bigquery"
}'
{
  "trace_id": "<string>",
  "rewritten_query": "<string>",
  "duration_ms": 123,
  "rows": 123
}

Submit a SQL query to Isofold. The query will be analyzed, rewritten, and executed against the configured data warehouse. This is the primary entrypoint for using Isofold programmatically.


Request

Send a JSON payload like the following:

{
  "query": "SELECT * FROM users WHERE created_at >= '2024-01-01'",
  "warehouse": "bigquery"
}

Fields

FieldTypeRequiredDescription
querystringThe raw SQL to execute
warehousestringTarget warehouse (bigquery, snowflake, aurora)

Response

{
  "trace_id": "abc123",
  "rewritten_query": "SELECT id, email, created_at FROM users WHERE created_at >= '2024-01-01'",
  "duration_ms": 142,
  "rows": 1024
}

Fields

FieldTypeDescription
trace_idstringUnique identifier for this request
rewritten_querystringThe version Isofold actually executed
duration_msnumberTotal end-to-end latency in milliseconds
rowsintegerRow count in the result set

Authorization

All requests must include a Bearer token:

Authorization: Bearer YOUR_API_KEY

Next: Estimate Cost

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The SQL query to run

The body is of type object.

Response

200 - application/json

Query completed successfully

The response is of type object.