# Report on workflows

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

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `workflows: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.
  - `completed` (integer, required): Runs in the range that reached the end of their path.
  - `failed` (integer, required): Runs in the range that failed, or where a step failed.
  - `goal` (object, required)
    - `kind` (string, required): What counts as the workflow working: resolved (closed with no teammate reply or handover) or csat (rated at least min_rating).
    - `min_rating` (integer | null, required): With csat, the lowest rating that counts, 1 to 5. Null otherwise.
    - `window` (string, required): How long after the run starts the goal may be reached, such as 7d.
  - `goal_met` (integer | null, required): Runs in the range whose conversation reached the workflow's goal. Null when the workflow has no goal.
  - `handed_over` (integer, required): Runs in the range that handed the conversation to a person.
  - `name` (string, required): The workflow's name.
  - `status` (string, required): Where the workflow stands: draft, live or paused.
  - `trigger` (string, required): The event that starts the workflow, such as conversation.first_message.
  - `triggered` (integer, required): Runs that started in the range and did something. Test conversations never count.
  - `workflow_id` (string, required): Id of the workflow, such as wf_....
- `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/workflows' \
  --header 'Authorization: Bearer <token>'
```

## Example response

```json
{
  "data": [
    {
      "completed": 123,
      "failed": 123,
      "goal": {
        "kind": "<string>",
        "min_rating": 123,
        "window": "<string>"
      },
      "goal_met": 123,
      "handed_over": 123,
      "name": "<string>",
      "status": "<string>",
      "trigger": "<string>",
      "triggered": 123,
      "workflow_id": "<string>"
    }
  ],
  "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)
