---
source_url: https://www.pubnub.com/docs/admin-api/v2026-02-09/execute-saved-query
title: Execute saved query
---

# Execute saved query

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

Executes a previously saved query by ID and returns the result set.

### Usage

* **No request body required** — send `POST` with an empty body or `{}`.
* The saved definition is used as-is. To customize parameters (e.g. different time range), use the ad-hoc execute endpoint instead.

### Response shape

Identical to ad-hoc execute:

| Field | Type | Description |
| --- | --- | --- |
| `data` | array | Result rows |
| `executionTime` | number | Execution duration in milliseconds |
| `queryDefinition` | object | The saved definition echoed back |

## Request

Example

```
{
  "data": [
    {}
  ],
  "executionTime": 37,
  "queryDefinition": {
    "version": "2.0",
    "pipeline": {
      "sources": [
        {}
      ],
      "transforms": [
        {}
      ],
      "output": {
        "from": "event_aggregation",
        "select": [],
        "orderBy": [],
        "limit": 100,
        "offset": 0
      }
    },
    "meta": {}
  }
}
```
