Deskhero Developer Hub
Back to deskhero.com
Stats

Trends

Ticket volume: created versus resolved over time, the channel split, the breakdowns the Overview tab reuses, and the hour-of-week arrival heatmap.

GET /api/{tenant:minlength(2)}/v{version:apiVersion}/stats/trends
Authorisation
Minimum role: USER

Request arguments

Name Type Source
group_idsInt32[]Query
timeframeENUM dashboard_kpi_timeframe
fromDateTime
toDateTime
compareBoolean
Request body example

Response

Status
200 (OK)
Type
DTO_stats_trends
Wrapper
DTO_response_wrap
Other statuses
400 (BadRequest), 403 (Forbidden)
Response body example
NameTypeReadOnlyDescription
channel_seriesDTO_stats_series[]Tickets per bucket per channel, ready to stack.
channelsDTO_stats_term[]Channels
prioritiesDTO_stats_term[]Priorities
statusesDTO_stats_term[]Statuses
tagsDTO_stats_term[]Tags
languagesDTO_stats_term[]Languages
groupsDTO_stats_term[]Groups
periodDTO_stats_periodPeriod
created_totalDTO_stats_metricTickets created in the window.
resolved_totalDTO_stats_metricTimes a ticket entered a closed status in the window. Independent of created_total: a backlog-clearing week resolves more than it takes in, and that is the point of the card.
open_nowInt32Open tickets right now, across all non-closed statuses. Not window-scoped.
volume_seriesDTO_stats_series[]Created and resolved, one point per bucket.
hour_weekday_matrixList`1[]Average new tickets per hour of the week, [weekday 0=Monday][hour 0-23], folded from the hourly histogram in the workspace time zone.
busiest_slot_labelStringEnglish fallback label of the busiest cell ("Tue 10:00"), or null when there is no data. The frontend renders the weekday/hour pair below with its own localized weekday names.
busiest_slot_weekdayInt32 (nullable)Busiest cell's weekday, 0=Monday - same row order as the matrix. Null when no data.
busiest_slot_hourInt32 (nullable)Busiest cell's hour, 0-23, workspace time zone. Null when no data.
busiest_slot_averageDouble (nullable)Average new tickets in that cell.
DTO_stats_series
NameTypeReadOnlyDescription
keyStringStable key the frontend maps to a colour and a translated label.
labelStringServer-side fallback label, used when the key is dynamic (a group or status name).
pointsDTO_stats_point[]Points
DTO_stats_point
NameTypeReadOnlyDescription
labelStringShort human label for the axis ("Jul 20", "10:00", "Jul 2026").
dateDateTimeStart of the bucket, workspace-local.
valueDouble (nullable)Null means "no data in this bucket", which a chart draws as a gap, not a zero.
DTO_stats_term
NameTypeReadOnlyDescription
idInt32Entity id when the term refers to one (group, status, mailbox); 0 otherwise.
keyStringStable key for terms that are enums rather than entities ("EMAIL", "CHAT_BOT").
labelStringLabel
countInt32How many tickets fell into this term.
previous_countInt32 (nullable)The term's own count in the comparison window. Null when not comparing.
valueDouble (nullable)A secondary metric where the card shows one (average seconds, a percentage).
DTO_stats_period
NameTypeReadOnlyDescription
fromDateTimeFirst day of the window, workspace-local.
toDateTimeLast day of the window, workspace-local.
previous_fromDateTime (nullable)First day of the comparison window. Null when not comparing.
previous_toDateTime (nullable)Last day of the comparison window. Null when not comparing.
time_zoneStringIANA id of the zone every bucket and boundary was cut in.
granularityString"hour", "day" or "month" - the width of one point in every series below.
timeframeENUM dashboard_kpi_timeframeWhich preset produced this window (CUSTOM when from/to were supplied).
compareBooleanTrue when the previous-period figures are populated.
DTO_stats_metric
NameTypeReadOnlyDescription
currentDouble (nullable)Current
previousDouble (nullable)The same figure over the previous window. Null when not comparing, or when there is no history.
ENUM dashboard_kpi_timeframe
ValueNameDescription
0UNKNOWNUNKNOWN
1TODAYTODAY
2YESTERDAYYESTERDAY
3THIS_WEEKTHIS_WEEK
4LAST_4_WEEKSLAST_4_WEEKS
5LAST_12_WEEKSLAST_12_WEEKS
6ALL_TIMEALL_TIME
7CUSTOMStats only: the caller supplies from and to instead. Resolving this without dates is an error, so the shared GetTimeFrame() extension deliberately refuses it.
8LAST_12_MONTHSLAST_12_MONTHS

Generated Aug 4, 2026 18:37