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_ids | Int32[] | Query |
| sla_rule_ids | Int32[] | Query |
| timeframe | ENUM dashboard_kpi_timeframe | |
| from | DateTime | |
| to | DateTime | |
| compare | Boolean | |
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
| Name | Type | ReadOnly | Description |
| policies | DTO_stats_sla_policy[] | | Policies |
| matrix_groups | DTO_stats_term[] | | Group rows of the group x priority attainment matrix. |
| matrix_priorities | DTO_stats_term[] | | Priority columns of the matrix. |
| period | DTO_stats_period | | Period |
| state | ENUM stats_sla_state | | Which of the three SLA surfaces to render. |
| measuring_since | DateTime (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_now | DTO_stats_sla_right_now | | Live deadline counts. Null when SLA is not available or not configured. |
| first_reply_pct | DTO_stats_metric | | Share of measured first replies that beat their deadline, as a percentage. |
| resolution_pct | DTO_stats_metric | | Resolution pct |
| first_reply_measured | Int32 | | Tickets whose first-reply clock finished in the window (on time + late). |
| first_reply_on_time | Int32 | | First reply on time |
| first_reply_late | Int32 | | First reply late |
| resolution_measured | Int32 | | Resolution measured |
| resolution_on_time | Int32 | | Resolution on time |
| resolution_late | Int32 | | Resolution late |
| first_reply_met_by_ai | Int32 | | Of first replies that beat their deadline, how many came from the AI auto-reply. |
| first_reply_met_by_user | Int32 | | First reply met by user |
| first_reply_ai_share_pct | DTO_stats_metric | | The AI share of on-time first replies, as a percentage. |
| attainment_series | DTO_stats_series[] | | Attainment per bucket: one series per clock, values in percent. |
| verdict_series | DTO_stats_series[] | | The same first-reply data as counts, for the stacked on-time/late card. |
| matrix_values | List`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_measured | Int32 | | Cells with fewer measured tickets than this are reported as null. |
| late_by_weekday | DTO_stats_term[] | | Late first replies by the weekday the ticket arrived, Monday first. |
| coverage_measured | Int32 | | Tickets in the window held to a policy with at least one target. |
| coverage_unmeasured | DTO_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_total | Int32 | | Coverage total |
DTO_stats_sla_policy
| Name | Type | ReadOnly | Description |
| id | Int32 | | 0 for the synthetic "no policy" row. |
| name | String | | Name |
| first_reply_minutes | Int32 (nullable) | | Target in minutes, or null when this policy does not promise a first reply. |
| resolution_minutes | Int32 (nullable) | | Resolution minutes |
| schedule_name | String | | Business schedule name, or null when the policy counts calendar hours. |
| is_deleted | Boolean | | True when the policy no longer exists but tickets still point at it. |
| tickets | Int32 | | Tickets in the window stamped with this policy. |
| first_reply_measured | Int32 | | First reply measured |
| first_reply_pct | Double (nullable) | | First reply pct |
| resolution_measured | Int32 | | Resolution measured |
| resolution_pct | Double (nullable) | | Resolution pct |
| late | Int32 | | Late verdicts on either clock. |
DTO_stats_term
| Name | Type | ReadOnly | Description |
| id | Int32 | | Entity id when the term refers to one (group, status, mailbox); 0 otherwise. |
| key | String | | Stable key for terms that are enums rather than entities ("EMAIL", "CHAT_BOT"). |
| label | String | | Label |
| count | Int32 | | How many tickets fell into this term. |
| previous_count | Int32 (nullable) | | The term's own count in the comparison window. Null when not comparing. |
| value | Double (nullable) | | A secondary metric where the card shows one (average seconds, a percentage). |
DTO_stats_period
| Name | Type | ReadOnly | Description |
| from | DateTime | | First day of the window, workspace-local. |
| to | DateTime | | Last day of the window, workspace-local. |
| previous_from | DateTime (nullable) | | First day of the comparison window. Null when not comparing. |
| previous_to | DateTime (nullable) | | Last day of the comparison window. Null when not comparing. |
| time_zone | String | | IANA id of the zone every bucket and boundary was cut in. |
| granularity | String | | "hour", "day" or "month" - the width of one point in every series below. |
| timeframe | ENUM dashboard_kpi_timeframe | | Which preset produced this window (CUSTOM when from/to were supplied). |
| compare | Boolean | | True when the previous-period figures are populated. |
DTO_stats_sla_right_now
| Name | Type | ReadOnly | Description |
| breached | Int32 | | Deadline already passed. |
| due_within_1h | Int32 | | Due inside the shared 60-minute at-risk window. |
| due_within_24h | Int32 | | Due after the at-risk window but inside 24 hours. |
| due_later | Int32 | | Due more than 24 hours from now. |
| paused | Int32 | | Resolution clock parked in a pause status (typically waiting on the customer). |
| open_total | Int32 | | Open tickets across all non-closed statuses, for the card's context line. |
DTO_stats_metric
| Name | Type | ReadOnly | Description |
| current | Double (nullable) | | Current |
| previous | Double (nullable) | | The same figure over the previous window. Null when not comparing, or when there is no history. |
DTO_stats_series
| Name | Type | ReadOnly | Description |
| key | String | | Stable key the frontend maps to a colour and a translated label. |
| label | String | | Server-side fallback label, used when the key is dynamic (a group or status name). |
| points | DTO_stats_point[] | | Points |
DTO_stats_point
| Name | Type | ReadOnly | Description |
| label | String | | Short human label for the axis ("Jul 20", "10:00", "Jul 2026"). |
| date | DateTime | | Start of the bucket, workspace-local. |
| value | Double (nullable) | | Null means "no data in this bucket", which a chart draws as a gap, not a zero. |
ENUM dashboard_kpi_timeframe
| Value | Name | Description |
| 0 | UNKNOWN | UNKNOWN |
| 1 | TODAY | TODAY |
| 2 | YESTERDAY | YESTERDAY |
| 3 | THIS_WEEK | THIS_WEEK |
| 4 | LAST_4_WEEKS | LAST_4_WEEKS |
| 5 | LAST_12_WEEKS | LAST_12_WEEKS |
| 6 | ALL_TIME | ALL_TIME |
| 7 | CUSTOM | Stats only: the caller supplies from and to instead. Resolving this without dates is
an error, so the shared GetTimeFrame() extension deliberately refuses it. |
| 8 | LAST_12_MONTHS | LAST_12_MONTHS |
ENUM stats_sla_state
| Value | Name | Description |
| 0 | UNKNOWN | UNKNOWN |
| 1 | NOT_AVAILABLE | The workspace's plan (or the global kill switch) does not include SLA. |
| 2 | NOT_CONFIGURED | SLA is available but no policy has been created, so nothing is measured yet. |
| 3 | HAS_DATA | Policies exist - render the real thing. |
Generated Aug 4, 2026 18:37