Incidents Trend
Retrieve the trend of incidents for a given date range.This endpoint returns:
labels: an array of dates in the intervalseries: number of incidents for each corresponding date
Endpoint
GET /hubspot/stats/incidents-trend/:startDate/:endDate
URL Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
startDate | string | ✅ | Start date of the range (YYYY-MM-DD) |
endDate | string | ✅ | End date of the range (YYYY-MM-DD) |
Request Headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer <token> | User authentication token |
Note: No request body is required.
Response
Success Response (HTTP 200)
labels: Dates betweenstartDateandendDateseries: Number of incidents created on each date
Error Response (HTTP 400–500)
Any non-200 status code indicates an error.
Authentication
This endpoint requires user authentication viaAuthorization: Bearer <token>.No user data should be sent — it is populated internally.
Example Request (cURL)
Example Request (JavaScript - fetch)
Notes
- Dates must follow
YYYY-MM-DDformat. - Dates without incidents will appear in
labelswith0count inseries. - Trend calculation is computed server-side using the ticket creation date.