Query
Query an organization's data in HQL, a SQL-like pipe language, or turn plain English into HQL.
A query names an entity type, optionally a branch, then pipe stages:
<EntityType> [@ <branch>] | <filters> | select <fields> | order <field> desc | limit N. Rows are JSON-safe: long strings are
shortened with a marker saying how much is left, and binary values
appear as their content handle with an excerpt. Field names per type
come from the entities resource's describe; the complete language
is syntax.
A query can also read a list inside a stored value, such as a report
or tool result that came back as a handle, as a table: start it with
handle('<ref>', '<path>') instead of a type, and filter, group and
sort its columns the same way.
Use this resource to find, count and group records across many entities; use the entities resource to read or change one entity in full, and the dtypes resource to read a value behind a handle.
Reference
- HQL reference: Every HQL operator, clause, search mode and handle-source rule, with examples.
Operations
- Delete entities with an HQL DELETE statement.
POST /Platform/query/hql/delete - Run a read-only HQL query.
POST /Platform/query/hql - Get the HQL language reference.
GET /Platform/query/syntax - Translate plain English into HQL.
POST /Platform/query/translate
Objects
QueryDeletion
rows: List[Dict[str, JsonValue]]. Empty for a DELETE statement.deleted_count: int. Number of deleted entities.entity_type: str. Deleted entity class name.branch: str. Affected branch, or * for all branches.hard: bool. Whether deletion was permanent.ids_deleted: List[str]. Identifiers of deleted entities.sql: str. SQL used to locate matching entities.params: Union[List[JsonValue], Dict[str, JsonValue]]. Parameters used by the statement.execution_time_ms: float. Execution duration in milliseconds.
QueryReference
reference: str. HQL syntax and examples in Markdown.
QueryRows
rows: List[Dict[str, JsonValue]]. JSON-safe projected rows.columns: optional List[QueryColumn] or null. Schema type per column; present only with return_mode="typed".truncated_values: optional int. Number of values shortened to the requested character limit.hint: optional str or null. Guidance for reading truncated values.warnings: optional List[str]. Query compiler and execution notices.row_count: optional int or null. Rows in this response.total_rows: optional int or null. Rows the query matched before offset and limit; set for handle(...) sources.
QueryTranslation
entity_type: str. Inferred or requested entity class name; "handle" for a query over a stored value.conditions: List[QueryCondition]. Conditions extracted from the generated HQL.selected_fields: List[str]. Projected fields other than id, name, and entity_type.hql: str. Complete generated HQL statement.warnings: optional List[str]. Why the generated HQL would fail or mislead when run (a parse error, an unknown column), word for word; empty when it checked out.