Unify and manage your data

Retrieve detailed failed API requests

Use this API to retrieve detailed information about failed API requests. The response includes failure timestamps, endpoint paths, HTTP status codes, latency, user identifiers, and global request IDs.

HTTP method and endpoint

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

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

offsetLongNoNumber of rows to skip before applying the max limitMust be non-negative
maxLongNoMaximum 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/getFailedRequests \
  -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/_search"],
    "users": ["user1@example.com"]
  }'

Response fields

The following table describes the fields returned in the response body.
FieldTypeDescription
RequestTimestampLongTimestamp in milliseconds when the failed request occurred
APIStringAPI endpoint path that failed
httpMethodStringHTTP method used for the failed request (for example, GET, POST)
StatusStringHTTP status code returned for the failed request (for example, 400, 404)
LatencyFloatResponse time in milliseconds for the failed request
UserStringEmail address of the user who made the failed request
GlobalIdStringUnique identifier for the failed request used for tracking and debugging

Example response

The following example shows detailed information for multiple failed API requests.
[
  {
    "RequestTimestamp": 1704100000000,
    "API": "/api/tenant123/entities/_search",
    "httpMethod": "POST",
    "Status": "500",
    "Latency": 478.9,
    "User": "user1@example.com",
    "GlobalId": "1234567890a"
  },
  {
    "RequestTimestamp": 1704101000000,
    "API": "/api/tenant123/configuration",
    "httpMethod": "GET",
    "Status": "403",
    "Latency": 127.3,
    "User": "user2@example.com",
    "GlobalId": "1234567890b"
  }
]