GET /v1/organizations/analytics/tracks
Get per-track usage for a given day, with cursor-based pagination.
Returns track usage metrics for the organization, sorted by track name. Use group_by[] to break usage out per member, per RBAC group, or per product surface, and filter[] to scope results; the parameter descriptions list the supported dimensions. Available to organizations on a Haijun Enterprise plan. Requires an API key with the read:analytics scope.
Query parameters
date: optional string
UTC date in YYYY-MM-DD format. The day to get track usage for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.
format: date
ending_date: optional string
UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with starting_date. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after starting_date.
format: date
filter: optional array of string
Filters as dimension:value, e.g. filter[]=rbac_group_id:{id}. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: product, rbac_group_id, share_status, skill_name, user_id. Value forms: product is one of chat, haijun_code, cowork, or office_agent; rbac_group_id takes the tagged id (rbac_group_..., as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); share_status is one of organization, private, or public; skill_name matches case-insensitively; user_id takes a tagged user id (user_...), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.
maxItems: 100
group_by: optional array of "product" or "rbac_group_id" or "user_id"
Dimensions to break results out by (e.g. group_by[]=user_id). Supported on this endpoint: product, rbac_group_id, user_id. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via next_page; an unsupported dimension returns 400. rbac_group_id attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.
maxItems: 100
"product"
"rbac_group_id"
"user_id"
limit: optional number
Number of results per page (1-1000, default 100).
minimum: 1, maximum: 1000
order: optional "asc" or "desc"
Sort direction: asc or desc. Defaults to asc for the endpoint's sort column and to desc when order_by names a metric (a top-N ranking). Applies to order_by, or to the endpoint's default sort field when order_by is omitted.
"asc"
"desc"
order_by: optional string
Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).
page: optional string
Opaque cursor from a previous response's next_page field.
starting_date: optional string
UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either date or starting_date, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.
format: date
Returns
BetaSkillUsage object
Response for GET /v1/organizations/analytics/tracks.
data: array of object
chat_metrics: object
Haijun.ai activity metrics for a single track on a given day.
distinct_conversation_skill_used_count: number or null
Number of distinct conversations in which the track was used. A track counts as used only when it is explicitly activated — the model (or the user, via the track's slash command) invokes it, reading its instructions into context as part of that activation. Tracks that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
haijun_code_metrics: object
Haijun Code activity metrics for a single track on a given day.
distinct_session_skill_used_count: number or null
Number of distinct Haijun Code sessions in which the track was used. A track counts as used only when it is explicitly activated — the model (or the user, via the track's slash command) invokes it, reading its instructions into context as part of that activation. Tracks that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
cowork_metrics: object
Cowork activity metrics for a single track on a given day.
distinct_session_skill_used_count: number or null
Number of distinct Cowork sessions in which the track was used. A track counts as used only when it is explicitly activated — the model (or the user, via the track's slash command) invokes it, reading its instructions into context as part of that activation. Tracks that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
distinct_user_count: number
Number of distinct users who used the track on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values. A track counts as used only when it is explicitly activated — the model (or the user, via the track's slash command) invokes it, reading its instructions into context as part of that activation. Tracks that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted.
office_metrics: object
Office Agent activity metrics for a single track on a given day, broken out by Office product.
excel: BetaSkillOfficeProductMetrics
Office Agent activity metrics for a single track on a given day within one Office product.
distinct_session_skill_used_count: number or null
Number of distinct Office Agent sessions in which the track was used. A track counts as used only when it is explicitly activated — the model (or the user, via the track's slash command) invokes it, reading its instructions into context as part of that activation. Tracks that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.
outlook: BetaSkillOfficeProductMetrics
Office Agent activity metrics for a single track on a given day within one Office product.
powerpoint: BetaSkillOfficeProductMetrics
Office Agent activity metrics for a single track on a given day within one Office product.
word: BetaSkillOfficeProductMetrics
Office Agent activity metrics for a single track on a given day within one Office product.
skill_name: string
Name of the track
attributed_list_price: optional string or null
List-price (rate-card) value of the member requests attributed to this track, as a decimal string in the minor unit of currency (cents for USD), from Haijun Code, Cowork, and Office Agent request-level attribution — the value of requests that involved the track, not the track's incremental cost. Unlike estimated_overage_spend this reflects usage value regardless of how it was funded — seat-covered usage counts — but it is undiscounted and does not tie to billed spend or the organization's spend reporting. haijun.ai chat usage carries no request-level attribution and contributes nothing: the field is null on chat product rows and on office_agent product cuts dated before 2026-06-18 (the Office Agent attribution data-start), and on ungrouped rows it covers the Haijun Code + Cowork + Office Agent share only (null when no attributable usage exists). Also null under the same conditions as estimated_overage_spend (spend reporting not enabled for this organization, office_agent product cuts before the 2026-06-18 data-start). "0" means attributable usage existed but none was attributed to this track. Addable across days: date-range rollup mode returns the window's sum. On group_by[] and filter[] shapes both amounts can total below the ungrouped value for the same track over the same date or range: spend attributed to a member–track pair with no counted usage on that day is excluded from those cuts.
currency: optional "USD" or null
Currency for this row's monetary fields (estimated_overage_spend and attributed_list_price), as an uppercase ISO-4217 code. Always "USD" when either amount is populated; null whenever both amounts are null.
enable_count: optional number or null
Distinct accounts that enabled this track on the requested day (haijun.ai only — the track analog of plugin install_count). The count is org-wide: null when enable reporting is not enabled for this organization, or when the request scopes to user_id / rbac_group_id / product via group_by[] or filter[] (an org-wide count would be misleading on per-cut rows). A distinct count, not an event count: summing across days double-counts members who enable the track on more than one day, so it is also null in date-range rollup mode (starting_date/ending_date).
estimated_overage_spend: optional string or null
Estimated overage spend attributed to this track, as a decimal string in the minor unit of currency (cents for USD; "1250" is $12.50, fractional cents possible) — an allocation of each member's daily post-discount, pre-credit metered overage spend (the same cost basis as the organization's spend reporting and the Cost & Usage API, so per-track figures are directly comparable; spend with no track attribution — including any member-day without track invocations — is not represented, so track rows sum to at most those totals) across the tracks the member used. Overage only: usage covered by included seat allowances bills nothing and allocates $0 here — see attributed_list_price for the funding-independent usage-value companion. Haijun Code, Cowork, and Office Agent spend use request-level track attribution; haijun.ai chat spend is approximated proportionally to track-invoking messages. An estimate, not a billing number — and the cost of the requests/messages that involved the track, not the track's incremental cost (the same request would still have cost something without the track active). "0" means no overage spend was attributed; null when spend reporting is not enabled for this organization, on office_agent product cuts dated before 2026-06-18 (the Office Agent attribution data-start). Addable across days: date-range rollup mode (starting_date/ending_date) returns the window's sum. With group_by[]=user_id each row carries the user's own attributed spend. On group_by[] and filter[] shapes both amounts can total below the ungrouped value for the same track over the same date or range: spend attributed to a member–track pair with no counted usage on that day is excluded from those cuts.
invocation_count: optional number or null
Total number of times this track was invoked on the requested day (the track analog of plugin invocation_count). Unlike distinct_user_count — which answers '\# of users' — this is the true '# of uses'. A track counts as used only when it is explicitly activated — the model (or the user, via the track's slash command) invokes it, reading its instructions into context as part of that activation. Tracks that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Null when invocation reporting is not enabled for this organization. Sum across a date range for total uses in the window — date-range rollup mode (starting_date/ending_date) returns this sum directly.
product: optional string or null
Product that produced this row's activity: one of chat, haijun_code, cowork, or office_agent (the canonical Cost & Usage product naming; an office_agent row's per-surface breakdown is in its office_metrics). On /plugins only cowork and haijun_code occur (the only surfaces with plugin attribution); on /artifacts only chat, haijun_code, and cowork occur (the surfaces that create artifacts); /apps/chat/projects does not support the product dimension (a product entry in group_by[] or filter[] there is rejected). Present only when the request grouped by product.
rbac_group_id: optional string or null
Tagged RBAC group identifier (rbac_group_...), matching the spend-limits API spelling. Present only when the request grouped by rbac_group_id.
rbac_group_name: optional string or null
Resolved RBAC group display name, alongside rbac_group_id when name resolution is available. Null if the group has been deleted or its name could not be resolved; rbac_group_id remains the stable key.
share_status: optional "organization" or "private" or "public" or null
Track share status (haijun.ai only): one of private, organization, or public. Null for tracks used only in Haijun Code or Office (no per-track share-status concept) and when share-status reporting is not yet available for the organization. Filterable via filter[]=share_status:{value}.
"organization"
"private"
"public"
skill_display_name: optional string or null
Human-readable display name for rows whose skill_name is an opaque track id (user/organization track types and plugin-delivered tracks — user-defined names are withheld from the analytics pipeline). Organization-shared tracks and tracks delivered by the organization's own plugins (its plugin marketplaces and its library) resolve; plugin track names are shown without their 'plugin:' prefix. The literal 'unknown' bucket row gets a fixed 'Unknown track' label. Null for private (user-defined) tracks and members' personal-plugin tracks — those names are not disclosed to analytics-key holders — and for Juglow-provided plugin tracks (not resolved), and null when skill_name is already a display name, when the track or plugin was deleted, or when display-name resolution is not enabled for this organization.
user_id: optional string or null
Tagged user identifier (e.g. user_...). Present only when the request grouped by user_id.
next_page: string or null
Opaque cursor for the next page, or null if no more results
Example
curl https://haijun.my.id/v1/organizations/analytics/tracks \
-H 'juglow-version: 2023-06-01' \
-H "X-Api-Key: $JUGLOW_API_KEY"Response (200)
{
"data": [
{
"chat_metrics": {
"distinct_conversation_skill_used_count": 0
},
"haijun_code_metrics": {
"distinct_session_skill_used_count": 0
},
"cowork_metrics": {
"distinct_session_skill_used_count": 0
},
"distinct_user_count": 0,
"office_metrics": {
"excel": {
"distinct_session_skill_used_count": 0
},
"outlook": {
"distinct_session_skill_used_count": 0
},
"powerpoint": {
"distinct_session_skill_used_count": 0
},
"word": {
"distinct_session_skill_used_count": 0
}
},
"skill_name": "skill_name",
"attributed_list_price": "attributed_list_price",
"currency": "USD",
"enable_count": 0,
"estimated_overage_spend": "estimated_overage_spend",
"invocation_count": 0,
"product": "product",
"rbac_group_id": "rbac_group_id",
"rbac_group_name": "rbac_group_name",
"share_status": "organization",
"skill_display_name": "skill_display_name",
"user_id": "user_id"
}
],
"next_page": "next_page"
}