Departments Statistics
Returns a list of departments along with their incident counts, resolution time metrics, SLA compliance, and trend data.Endpoint
GET /hubspot/stats/departments/:startDate/:endDate
URL Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
startDate | string | ✅ | Start date (YYYY-MM-DD) |
endDate | string | ✅ | End date (YYYY-MM-DD) |
Request Headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer <token> | Authentication token |
No request body is required.
Response
Success Response (HTTP 200)
Field Descriptions
departments[]
| Field | Description |
|---|---|
name | Department name |
generalStats.open | Number of open incidents |
generalStats.closed | Number of closed incidents |
generalStats.total | Total number of incidents |
resolution.times | Statistical resolution time metrics |
resolution.sla | SLA compliance metrics |
trend.series | Values used for time-based charting |
trend.labels | Dates corresponding to the trend series |
Error Response (HTTP 400–500)
Any non-200 response indicates failure.
Authentication
A valid JWT token must be included in the Authorization header.Example Request (cURL)
Example Request (JavaScript - fetch)
Notes
- Dates must follow the
YYYY-MM-DDformat. - Trend series and labels can be used directly to plot charts for each department.