Retrieve failed API requests by status code
Use this API to retrieve the total number of failed API requests grouped by HTTP status code. The results reflect failure counts for each error code within the selected time period.
HTTP method and endpoint
POST /statistics-reporting/{tenantId}/API/failedRequestsByStatus
Replace {tenantId} with the ID of the target tenant.
Request headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Authorization | Bearer {access_token} | Yes |
Request body
The following table describes the request body parameters, including accepted values and defaults.
| Parameter | Type | Required | Description | Accepted values / Default |
|---|---|---|---|---|
from (1) | Long | Yes | Start time in epoch milliseconds | — |
to (1) | Long | Yes | End time in epoch milliseconds | — |
env | String | Yes | Target environment |
Example: prod, qa, dev
Default: none |
queryTypes | Array | No | Filters by query type |
Read, Write, Search, Merge, Graphs
Default: all |
httpMethods | Array | No | Filters by HTTP methods |
Example:
Default: all methods |
apiEndPoints | Array | No | Filters by API paths |
Example:
Default: all |
users | Array | No | Filters by user email addresses |
Example:
Default: all users |
Note:
| ||||
Example request
curl -X POST https://{baseUrl}/statistics-reporting/{tenantId}/API/failedRequestsByStatus \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"from": 1720867200000,
"to": 1721016000000,
"env": "prod",
"httpMethods": ["POST"],
"apiEndPoints": ["/api/tenant123/entities"],
"users": ["user1@example.com"]
}'
Response fields
| Field | Type | Description |
|---|---|---|
Status | String | HTTP status code returned by the failed requests |
ErrorCount | Integer | Total number of failed requests for the given status code |
Example response
[
{
"Status": "404",
"ErrorCount": 234
},
{
"Status": "401",
"ErrorCount": 187
},
{
"Status": "400",
"ErrorCount": 156
},
{
"Status": "500",
"ErrorCount": 89
},
{
"Status": "403",
"ErrorCount": 32
}
]