---
title: "Get user usage by company"
method: GET
path: "/user-usage-by-company"
tags: ["entitlements"]
---

# Get user usage by company

`GET /user-usage-by-company`

## Query parameters

- `company_id` string, required — Company to break usage down for
- `end_time` string, date-time — End of the usage window (exclusive); defaults to now
- `feature_id` string — Restrict to a single event-based feature
- `start_time` string, date-time — Start of the usage window; defaults to 30 days before the end

## Response `200`

OK

- object
  - `data` UserUsageByCompanyResponseData, required
    - `credits` UserCreditUsageResponseData[], required — Per-user net credit consumption within the window
      - `billing_credit_id` string, required
      - `credit_name` string, required — The display name of the credit type
      - `credits_used` number, double, required — The user's net track-driven consumption of the credit within the window (draws minus refunds)
      - `share` number, double, required — This row's fraction (0-1) of the company's total track-driven consumption of the credit within the window, including unattributed consumption
      - `user` UserResponseData
        - `created_at` string, date-time, required
        - `environment_id` string, required
        - `id` string, required
        - `last_seen_at` string, date-time, nullable
        - `name` string, required
        - `updated_at` string, date-time, required
      - `user_id` string, nullable — The user the consumption is attributed to; null for unattributed consumption
    - `end_time` string, date-time, required — End of the usage window (exclusive)
    - `rows` UserFeatureUsageResponseData[], required — Per-user, per-feature usage within the window; rows for a feature sum to the company total
      - `feature` FeatureResponseData
        - `created_at` string, date-time, required
        - `description` string, required
        - `event_subtype` string, nullable
        - `feature_type` 'boolean' | 'event' | 'license' | 'trait', required
        - `icon` string, required
        - `id` string, required
        - `license_id` string, nullable — The license sold through this feature. Set only on features of type license, and created automatically with them.
        - `lifecycle_phase` 'add_on' | 'alpha' | 'beta' | 'deprecated' | 'ga' | 'inactive' | 'in_plan' | 'internal_testing' | 'legacy'
        - `maintainer_account_member_id` string, nullable
        - `name` string, required
        - `plural_name` string, nullable
        - `singular_name` string, nullable
        - `trait_id` string, nullable
        - `updated_at` string, date-time, required
        - `usage_limit_trait_id` string, nullable — Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features.
      - `last_seen` string, date-time, required — When the user last used the feature within the window
      - `share` number, double, required — This row's fraction (0-1) of the company's total usage of the feature within the window, including unattributed usage
      - `user` UserResponseData
        - `created_at` string, date-time, required
        - `environment_id` string, required
        - `id` string, required
        - `last_seen_at` string, date-time, nullable
        - `name` string, required
        - `updated_at` string, date-time, required
      - `user_id` string, nullable — The user the usage is attributed to; null for unattributed usage
      - `value` integer, required — The user's usage of the feature within the window
    - `start_time` string, date-time, required — Start of the usage window
  - `params` object, required — Input parameters
    - `company_id` string — Company to break usage down for
    - `end_time` string, date-time — End of the usage window (exclusive); defaults to now
    - `feature_id` string — Restrict to a single event-based feature
    - `start_time` string, date-time — Start of the usage window; defaults to 30 days before the end

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `500` — Server error

---

[API](https://skmtc.net/schematichq/apis/schematic-api.md) · [All operations](https://skmtc.net/schematichq/apis/schematic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/schematichq/schematic-api/versions/419cb5147b52/schema)
