Unify and manage your data

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

Use the following HTTP method and endpoint path to submit the request for retrieving failed API requests by 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.

HeaderValueRequired
Content-Typeapplication/jsonYes
AuthorizationBearer {access_token}Yes

Request body

The following table describes the request body parameters, including accepted values and defaults.
ParameterTypeRequiredDescriptionAccepted values / Default
from (1)LongYesStart time in epoch milliseconds
to (1)LongYesEnd time in epoch milliseconds
envStringYesTarget environment

Example: 361 , tst-01 , na07-prod, na07-test, na07-dev

Default: none

offsetLongYesNumber of rows to skip before applying the max limitMust be non-negative
maxLongYesMaximum number of rows to returnMust be non-negative
queryTypesArrayNoFilters by query type

Read, Write, Search, Merge, Graphs

Default: all

httpMethodsArrayNoFilters by HTTP methods

Example: POST, GET

Default: all methods

apiEndPointsArrayNoFilters by API paths

Example: /api/{tenantId}/entities

Default: all

usersArrayNoFilters by user email addresses

Example: user1@example.com

Default: all users

Note:
  1. The time range defined by the from and to values must not exceed one month. If the specified range exceeds the allowed limit, the API returns an HTTP 416 Range Not Satisfiable error with the following response:
    {
      "errors": [
        {
          "message": "Invalid time range."
        }
      ]
    }
    

Example request

Use the following example to see how a complete request is structured with headers and a JSON body.
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

The following table describes the fields returned in the response body.
FieldTypeDescription
APIStringAPI endpoint path that was called
StatusStringHTTP status code returned by the failed requests
ErrorCountIntegerTotal number of failed requests for the given API endpoint and HTTP status code

Example response

The following example shows failed request counts for multiple API endpoints by HTTP status code.
[
  {
    "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
  }
]