Get Incident Report Metrics
Method: GET
/api/v1/incident-reports/metrics
Description
This endpoint retrieves metrics for incident reports. You can filter and group the metrics based on various criteria, such as incident status, date range, user actions, and more.
🔑 Authentication
This endpoint requires authentication via headers.
| Param | Value | Type |
|---|---|---|
tenantId | {{tenantId}} | string |
userId | {{userId}} | string |
countryCode | {{countryCode}} | string (optional) |
Query Parameters
| Name | Type | Description |
|---|---|---|
incidentSearch | string | Search for incidents by keyword or term. |
groupBy | string | Group metrics by fields (comma-separated list). Available values: CREATED_BY, DELETED_BY, UPDATED_BY, PRODUCT_ID, PRODUCT_USER, TRADE_PRODUCT_ID, TRADE_STATE, TRADE_CITY, TRADE_BUYER, TRADE_SELLER, SELLER_TYPE. |
metricDateRange | string | Filter metrics by date range (e.g., 2020-11-12,2022-11-15). |
byValueType | string | The time unit to use when filtering by value. Available values: HOUR, DAY, DAY_OF_WEEK, WEEK, MONTH. |
byValue | number | A numeric value to filter metrics by (must be used with byValueType). |
incidentDateRange | string | Filter incidents by date range (e.g., 2020-11-12,2022-11-15). |
byTrackingId | string | Filter metrics by tracking ID. |
byIncidentStatus | string | Filter metrics by incident status. |
byModelType | string | Filter by model type (comma-separated list). Available values: TRADE, PRODUCT, SHIPMENT. |
byModelIds | string | Filter metrics by model IDs (comma-separated). |
byCreatedByIds | string | Filter metrics by the IDs of users who created the incidents. |
order | string | Sort results by ascending (ASC) or descending (DESC). |
Response: 200 OK
A successful response returns the requested incident report metrics based on the provided filters.
Example Response:
{
"totalIncidents": 250,
"groupedMetrics": [
{
"groupBy": "TRADE_SELLER",
"value": "Seller123",
"incidentCount": 50
},
{
"groupBy": "TRADE_BUYER",
"value": "Buyer456",
"incidentCount": 30
}
],
"dateRange": "2020-11-12,2022-11-15"
}
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/incident-reports/metrics \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!