# Report service level attainment

```http
GET https://trydimmi.com/api/v1/reports/tickets/sla
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `tickets:read`.

## Query parameters

- `from` (string): First day, 2006-01-02. Defaults to 30 days ago.
- `to` (string): Last day included, 2006-01-02. Defaults to today.

## Response 200 (OK)

- `data` (object[] | null, required): The items, as a list; empty when there are none.
  - `breached` (integer, required): How many clocks of this target ended in the reported range after their deadline.
  - `hit_rate` (number | null, required): Percent of ended clocks that met the target, from 0 to 100. Null when none ended in the range.
  - `mean_met_seconds` (number, required): Average time the met clocks took, in seconds.
  - `met` (integer, required): How many clocks of this target ended in the reported range within their deadline.
  - `policy_id` (string, required): Id of the service level policy, such as sla_....
  - `policy_name` (string, required): Name of the service level policy.
  - `running` (integer, required): How many clocks of this target are running right now.
  - `target` (string, required): Which promise of the policy this row is about. One of: `first_reply`, `next_reply`, `follow_up`, `resolution`.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request GET \
  --url 'https://trydimmi.com/api/v1/reports/tickets/sla' \
  --header 'Authorization: Bearer <token>'
```

## Example response

```json
{
  "data": [
    {
      "breached": 123,
      "hit_rate": 123.45,
      "mean_met_seconds": 123.45,
      "met": 123,
      "policy_id": "<string>",
      "policy_name": "<string>",
      "running": 123,
      "target": "first_reply"
    }
  ]
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
