Skip to main content
The Analytics API exposes organization usage data over HTTPS. Access requires an organization with Analytics enabled and a token with the analytics:read scope. The production API base is:
Some organizations use a dedicated tenant URL. Use the API URL provided for that tenant instead of the production host.

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 the Authorization header. The example below reads a seven-day organization overview:
Use ISO 8601 timestamps for from and to. URL-encode query values rather than concatenating untrusted input into the request URL.
Keep the token in a secret store or process environment. Do not put it in a URL, source file, repository, or command that will be saved to shell history.

Endpoints

All endpoint paths below are relative to the production API base.

Organization overview

Required query parameters:
  • from: beginning of the reporting window as an ISO 8601 timestamp
  • to: end of the reporting window as an ISO 8601 timestamp
The response contains totals for the requested window, a comparison aggregate, and daily values:
totals and previous can be null when no aggregate is available.

Users

List users:
The response is an object with a users array. Each user includes the shared usage metrics plus:
  • userId
  • name
  • email
  • lastActiveAt
Read one user:
The detail response includes totals, daily usage in days, usage grouped by client in byClient, and usage grouped by project in byProject.

Teams

List teams:
The response is an object with a teams array. Each team includes the shared usage metrics plus:
  • teamId
  • name
  • members
  • lastActiveAt
Read one team:
The detail response includes totals, daily usage in days, and the team’s analytics rows in members.

Sessions

List sessions:
Query parameters:
  • from and to: ISO 8601 reporting window
  • limit: number of rows requested
  • cursor: opaque value returned as nextCursor by the previous response
  • userId: return sessions for one user
  • teamId: return sessions for one team
  • outcome: success, partial, failure, abandoned, or unknown
  • client: return sessions from one client
The list response contains session rows and the cursor for the next page:
Pass nextCursor back unchanged as the next request’s cursor. A null value means there is no next page. Read one session:
The detail response adds input, output, cache-read, and cache-write token counts; tool call and failure durations in 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. The analytics:read scope does not grant access to another organization. Error responses can include:
  • 401: the token is missing, invalid, expired, or revoked
  • 403: the token lacks analytics:read, the organization is unavailable to the token owner, or Analytics is not enabled
  • 429: wait for the duration in Retry-After before retrying
  • 5xx: the service could not complete the request
Include correlationId when contacting Embedder support. Retry only idempotent GET requests, and apply backoff for 429 and transient server failures.
Last modified on August 24, 2026