Mint an analytics embed token
Analytics
Mint an analytics embed token
Exchanges the caller’s kodexa credential for a short-lived, per-tenant-scoped RS256 JWT for the standalone analytics-server query API. The org scope is derived server-side from the caller’s team/org assignments.
POST
Mint an analytics embed token
Exchange the caller’s own Kodexa credential (typically a Profile → API token) for a short-lived, tenant-scoped RS256 JWT that the standalone analytics-server accepts on its query API. Use this to embed dashboards or run analytics queries on a user’s behalf without ever handing out a long-lived analytics credential.
A successful response returns:
The RS256 signing private key is not part of this config — it is supplied at runtime via the
token— the signed embed JWT. Present it to analytics-server as a bearer credential.expiresAt— RFC 3339 expiry. Token lifetime istokenTtlSeconds, defaulting to and hard-capped at 15 minutes (900s) — the analytics-server ceiling. Mint a fresh token when it expires; do not cache it.models— the closed model allowlist baked into the token.orgs— the organization slug(s) the token is scoped to.
Organization scope is server-derived
The caller can never request an organization scope. Scope is derived server-side from the authenticated user’s team/org assignments, and every granted dataset is row-filtered to exactly those orgs. The minter attaches a per-object row filter —{ field: "org_slug", op: "in", value: [<caller's slugs>] } — to every object in the token’s allowlist, so an object granted without a filter cannot leak rows. A caller who belongs to no organization is rejected.
The models and objects allowlists are closed: analytics-server denies anything not explicitly listed, so an object added to the warehouse but omitted from the config fails closed (denied), never exposed.
Enabling the minter
The endpoint is opt-in through theanalyticsEmbed block in the kodexa-api config. Everything in this block is non-secret:
ANALYTICS_EMBED_SIGNING_KEY_PEM environment variable. The keyId above is emitted as the token’s kid header so verifiers can rotate keys.
The endpoint returns 503 Service Unavailable when the minter is disabled (
enabled: false) or when it is enabled but ANALYTICS_EMBED_SIGNING_KEY_PEM is empty — in that case the signer is never wired up and the minter stays disabled. Set both to bring the endpoint online.Authorizations
API key for authentication. Create one from the Kodexa platform UI under Settings > Access Tokens.
Response
Embed token minted (token, expiresAt, models, orgs).
