declined events count

View as Markdown
# Get Declined Requests Count Retrieves detailed metrics about declined requests for a specific project, including counts and trend analysis. This endpoint helps you understand the volume and patterns of blocked traffic, including custom rule violations and bot detection. ## Endpoint ``` GET {base_url}/api/v1/{account_id}/projects/{project_id}/overviews/declined_requests/count ``` ## Authentication Requires API key authentication: ``` Authorization: Bearer {api_key} ``` ## Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `account_id` | string | Yes | Your unique BotBye account identifier | | `project_id` | string | Yes | The project identifier for which to retrieve declined request metrics | ## Query Parameters This endpoint supports time-based filtering parameters to specify the date range for analysis: - **Time period filters** - Specify start/end dates for the analysis period - See [Pagination query parameters](https://botbye.com/docs/api#query-parameters) for additional options ## Response Structure The response returns an object containing declined request metrics and trends: | Field | Type | Description | |-------|------|-------------| | `id` | string | Unique identifier combining `projectId`, `day`, and `hour` (format: `projectId_day_hour`) | | `projectId` | string | The project identifier | | `customerId` | null | Always null for project-level data | | `bannedReqCount` | integer | Number of requests declined by custom rules during this period | | `bannedReqTrend` | float | Percentage change in declined requests compared to previous period (negative = decrease, positive = increase) | | `botReqCount` | integer | Number of requests identified as bot traffic during this period | | `botReqTrend` | float | Percentage change in bot requests compared to previous period | ## Example Response ```json { "id": "185071d5-d4fe-4bea-93df-19d0bd8c2d0d_2024-08-17_0", "projectId": "185071d5-d4fe-4bea-93df-19d0bd8c2d0d", "customerId": null, "bannedReqCount": 56298, "bannedReqTrend": -63.75, "botReqCount": 0, "botReqTrend": 0 } ``` ## Use Cases - **Security Monitoring**: Track the volume of blocked malicious requests - **Trend Analysis**: Identify increases or decreases in attack activity - **Rule Effectiveness**: Measure how many requests your custom rules are blocking - **Bot Detection Metrics**: Monitor automated bot traffic separately from rule-based blocks - **Alert Configuration**: Set up alerts when declined request trends spike - **Security Reporting**: Generate reports showing protection effectiveness over time ## Understanding Trends The trend values indicate percentage changes compared to the previous equivalent time period: - **Negative trend** (e.g., `-63.75`): Declined requests decreased by 63.75% - **Positive trend** (e.g., `+45.20`): Declined requests increased by 45.20% - **Zero trend** (`0`): No change from previous period ## Important Notes - Trends are calculated by comparing to the equivalent previous time period - A decrease in `bannedReqCount` trend may indicate reduced attack activity or rule adjustments - `botReqCount` specifically tracks automated bot traffic detected by BotBye's bot detection algorithms - `bannedReqCount` includes requests blocked by your custom security rules - The `customerId` field is always `null` for project-level aggregations

Path parameters

account_idstringRequired
project_idstringRequired

Query parameters

intervalintegerOptional

(Optional) Defines the interval for the overview. The interval is used in conjunction with intervalType to determine the specific time span of the overview. The default value is 1, meaning the current day (or month if interval_type = month).

interval_typestringOptional

(Optional) Specifies the type of interval for the overview. This can be HOUR, DAY, MONTH. The default value is DAY, meaning the overview will cover a single day.

Response headers

Content-Lengthinteger
Connectionstring

Response

success
idstring
projectIdstringformat: "uuid"
bannedReqCountinteger
bannedReqTrenddouble
botReqCountinteger
botReqTrendinteger
customerIdany

Errors

400
Bad Request Error