# Anomaly Detection Query Rules API

**Canonical:** https://apis.io/apis/anomaly-detection/anomaly-detection-query-rules-api/  
**Provider:** Anomaly Detection — https://apis.io/providers/anomaly-detection/  
**Base URL:** https://api.cognitive.microsoft.com  
**Documentation:** https://learn.microsoft.com/en-us/azure/ai-services/anomaly-detector/overview

Anomaly Detection Query Rules API is one of 49 APIs that [Anomaly Detection](https://apis.io/providers/anomaly-detection/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. Tagged areas include Query Rules. The published artifact set on APIs.io includes an OpenAPI specification.

Query rules enable you to configure per-query rules that are applied at query time to queries that match the specific rule. Query rules are organized into rulesets, collections of query rules that are matched against incoming queries. Query rules are applied using the rule query. If a query matches one or more rules in the ruleset, the query is re-written to apply the rules before searching. This allows pinning documents for only queries that match a specific term. Alternatively, you can use the [Query Rules UI](https://www.elastic.co/docs/solutions/search/query-rules-ui) to manage query rules.

## Operations (8)

| Method | Path | Summary |
|---|---|---|
| GET | `/_query_rules/{ruleset_id}/_rule/{rule_id}` | Get a query rule |
| PUT | `/_query_rules/{ruleset_id}/_rule/{rule_id}` | Create or update a query rule |
| DELETE | `/_query_rules/{ruleset_id}/_rule/{rule_id}` | Delete a query rule |
| GET | `/_query_rules/{ruleset_id}` | Get a query ruleset |
| PUT | `/_query_rules/{ruleset_id}` | Create or update a query ruleset |
| DELETE | `/_query_rules/{ruleset_id}` | Delete a query ruleset |
| GET | `/_query_rules` | Get all query rulesets |
| POST | `/_query_rules/{ruleset_id}/_test` | Test a query ruleset |

## Machine-readable artifacts (1)

- **OpenAPI** — https://artifacts.apis.io/anomaly-detection/openapi/anomaly-detection-query-rules-api-openapi.yml

## Other Anomaly Detection APIs (12)

- [Azure AI Anomaly Detector](https://apis.io/apis/anomaly-detection/azure-ai-anomaly-detector/)
- [Elasticsearch Anomaly Detection API](https://apis.io/apis/anomaly-detection/elasticsearch-anomaly-detection-api/)
- [Datadog Anomaly Monitor API](https://apis.io/apis/anomaly-detection/datadog-anomaly-monitor-api/)
- [AWS Lookout for Metrics](https://apis.io/apis/anomaly-detection/aws-lookout-for-metrics/)
- [PyOD (Python Outlier Detection)](https://apis.io/apis/anomaly-detection/pyod-python-outlier-detection/)
- [Anomaly Detection Analytics API](https://apis.io/apis/anomaly-detection/anomaly-detection-analytics-api/)
- [Anomaly Detection Cat API](https://apis.io/apis/anomaly-detection/anomaly-detection-cat-api/)
- [Anomaly Detection Ccr API](https://apis.io/apis/anomaly-detection/anomaly-detection-ccr-api/)
- [Anomaly Detection Cluster API](https://apis.io/apis/anomaly-detection/anomaly-detection-cluster-api/)
- [Anomaly Detection Connector API](https://apis.io/apis/anomaly-detection/anomaly-detection-connector-api/)
- [Anomaly Detection data stream API](https://apis.io/apis/anomaly-detection/anomaly-detection-data-stream-api/)
- [Anomaly Detection Document API](https://apis.io/apis/anomaly-detection/anomaly-detection-document-api/)

## Tags

Query Rules

## Use this from code or an agent

- **REST, no key:** `GET https://apis.io/api/v1/providers/anomaly-detection` returns the provider's full profile as JSON.
- **MCP:** `https://apis.io/mcp` (Streamable HTTP) — search the catalog, read any provider, compare providers, check agent readiness.
- **Free API key** for catalog-wide search, ratings and comparisons: sign in with GitHub, Google or LinkedIn at https://apis.io/developer/account/ (plans: https://apis.io/developer/plans/).

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/anomaly-detection/anomaly-detection-query-rules-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/anomaly-detection/.
