# Data queries

{% hint style="info" %}
Two of the **Data queries** routes below manage [quarantined traffic sources](https://waap.docs.link11.com/console-walkthrough/security/quarantined). The rest are for retrieving traffic data; for instructions on using them, see [API access to traffic data](https://waap.docs.link11.com/reference-information/api/api-access-to-traffic-data).
{% endhint %}

## Quarantine operations

## Get quarantined list

> Get quarantined list

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/quarantined":{"get":{"operationId":"api.quarantined.handler.get_quarantined","summary":"Get quarantined list","description":"Get quarantined list","parameters":[{"in":"query","name":"config","schema":{"type":"string"}},{"in":"query","name":"ids","schema":{"items":{"type":"string"},"type":"array"}},{"in":"query","name":"rule_ids","schema":{"items":{"type":"string"},"type":"array"}},{"description":"Database to get data from","in":"header","name":"provider","required":true,"schema":{"description":"Database to get data from","enum":["mongodb"],"type":"string"}},{"description":"Syntax of query","in":"header","name":"syntax","required":true,"schema":{"description":"Syntax of query","enum":["string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Query for quarantined has been run successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Delete record(s) from quarantined list

> Delete record(s) from quarantined list

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/quarantined":{"delete":{"operationId":"api.quarantined.handler.delete_quarantined","summary":"Delete record(s) from quarantined list","description":"Delete record(s) from quarantined list","parameters":[{"description":"Database to get data from","in":"header","name":"provider","required":true,"schema":{"description":"Database to get data from","enum":["mongodb"],"type":"string"}},{"description":"Syntax of query","in":"header","name":"syntax","required":true,"schema":{"description":"Syntax of query","enum":["json"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"config":{"type":"string"},"ids":{"items":{"type":"string"},"type":"array"},"rule_ids":{"items":{"type":"string"},"type":"array"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Record(s) was/were successfully deleted"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Traffic data operations

## Get traffic data from logs

> Retrieve traffic data using 'filters' parameter, explained at \[<https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data]\\(https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)>

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/logs":{"get":{"operationId":"api.logs.handler.get_loglines_860854857476889660","summary":"Get traffic data from logs","description":"Retrieve traffic data using 'filters' parameter, explained at [https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data](https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)","parameters":[{"in":"query","name":"limit","schema":{"default":100,"maximum":2500,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"minimum":0,"type":"integer"}},{"description":"Filters for request in format selected below (JSON or query string)","in":"query","name":"filters","schema":{"description":"Filters for request in format selected below (JSON or query string)","type":"string"},"style":"deepObject"},{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","in":"query","name":"debug","required":false,"schema":{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","type":"boolean"}},{"description":"if set to true the query will be saved in the query history","in":"query","name":"save_history","required":false,"schema":{"description":"if set to true the query will be saved in the query history","type":"boolean"}},{"description":"Syntax of query","in":"header","name":"syntax","required":false,"schema":{"description":"syntax of query","enum":["json","string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Logs has been received successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Get traffic stats

> Get stats (time\_period, counter, hostname, bandwidth, latency) using 'filters' parameter, explained at \[<https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data]\\(https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)>

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/stats":{"get":{"operationId":"api.dashboard.handler.get_stats_1179987213029942625","summary":"Get traffic stats","description":"Get stats (time_period, counter, hostname, bandwidth, latency) using 'filters' parameter, explained at [https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data](https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)","parameters":[{"description":"Filters for request in format selected below (JSON or query string)","in":"query","name":"filters","schema":{"description":"Filters for request in format selected below (JSON or query string)","type":"string"},"style":"deepObject"},{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","in":"query","name":"debug","required":false,"schema":{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","type":"boolean"}},{"description":"Syntax of query","in":"header","name":"syntax","required":false,"schema":{"description":"syntax of query","enum":["json","string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Stats has been received successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Get traffic timeline

> Get timeline (time\_period, sessions, remote\_addr, all\_hits, blocked, origin\_blocked, challenge, is\_human, statuses stats, origin statuses stats, bytes\_sent) using 'filters' parameter, explained at \[<https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data]\\(https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)>

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/timeline":{"get":{"operationId":"api.dashboard.handler.get_timeline_185381998472123425","summary":"Get traffic timeline","description":"Get timeline (time_period, sessions, remote_addr, all_hits, blocked, origin_blocked, challenge, is_human, statuses stats, origin statuses stats, bytes_sent) using 'filters' parameter, explained at [https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data](https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)","parameters":[{"description":"Filters for request in format selected below (JSON or query string)","in":"query","name":"filters","schema":{"description":"Filters for request in format selected below (JSON or query string)","type":"string"},"style":"deepObject"},{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","in":"query","name":"debug","required":false,"schema":{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","type":"boolean"}},{"description":"Syntax of query","in":"header","name":"syntax","required":false,"schema":{"description":"syntax of query","enum":["json","string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Timeline has been received successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Convert 'filters' query string to JSON

> Convert a query string (as used in the UI Dashboard and Events Log) into JSON format.

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/timeline/parse":{"post":{"operationId":"api.dashboard.handler.post_parse_38303596745303976","summary":"Convert 'filters' query string to JSON","description":"Convert a query string (as used in the UI Dashboard and Events Log) into JSON format.","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"query":{"oneOf":[{"type":"string"},{"type":"object"}]}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Filter string has been converted successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```

## Get "top" traffic data

> Get topx stats using 'filters' parameter, explained at \[<https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data]\\(https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)>

```json
{"openapi":"3.0.2","info":{"title":"Link11 WAAP","version":"v4.3"},"paths":{"/api/v4.3/data/topx":{"get":{"operationId":"api.dashboard.handler.get_topx_2280964647653779379","summary":"Get \"top\" traffic data","description":"Get topx stats using 'filters' parameter, explained at [https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data](https://gb.docs.reblaze.com/reference-information/api/api-access-to-traffic-data)","parameters":[{"description":"Filters for request in format selected below (JSON or query string)","in":"query","name":"filters","schema":{"description":"Filters for request in format selected below (JSON or query string)","type":"string"},"style":"deepObject"},{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","in":"query","name":"debug","required":false,"schema":{"description":"if set to true the request will return rendered SQL without running it, for debug purposes","type":"boolean"}},{"description":"if set to true the query will be saved in the query history","in":"query","name":"save_history","required":false,"schema":{"description":"if set to true the query will be saved in the query history","type":"boolean"}},{"description":"Syntax of query","in":"header","name":"syntax","required":false,"schema":{"description":"syntax of query","enum":["json","string_query"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"results":{"type":"array"},"statistics":{"type":"object"}},"required":["statistics","results"],"type":"object"},"status":{"type":"integer"}},"required":["status","data"],"type":"object"}}},"description":"Topx has been received successfully"},"4XX":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"}},"required":["status","detail","title"],"type":"object"}}},"description":"Misconfigured request"}},"tags":["Data queries"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://waap.docs.link11.com/reference-information/api/namespace-reference/data-queries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
