Retrieve failed API requests by endpoint
Use this API to retrieve failed request statistics by endpoint and HTTP status code. The response includes the number of errors for each endpoint and status combination during the specified time period.
HTTP method and endpoint
POST /statistics-reporting/{tenantId}/API/failedRequestsByEndpoint
Replace {tenantId} with the ID of the target tenant.
Request headers
The following request headers must be included.
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Authorization | Bearer {access_token} | Yes |
Request body
| 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: Default: none |
offset | Long | Yes | Number of rows to skip before applying the max limit | Must be non-negative |
max | Long | Yes | Maximum number of rows to return | Must be non-negative |
queryTypes | Array | No | Filters by query type |
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/failedRequestsByEndpoint \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"from": 1720867200000,
"to": 1721016000000,
"env": "prod",
"offset": 0,
"max": 100,
"httpMethods": ["POST"],
"apiEndPoints": ["/api/tenant123/entities"],
"users": ["user1@example.com"]
}'
Response fields
| Field | Type | Description |
|---|---|---|
API | String | API endpoint path that was called |
Status | String | HTTP status code returned by the failed requests |
ErrorCount | Integer | Total number of failed requests for the given API endpoint and HTTP status code |
Example response
[
{
"API": "GET /api/tenant123/entities/{id}",
"Status": "404",
"ErrorCount": 125
},
{
"API": "POST /api/tenant123/users/authenticate",
"Status": "401",
"ErrorCount": 87
},
{
"API": "GET /api/tenant123/entities/_search",
"Status": "400",
"ErrorCount": 42
},
{
"API": "POST /api/tenant123/entities",
"Status": "500",
"ErrorCount": 31
},
{
"API": "GET /api/tenant123/configuration",
"Status": "403",
"ErrorCount": 23
}
]