Query Run Preview

Represents an ad-hoc execution of a Sigma query via the API

The Query Run object Preview

Attributes

  • idstring

    Unique identifier for the object.

  • objectstring

    String representing the object’s type. Objects of the same type share the same value.

  • createdtimestamp

    Time at which the object was created. Measured in seconds since the Unix epoch.

  • finalized_atnullable timestamp

    Timestamp describing when a Query run reached the terminal status.

  • livemodeboolean

    Has the value true if the object exists in live mode or the value false if the object exists in test mode.

  • sqlstring

    The sql statement that is run.

  • statusnullable enum

    The status of the query run. Possible values are succeeded, pending, running, and failed.

The Query Run object
{
"id": "qry_0R9c43589O8STxCGUZXU3I6T",
"object": "sigma.sigma_query_run",
"created": 1743641728,
"error": null,
"finalized_at": 1743641733,
"livemode": true,
"result": {
"file": "file_0R9c49589O8KAxR9askNs8JQ"
},
"sql": "SELECT * FROM balance_transactions LIMIT 4",
"status": "completed"
}

Create a Query Run Preview

Create a query run to be executed.

Parameters

  • from_saved_querystring

    The unique id of a previously saved query to be run. Note that only one of sql or from_saved_query should be provided.

  • sqlstring

    The sql statement to run. This should be a valid Trino SQL statement that can be run in Sigma. Note that only one of sql or from_saved_query should be provided.

Returns

Returns a Query Run object.

POST /v1/sigma/query_runs
cURL
curl https://api.stripe.com/v1/sigma/query_runs \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-H "Stripe-Version: 2025-07-30.preview" \
--data-urlencode sql="SELECT * FROM balance_transactions LIMIT 4"
Response
{
"id": "qry_0R9c43589O8STxCGUZXU3I6T",
"object": "sigma.sigma_query_run",
"created": 1743641728,
"error": null,
"finalized_at": 1743641733,
"livemode": true,
"result": {
"file": "file_0R9c49589O8KAxR9askNs8JQ"
},
"sql": "SELECT * FROM balance_transactions LIMIT 5",
"status": "completed"
}

Retrieve a Query Run Preview

Retrieve the status of Query Run

Parameters

  • idstringRequired

    The id of the query run to retrieve. This should be a valid id that was previously created.

Returns

Returns the specified Query Run object.

GET /v1/sigma/query_runs/:id
cURL
curl https://api.stripe.com/v1/sigma/query_runs/qry_0R9c43589O8STxCGUZXU3I6T \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-H "Stripe-Version: 2025-07-30.preview"
Response
{
"id": "qry_0R9c43589O8STxCGUZXU3I6T",
"object": "sigma.sigma_query_run",
"created": 1743641728,
"error": null,
"finalized_at": 1743641733,
"livemode": true,
"result": {
"file": "file_0R9c49589O8KAxR9askNs8JQ"
},
"sql": "SELECT * FROM balance_transactions LIMIT 5",
"status": "completed"
}

Saved Query Preview