---
title: "Unified alert query endpoint"
method: POST
path: "/dashboard/api/alerts/query"
tags: ["Alerts"]
---

# Unified alert query endpoint

`POST /dashboard/api/alerts/query`

## Request

- Base URL: `https://api.agnost.ai`
- URL: `https://api.agnost.ai/dashboard/api/alerts/query`
- Auth: one of:
  - HTTP bearer and API key in header `x-org-id`
  - API key in header `x-api-key`

Dispatches to generate, build, test, or summarize based on action field.
Replaces separate generate-query, build-query, test-query, and summarize-action endpoints.

## Request body

- object
  - `action` 'generate' | 'build' | 'test' | 'summarize', required
  - `natural_language_query` string: For generate action
  - `params` object: For build action
  - `sql_query` string: For test action
  - `query_type` 'condition' | 'action': For test action
  - `action_prompt` string: For summarize action
  - `rows` string: For summarize action

## Response `200`

Query operation results

## Changes

- **2026-11-03** `a61431b48f36`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agnost/apis/agnost-ai-api/changes/dashboard/api/alerts/query/post.md)

---

[API](https://skmtc.dev/agnost/apis/agnost-ai-api.md) - [All operations](https://skmtc.dev/agnost/apis/agnost-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agnost/apis/agnost-ai-api/revisions/a61431b48f36?raw)
