# Report on procedures

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

## Authorization

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

## Query parameters

- `from` (string): First day, YYYY-MM-DD.
- `to` (string): Last day, YYYY-MM-DD.

## Response 200 (OK)

- `data` (object[] | null, required): The items of this page, as a list; empty when nothing matches.
  - `ai_involved` (integer, required): How many of the matched conversations the AI agent took part in.
  - `ai_resolution_rate` (number | null, required): ai_resolved divided by ai_involved, from 0 to 1. Null when the AI was in none.
  - `ai_resolved` (integer, required): How many of those conversations the AI resolved with no teammate reply and no handover.
  - `guard_events` (integer, required): How many times the procedure's guardrails stepped in over the range.
  - `handed_off` (integer, required): How many conversations the AI handed to the team.
  - `handover_rate` (number | null, required): handed_off divided by ai_involved, from 0 to 1. Null when the AI was in none.
  - `matched_conversations` (integer, required): How many conversations the procedure ran in over the range.
  - `mean_rating` (number | null, required): Average customer rating of the rated conversations, on the 1 to 5 scale. Null when none were rated.
  - `name` (string, required): Name of the procedure.
  - `procedure_id` (string, required): Id of the procedure (starts with prc_); send it wherever a procedure is asked for.
  - `rated` (integer, required): How many of the conversations the customer rated.
- `links` (object): Addresses of related pages by name, such as next; left out when there are none.
- `meta` (object, required)
  - `next_cursor` (string | null, required): Send it as cursor to read the next page; null on the last page.
  - `per_page` (integer, required): How many items a page holds at most, such as 25.
  - `prev_cursor` (string | null, required): Send it as cursor to read the page before; null on the first page.
  - `total` (integer): How many items match in all; left out when the list does not count them.

## 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/procedures' \
  --header 'Authorization: Bearer <token>'
```

## Example response

```json
{
  "data": [
    {
      "ai_involved": 123,
      "ai_resolution_rate": 123.45,
      "ai_resolved": 123,
      "guard_events": 123,
      "handed_off": 123,
      "handover_rate": 123.45,
      "matched_conversations": 123,
      "mean_rating": 123.45,
      "name": "<string>",
      "procedure_id": "<string>",
      "rated": 123
    }
  ],
  "links": {
    "<key>": "<string>"
  },
  "meta": {
    "next_cursor": "<string>",
    "per_page": 123,
    "prev_cursor": "<string>",
    "total": 123
  }
}
```

---

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