Deskhero Developer Hub
Back to deskhero.com
Stats

Sla

SLA: live deadline counts, attainment verdicts over the window, per-policy results, coverage, and which of the three availability states the section should render. Always answers 200 - "not on this plan" is a state, not an error.

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

Request arguments

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

Response

Status
200 (OK)
Type
DTO_stats_sla
Wrapper
DTO_response_wrap
Other statuses
400 (BadRequest), 403 (Forbidden)
Response body example
DTO_stats_sla
NameTypeReadOnlyDescription
policiesDTO_stats_sla_policy[]Policies
matrix_groupsDTO_stats_term[]Group rows of the group x priority attainment matrix.
matrix_prioritiesDTO_stats_term[]Priority columns of the matrix.
periodDTO_stats_periodPeriod
stateENUM stats_sla_stateWhich of the three SLA surfaces to render.
measuring_sinceDateTime (nullable)The earliest moment this workspace could have measured anything (first policy created). Comparisons whose previous window starts before this render as "insufficient history" rather than as a fabricated delta. Null when nothing is configured.
right_nowDTO_stats_sla_right_nowLive deadline counts. Null when SLA is not available or not configured.
first_reply_pctDTO_stats_metricShare of measured first replies that beat their deadline, as a percentage.
resolution_pctDTO_stats_metricResolution pct
first_reply_measuredInt32Tickets whose first-reply clock finished in the window (on time + late).
first_reply_on_timeInt32First reply on time
first_reply_lateInt32First reply late
resolution_measuredInt32Resolution measured
resolution_on_timeInt32Resolution on time
resolution_lateInt32Resolution late
first_reply_met_by_aiInt32Of first replies that beat their deadline, how many came from the AI auto-reply.
first_reply_met_by_userInt32First reply met by user
first_reply_ai_share_pctDTO_stats_metricThe AI share of on-time first replies, as a percentage.
attainment_seriesDTO_stats_series[]Attainment per bucket: one series per clock, values in percent.
verdict_seriesDTO_stats_series[]The same first-reply data as counts, for the stacked on-time/late card.
matrix_valuesList`1[]First-reply attainment per group x priority cell, in percent. Null where too few tickets were measured to say anything - the card leaves those blank on purpose.
matrix_minimum_measuredInt32Cells with fewer measured tickets than this are reported as null.
late_by_weekdayDTO_stats_term[]Late first replies by the weekday the ticket arrived, Monday first.
coverage_measuredInt32Tickets in the window held to a policy with at least one target.
coverage_unmeasuredDTO_stats_term[]Why the rest were not measured. The keys are CREATED_BY_USER, BEFORE_ROLLOUT and NO_SLA_RULE; together with coverage_measured they add up to the window's ticket total.
coverage_totalInt32Coverage total
DTO_stats_sla_policy
NameTypeReadOnlyDescription
idInt320 for the synthetic "no policy" row.
nameStringName
first_reply_minutesInt32 (nullable)Target in minutes, or null when this policy does not promise a first reply.
resolution_minutesInt32 (nullable)Resolution minutes
schedule_nameStringBusiness schedule name, or null when the policy counts calendar hours.
is_deletedBooleanTrue when the policy no longer exists but tickets still point at it.
ticketsInt32Tickets in the window stamped with this policy.
first_reply_measuredInt32First reply measured
first_reply_pctDouble (nullable)First reply pct
resolution_measuredInt32Resolution measured
resolution_pctDouble (nullable)Resolution pct
lateInt32Late verdicts on either clock.
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_sla_right_now
NameTypeReadOnlyDescription
breachedInt32Deadline already passed.
due_within_1hInt32Due inside the shared 60-minute at-risk window.
due_within_24hInt32Due after the at-risk window but inside 24 hours.
due_laterInt32Due more than 24 hours from now.
pausedInt32Resolution clock parked in a pause status (typically waiting on the customer).
open_totalInt32Open tickets across all non-closed statuses, for the card's context line.
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.
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.
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
ENUM stats_sla_state
ValueNameDescription
0UNKNOWNUNKNOWN
1NOT_AVAILABLEThe workspace's plan (or the global kill switch) does not include SLA.
2NOT_CONFIGUREDSLA is available but no policy has been created, so nothing is measured yet.
3HAS_DATAPolicies exist - render the real thing.

Generated Aug 4, 2026 18:37