---
title: "List Active Queries"
method: GET
path: "/v1/postgres/{postgres_cluster_id}/queries/active"
tags: ["Postgres Clusters"]
---

# List Active Queries

`GET /v1/postgres/{postgres_cluster_id}/queries/active`

List active queries in the supplied database. The database query parameter is required and must not be empty or whitespace-only. Returns full query text and durations in seconds.

## Path parameters

- `postgres_cluster_id` string, required

## Query parameters

- `database` string, required

## Response `200`

OK

- ListPostgresActiveQueriesResponse
  - `data` PostgresActiveQuery[]
    - `application_name` string — Application connected to the backend.
    - `client` string — Client address.
    - `database` string — Database name.
    - `duration_seconds` number — Query duration in seconds.
    - `pid` integer — Process ID of the backend running the query.
    - `query` string — Full query text.
    - `state` string — Current backend state.
    - `state_duration_seconds` number — Time spent in the current state, in seconds.
    - `user` string — User running the query.
    - `wait_event` string — Event the backend is waiting for.
    - `wait_event_type` string — Type of event the backend is waiting for.

## Other responses

- `401` — Unauthorized
- `404` — Cluster not found
- `422` — database must be a non-empty string
- `500` — Unable to load active queries

## Changes

- **2026-10-01** `4a82f51548c8` — 1 info
  - the endpoint scheme security `FlyBearerAuth` was removed from the API
- **2026-09-17** `369d7f73bd9d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/machines/apis/machines-api/changes/v1/postgres/:postgres_cluster_id/queries/active/get.md)

---

[API](https://skmtc.dev/machines/apis/machines-api.md) · [All operations](https://skmtc.dev/machines/apis/machines-api/llms.txt) · [OpenAPI document](https://skmtc.dev/machines/apis/machines-api/revisions/64798df48ab0?raw)
