Run query
Runs the query specified in the request body. Successful requests will return the data as a base64 encoded Apache Arrow table, allowing you to extract query results from Omni and use them elsewhere. For example, piping data to Google Sheets or leveraging data in a Python notebook.
408 timeout error with a body that includes a remaining_job_ids property. When this occurs, poll the Wait for query results endpoint until the timed_out property is false.Authorizations
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
Body
A JSON object representing the query to be run.
To retrieve a query's JSON object from an Omni workbook:
- Open a workbook in Omni.
- Click the bug icon to toggle open the Inspector panel. For Mac use
Option + 9; for Windows, useAlt + 9. - Locate the Query structure section.
- Copy the query JSON.
Optional ID of a model branch to execute the query against. When provided, the query runs against the specified branch instead of the shared model.
The branch must belong to the same shared model specified in query.modelId and be within your organization.
Executes the query as the specified user. If not provided, the API uses the user associated with the API token. The userId must belong to a user in your organization.
Optional cache policy to control how query caching behaves. Must be one of:
Standard- Uses standard caching behaviorSkipRequery- Uses cached results if available, but does not requery if not found (default)SkipCache- Bypasses cache and always executes a fresh query
Standard, SkipRequery, SkipCache Cannot be used with planOnly. Specifies the format of query results exported by the API.
If omitted, the API will return results in a base-64 encoded format.
csv, json, xlsx Cannot be used with resultType. If true, the API will return the query execution plan without running the query. The response will include the generated SQL and query metadata.
Applicable only if resultType is specified. If true, formatting will be applied to numeric and currency values in the form of currency symbols and thousand separators.
Response
Successful responses will contain the following:
- An object with a
jobs_submittedproperty - An object containing details about the job, such as
job_id,status, and the provided query. Note: IfplanOnly: truewas included in the request body, the status will bePLANNED. - The job details object will also contain a
resultproperty, which contains the query results as a base64 encoded Apache Arrow table. You can use the Omni Python SDK to decode and validate the results.
If the request times out, the response will include remaining_job_ids. Poll the /api/v1/query/wait endpoint with these IDs until timed_out is false.
Map of job IDs to client result IDs
The unique identifier for the query job
Job status (e.g., COMPLETE, PLANNED)
Client-side result identifier
Query execution summary including SQL, stats, and field metadata
Cache information including TTL and data freshness
The executed query details
Base64 encoded Apache Arrow table containing query results
Server-side streaming metrics
IDs of the jobs still processing if the request timed out. Poll /api/v1/query/wait with these IDs.
Indicates if the request timed out. If true, use remaining_job_ids to poll for results.