---
title: "Run App Query"
method: POST
path: "/api/v1/apps/{app_id}/query"
tags: ["apps-query"]
---

# Run App Query

`POST /api/v1/apps/{app_id}/query`

Run a guarded SELECT against the app's bound ontology entities.

## Path parameters

- `app_id` string, uuid, required

## Request body

- AppQueryRequest — Body for POST /api/v1/apps/{app_id}/query. Single mode: caller passes optional ``limit`` (default 1000, max 5000). Pagination is NOT supported at this endpoint — write ``LIMIT N OFFSET M`` directly in your SQL if you need it. Earlier ``page`` / ``page_size`` params were removed because the engine never threaded ``page`` into a real OFFSET (silently returned the same first ``page_size`` rows on every page) — see PR #375 review.
  - `sql` string, required
  - `limit` integer, nullable
  - `embed_host_app_id` string, uuid, nullable — Set when this app is running as an embedded widget inside another app. Authorization then requires VIEWER on that host plus an active embed binding — see domains/apps/application/embed_access.py.

## Response `200`

Successful Response

- AppQueryResponse
  - `lane` 'oltp' | 'olap'
  - `mirror_refreshed_at` string, date-time, nullable
  - `columns` string[], required
  - `rows` object[], required
  - `total_rows` integer, required
  - `truncated` boolean, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-28** `ef8b72834a51` — 2 info
  - added the optional property `lane` to the response with the `200` status
  - added the optional property `mirror_refreshed_at` to the response with the `200` status
- **2026-08-21** `8de9cb14f744` — 1 info
  - added the new optional request property `embed_host_app_id`

[Change history](https://skmtc.dev/netter/apis/dmi-backend/changes/api/v1/apps/:app_id/query/post.md)

---

[API](https://skmtc.dev/netter/apis/dmi-backend.md) · [All operations](https://skmtc.dev/netter/apis/dmi-backend/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/netter/dmi-backend/revisions/eed6fb164abd/schema)
