Query Database View data
Queries the saved View output with structured field projection, filters, sorting, grouping, casts, pagination, and optional total count. The saved View remains the source; this operation does not mutate source rows.
curl --request POST \
--url https://api.revoengine.com/api/v1/databases/views/{databaseViewId}/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.revoengine.com/api/v1/databases/views/{databaseViewId}/data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/databases/views/{databaseViewId}/data"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
Bearer JWT token or API Key (sk-*).
Path Parameters
Body
Structured database read request. The server supplies the base from relation, so do not send from. All fields are optional. Input must be JSON-serializable and at most 8388608 UTF-8 bytes. Nested expression/filter validation depends on the selected database schema and cannot be fully represented by static OpenAPI. For view joins, provide a non-empty definition for every joined relation.
Selected fields and computed expressions. Each entry is a field string or a structured SelectItem (for example { field, as, castAs, distinct }, { fn, args, as }, { jsonValue, as }, { cast, asType, as }, { coalesce, as }, or { case, as }). Field and expression validity is checked against the selected database at runtime.
[
"status",
{ "field": "total", "as": "amount" }
]
Join clauses and ON predicates. Provide table and on. For a direct database read, the server resolves the joined database definition and checks access; client-supplied definition is ignored. For a view read, a non-empty definition is required in each join. Predicates accept a left/op/right comparison, an array of comparisons, or nested and/or/not groups.
Show child attributes
Show child attributes
[
{
"table": "customers",
"alias": "c",
"type": "left",
"on": {
"left": "orders.customer_id",
"op": "=",
"right": "c.id"
}
}
]
Structured FilterNode predicate or nested and/or/not tree. A field predicate can use { field, op, value }, { field, op, values }, or shorthand operators. Field names and operation/value combinations are validated against the database at runtime. Application guards: 16 levels and 8388608 UTF-8 input bytes. Managed database queries: no separate node or array-value count limit; at most 65535 bind parameters per compiled statement. Analytics-backed queries retain 1000 nodes, 100000 array values and 10000 bind parameters.
{
"and": [
{
"field": "status",
"op": "eq",
"value": "OPEN"
},
{
"field": "total",
"op": "gte",
"value": 100
}
]
}
Sort by field name. Use an object mapping field names to ASC/DESC (case-insensitive) or an array of field names, prefixing descending fields with "-"; field names and aliases are validated at runtime.
Show child attributes
Show child attributes
{ "createdAt": "DESC" }
Field references or selected aliases used for grouping; validated against the query projection.
["status"]
Per-field database type overrides. Keys are field references; values are DatabaseDefinitionType constants.
Show child attributes
Show child attributes
{ "total": "NUMERIC" }
Maximum returned rows. Non-negative integer; zero or omission means no SQL LIMIT, not a default page size.
x >= 0100
Number of rows to skip. Non-negative integer.
x >= 00
Include a count with query results. With take=0, the query may use count-only mode.
false
Request query debug information when available to the caller.
false
Common table expressions. Each entry needs a name and a full query with its own from definition; nested CTE references and query fields are validated at runtime.
Show child attributes
Show child attributes
Advanced raw SQL WHERE fragments. Each fragment requires SQL text; {0}, {1}, etc. bind values from params. The SQL text itself is not structurally validated by the SelectInput DSL validator; use only trusted SQL and never interpolate untrusted values.
Show child attributes
Show child attributes
Query dialect supported by the selected backend; the runtime determines whether the requested dialect is available.
postgres, bigquery Response
curl --request POST \
--url https://api.revoengine.com/api/v1/databases/views/{databaseViewId}/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.revoengine.com/api/v1/databases/views/{databaseViewId}/data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/databases/views/{databaseViewId}/data"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
