# Get usage by product

`GET https://evohub.io/api/v1/evotrail/usage`

Part of the [EvoTrail API](https://docs-dev.evohub.io/evotrail.md) reference · operationId `getUsage`.

For each product the key may read: actions and active people in the range,
compared with the previous period of the same length, a series (hourly for a
range of 48 hours or less with no team or person filter, daily otherwise), and
the top 10 actions and teams. Every number carries a `drill`: the audit-trail
filters that list the events behind it.

**Permission (API-key scope):** `evotrail:metrics:read`. Each product also needs one of its read permissions.

## Authorization

Any one of:

- `bearerAuth` (evotrail:metrics:read)
- `apiKeyHeader` (evotrail:metrics:read)

Where:

- `bearerAuth`: HTTP Bearer — An EvoHub API key (`evohub_…`) as a bearer token.
- `apiKeyHeader`: API key in the header `X-API-Key` — An EvoHub API key (`evohub_…`).

## Query parameters

- `product` (array of Product): Only these products; repeat it (`product=oncall&product=uptime`) or comma-separate. Products the key cannot read are dropped. Default: every product it can read.
- `team_id` (string): Only events on this team's resources.
- `actor_id` (string): Only this person's events. Owners and administrators only: an API key always gets 403.
- `from` (string, example `2026-09-10`): `YYYY-MM-DD` (UTC) or RFC 3339. Default 30 days before `to`.
- `to` (string, example `2026-10-09`): `YYYY-MM-DD` (inclusive) or RFC 3339. Default now.

## Responses

### 200 — Usage.

Content type: `application/json`

Type: `object`

- `data` (UsageView, required)
  - `from` (string (date-time))
  - `to` (string (date-time))
  - `previous_from` (string (date-time)): Start of the previous period of the same length, which deltas compare with.
  - `granularity` (string, one of `hour`, `day`)
  - `totals` (object)
    - `actions` (integer)
    - `previous_actions` (integer)
    - `delta_pct` (number | null): `null` when the previous period had none.
    - `active_people` (integer)
    - `previous_active_people` (integer)
    - `drill` (Drill)
      - `product` (array of string)
      - `action` (string)
      - `team_id` (string)
      - `actor_id` (string)
      - `from` (string (date-time), required)
      - `to` (string (date-time), required)
  - `products` (array of object)
    - `product` (Product, one of `organization`, `oncall`, `uptime`, `status`, `docs`, `changelog`, `board`, `retro`, `support`, `catalog`, `evotrail`)
    - `actions` (integer)
    - `previous_actions` (integer)
    - `delta_pct` (number | null)
    - `active_people` (integer)
    - `last_active_day` (string (date) | null)
    - `series` (array of Point)
      - `t` (string (date-time))
      - `count` (integer)
      - `drill` (Drill)
    - `drill` (Drill)
      - `product` (array of string)
      - `action` (string)
      - `team_id` (string)
      - `actor_id` (string)
      - `from` (string (date-time), required)
      - `to` (string (date-time), required)
  - `top_actions` (array of object, max items 10)
    - `product` (string)
    - `action` (string)
    - `count` (integer)
    - `drill` (Drill)
      - `product` (array of string)
      - `action` (string)
      - `team_id` (string)
      - `actor_id` (string)
      - `from` (string (date-time), required)
      - `to` (string (date-time), required)
  - `top_teams` (array of object, max items 10)
    - `team_id` (string)
    - `actions` (integer)
    - `active_people` (integer)
    - `drill` (Drill)
      - `product` (array of string)
      - `action` (string)
      - `team_id` (string)
      - `actor_id` (string)
      - `from` (string (date-time), required)
      - `to` (string (date-time), required)
  - `quiet_products` (array of object): Readable products with no action in the range.
    - `product` (string)
    - `last_active_day` (string (date) | null)
- `success` (boolean, required, value `true`)

### 400 — A range or filter is not valid (`VALIDATION_ERROR`); the message names it.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required): Machine-readable code. Branch on this.
  - `message` (string, required): Human-readable explanation.
  - `request_id` (string): This request's id, also in `X-Request-ID`.
- `success` (boolean, value `false`)

### 401 — No API key was sent, or it is unknown, revoked or expired (`UNAUTHORIZED`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required): Machine-readable code. Branch on this.
  - `message` (string, required): Human-readable explanation.
  - `request_id` (string): This request's id, also in `X-Request-ID`.
- `success` (boolean, value `false`)

### 403 — The key lacks the scope, may read none of the products asked for, or used `actor_id` (`FORBIDDEN`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required): Machine-readable code. Branch on this.
  - `message` (string, required): Human-readable explanation.
  - `request_id` (string): This request's id, also in `X-Request-ID`.
- `success` (boolean, value `false`)

### 429 — Too many requests (`RATE_LIMITED`). Wait `Retry-After` seconds.

Headers:

- `Retry-After` (integer): Seconds to wait.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required): Machine-readable code. Branch on this.
  - `message` (string, required): Human-readable explanation.
  - `request_id` (string): This request's id, also in `X-Request-ID`.
- `success` (boolean, value `false`)

### 500 — Something went wrong on EvoHub's side (`INTERNAL_ERROR`). Retry later.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required): Machine-readable code. Branch on this.
  - `message` (string, required): Human-readable explanation.
  - `request_id` (string): This request's id, also in `X-Request-ID`.
- `success` (boolean, value `false`)

## Example request

```bash
curl -X GET 'https://evohub.io/api/v1/evotrail/usage' \
  -H 'Authorization: Bearer <TOKEN>'
```
