# Get a procedure's metrics

```http
GET https://trydimmi.com/api/v1/procedures/{procedure}/metrics
```

## Authorization

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

## Path parameters

- `procedure` (string, required): Id of the AI agent procedure, starting with prc_, such as prc_01jx2m8k4t. Find it with GET /procedures.

## Query parameters

- `days` (integer): How many days back, up to 90.
- `version` (string): Only conversations on this published version.

## Response 200 (OK)

- `data` (object, required)
  - `actions` (object[] | null, required): How each action fared in the procedure's runs: calls, failures and average time.
    - `action_id` (string, required): Id of the workspace action (starts with aac_).
    - `calls` (integer, required): How many times the action was called in runs that followed the procedure.
    - `error_rate` (number | null, required): Share of those calls that failed, from 0 to 1. Null when there were no calls.
    - `failed` (integer, required): How many of those calls failed.
    - `mean_latency_ms` (number, required): How long a call took on average, in milliseconds.
    - `name` (string, required): Name of the action.
  - `ai_assumed` (integer, required): Conversations counted as resolved by the AI without the customer confirming it: ai_resolved minus ai_confirmed.
  - `ai_confirmed` (integer, required): Conversations the AI resolved where the customer confirmed it was solved.
  - `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): Conversations the AI resolved with no teammate reply and no handover: confirmed, closed, or left quiet after its last answer.
  - `csat` (object, required)
    - `mean` (number | null, required): Average customer rating of the rated conversations, on the 1 to 5 scale. Null when none were rated.
    - `positive` (integer, required): How many conversations were rated 4 or 5.
    - `positive_rate` (number | null, required): Share of rated conversations rated 4 or 5, from 0 to 1. Null when none were rated.
    - `rated` (integer, required): How many of the conversations the customer rated.
  - `days` (integer, required): How many days back the numbers cover.
  - `guardrails` (object, required): How often each kind of guardrail stepped in, as an object of guardrail kind to count. Empty when none did.
  - `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.
  - `handover_reasons` (object[] | null, required): The handovers counted by why, most common first.
    - `conversations` (integer, required): How many conversations were handed to the team for this reason.
    - `kind` (string, required): What sort of reason it is: intentional (the procedure asked), customer (the customer asked), guardrail (one stepped in) or failure (something broke).
    - `reason` (string, required): The handover reason as recorded, such as customer_requested, procedure_guard or provider_error; other when none was given.
  - `matched_conversations` (integer, required): How many conversations the procedure ran in over the range.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `procedure_id` (string, required): Id of the procedure these numbers are for (starts with prc_).
  - `runs` (object[] | null, required): The runs behind the numbers, newest first, for drilling into what went wrong.
    - `conversation_id` (string | null, required): Id of the conversation the run was in (starts with conv_). Null when it has none.
    - `conversation_number` (integer, required): Number of the conversation the run was in.
    - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
    - `handoff_reason` (string | null, required): Why the run handed the conversation to the team, such as customer_requested or provider_error. Null when it did not.
    - `outcome` (string | null, required): How the run ended, such as answered, handoff, unknown, silent, refused, skipped or error. Null when not recorded.
    - `procedure_trace` (any): What the procedure did in this run, as a JSON object with its version, the steps reached and any guardrail events. Left out when there is none.
    - `rating` (integer | null, required): The customer's rating of the conversation, from 1 (worst) to 5 (best). Null when not rated.
    - `reopens` (integer, required): How many times the conversation was reopened.
    - `run_id` (string, required): Id of the AI run (starts with air_); read that run for its full steps.
  - `steps` (object[] | null, required): How far conversations got through each step of the procedure.
    - `completion_rate` (number | null, required): done divided by reached, from 0 to 1. Null when no conversation reached the step.
    - `done` (integer, required): How many conversations finished the step.
    - `reached` (integer, required): How many conversations reached the step.
    - `step_id` (string, required): Id of the step inside the procedure's definition.
    - `took_else` (integer, required): How many conversations took the else side of this step's condition.
    - `took_then` (integer, required): How many conversations took the then side of this step's condition.
  - `version` (integer | null, required): The published version number these numbers are narrowed to. Null when every version is counted.

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

## Example response

```json
{
  "data": {
    "actions": [
      {
        "action_id": "<string>",
        "calls": 123,
        "error_rate": 123.45,
        "failed": 123,
        "mean_latency_ms": 123.45,
        "name": "<string>"
      }
    ],
    "ai_assumed": 123,
    "ai_confirmed": 123,
    "ai_involved": 123,
    "ai_resolution_rate": 123.45,
    "ai_resolved": 123,
    "csat": {
      "mean": 123.45,
      "positive": 123,
      "positive_rate": 123.45,
      "rated": 123
    },
    "days": 123,
    "guardrails": {
      "<key>": 123
    },
    "handed_off": 123,
    "handover_rate": 123.45,
    "handover_reasons": [
      {
        "conversations": 123,
        "kind": "<string>",
        "reason": "<string>"
      }
    ],
    "matched_conversations": 123,
    "object": "<string>",
    "procedure_id": "<string>",
    "runs": [
      {
        "conversation_id": "<string>",
        "conversation_number": 123,
        "created_at": "2026-11-01T09:30:00Z",
        "handoff_reason": "<string>",
        "outcome": "<string>",
        "procedure_trace": null,
        "rating": 123,
        "reopens": 123,
        "run_id": "<string>"
      }
    ],
    "steps": [
      {
        "completion_rate": 123.45,
        "done": 123,
        "reached": 123,
        "step_id": "<string>",
        "took_else": 123,
        "took_then": 123
      }
    ],
    "version": 123
  }
}
```

---

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