Unify and manage your data

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

Use the following HTTP method and endpoint path to submit the request for retrieving failed requests by status code.
POST /statistics-reporting/{tenantId}/API/failedRequestsByStatus

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: prod, qa, dev

Default: none

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/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

The following table describes the fields returned in the response body.
FieldTypeDescription
StatusStringHTTP status code returned by the failed requests
ErrorCountIntegerTotal number of failed requests for the given status code

Example response

The following example shows error counts grouped by HTTP status code.
[
  {
    "Status": "404",
    "ErrorCount": 234
  },
  {
    "Status": "401",
    "ErrorCount": 187
  },
  {
    "Status": "400",
    "ErrorCount": 156
  },
  {
    "Status": "500",
    "ErrorCount": 89
  },
  {
    "Status": "403",
    "ErrorCount": 32
  }
]