analytics:read scope.
The production API base is:
Get an Analytics API token
Create a scoped token in the Embedder web app and find your organization ID.
Make your first request
Send the token in theAuthorization header. The example below reads a seven-day organization overview:
from and to. URL-encode query values rather than concatenating untrusted input into the request URL.
Endpoints
All endpoint paths below are relative to the production API base.Organization overview
from: beginning of the reporting window as an ISO 8601 timestampto: end of the reporting window as an ISO 8601 timestamp
totals and previous can be null when no aggregate is available.
Users
List users:users array. Each user includes the shared usage metrics plus:
userIdnameemaillastActiveAt
totals, daily usage in days, usage grouped by client in byClient, and usage grouped by project in byProject.
Teams
List teams:teams array. Each team includes the shared usage metrics plus:
teamIdnamememberslastActiveAt
totals, daily usage in days, and the team’s analytics rows in members.
Sessions
List sessions:fromandto: ISO 8601 reporting windowlimit: number of rows requestedcursor: opaque value returned asnextCursorby the previous responseuserId: return sessions for one userteamId: return sessions for one teamoutcome:success,partial,failure,abandoned, orunknownclient: return sessions from one client
nextCursor back unchanged as the next request’s cursor. A null value means there is no next page.
Read one session:
toolBreakdown; files written; error count; app version; outcome confidence; and any generated summary.
Shared usage fields
Aggregate user, team, overview, and daily rows use these fields:
Counts and durations are numbers. Timestamps are ISO 8601 strings. Identity fields can be
null where activity is no longer associated with an available user, team, or project.
Authorization and errors
The token owner’s organization membership, role, and enabled features still limit the data returned. Theanalytics:read scope does not grant access to another organization.
Error responses can include:
401: the token is missing, invalid, expired, or revoked403: the token lacksanalytics:read, the organization is unavailable to the token owner, or Analytics is not enabled429: wait for the duration inRetry-Afterbefore retrying5xx: the service could not complete the request
correlationId when contacting Embedder support. Retry only idempotent GET requests, and apply backoff for 429 and transient server failures.
