# Report tickets by type

```http
GET https://trydimmi.com/api/v1/reports/tickets/by-type
```

## 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.
  - `created` (integer, required): How many tickets of this type were created in the reported range.
  - `kind` (string, required): What tickets of this type are: customer, back_office or tracker.
  - `name` (string, required): The ticket type's name.
  - `open` (integer, required): How many tickets of this type are open now.
  - `resolved` (integer, required): How many tickets of this type were resolved in the reported range.
  - `type_id` (string, required): Id of the ticket type, such as tktt_....

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

## Example response

```json
{
  "data": [
    {
      "created": 123,
      "kind": "<string>",
      "name": "<string>",
      "open": 123,
      "resolved": 123,
      "type_id": "<string>"
    }
  ]
}
```

---

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