Skip to content

07 — Embedding & Cloud APIs ​

Pages read: 22 docs pages + 3 OpenAPI specs (api.yaml 226 operations / 583 schemas, chat.yaml, scim.yaml) + api.txt index (list of paths at the bottom)

Core ground truth checked in container cubebi-cube (Cube Core v1.8.35, /cube/node_modules/@cubejs-backend/*). Key Core facts used throughout:

  • Core HTTP routes (api-gateway gateway.js): /v1/load, /v1/meta, /v1/sql, /v1/cubesql, /v1/cubesql/params, /v1/dry-run, /v1/subscribe, /v1/convert-query, /v1/graphql-to-json, /v1/sql-filters, /v1/running-query/:requestId, /v1/pre-aggregations/can-use|jobs, plus /cubejs-system/v1/pre-aggregations/*. No /embed/*, generate-session, /v1/data-sources, /v1/entities, /v1/model-export (metadata API is Cloud-only).
  • Core API scopes default to ['graphql','meta','data','sql'] (contextToApiScopes); Cloud's chat / chat-security-context / meta-private scopes do not exist in Core.
  • Core config options present in server-core: checkAuth, jwt.{jwkUrl,key,audience,issuer,subject,claimsNamespace,algorithms}, contextToAppId, contextToOrchestratorId, driverFactory, repositoryFactory, schemaVersion, preAggregationsSchema, queryRewrite, extendContext, scheduledRefreshContexts, scheduledRefreshTimeZones, contextToGroups, contextToApiScopes.
  • schema-compiler CubePropContextTranspiler.CUBE_CLOUD_SHORTHAND_IDENTIFIERS = ['userAttributes','user_attributes','groups']: in a data model / access_policy, bare userAttributes.x / groups are rewritten to securityContext.cubeCloud.userAttributes.x / securityContext.cubeCloud.groups. This is the seam a Core rebuild of Cloud's user attributes + groups plugs into: put them in the JWT under cubeCloud. contextToGroups has no default in Core (returns empty set) — you must configure it, e.g. ({securityContext}) => securityContext.cubeCloud?.groups ?? [].
  • @cubejs-backend/cloud in Core is only the CLI deploy client to Cube Cloud (build/deploy/..., devmode/... endpoints) — no Cloud features.

Part A — Core embedding (JWT, security context, multitenancy) ​

Core embedding: JWT authentication (check_auth, jwt, JWKS) ​

  • Docs: pages/embedding/authentication/jwt.md
  • What it does:
    • Every Core Data API request carries Authorization: <JWT>; Cube verifies it and the decoded payload (must be an object) becomes securityContext.
    • Default verification: HS256 with CUBEJS_API_SECRET (or CUBEJS_API_SECRETS for rotation).
    • JWKS: jwt.key / CUBEJS_JWT_KEY (JWK as string) or jwt.jwkUrl / CUBEJS_JWK_URL (cached, re-fetched on key rotation; token must carry a matching kid). Once a key is configured, API-secret tokens are rejected with 403 Invalid token — no fallback; write a custom check_auth to accept both.
    • Claim checks: jwt.audience|issuer|subject (CUBEJS_JWT_AUDIENCE|ISSUER|SUBJECT), algorithms CUBEJS_JWT_ALGS, jwt.claimsNamespace (CUBEJS_JWT_CLAIMS_NAMESPACE) to lift claims from a namespaced object.
    • check_auth fully replaces verification and sets the security context.
    • Dev mode (CUBEJS_DEV_MODE=true or devServer) disables mandatory verification and exposes Playground endpoints that mint tokens for any security context — never in production. NODE_ENV has no effect.
    • Typical pattern: your backend signs a short-lived JWT for the logged-in user (exp recommended) and the frontend passes it to @cubejs-client/core.
  • Availability: CORE. Evidence: all options found in server-core/api-gateway (OptsHandler.js reads jwtAlgorithms, gateway verifies with jwkUrl, claimsNamespace); env vars listed in Core env-var reference. The only Cloud-specific note: Cloud "personal Core Data API tokens" bypass JWKS because the platform validates them first.
  • Core building blocks to use: checkAuth, jwt option, CUBEJS_API_SECRET(S), contextToApiScopes.
  • To build on Core: nothing beyond a token-minting endpoint in your app backend. S.
  • Gotchas: non-object payload → "Cannot create proxy with a non-object as target or handler". Mixing IdP tokens and self-signed tokens needs custom check_auth. Dev mode is an auth bypass.

Core embedding: Security context (query_rewrite, COMPILE_CONTEXT, extend_context) ​

  • Docs: pages/embedding/authentication/security-context.md
  • What it does:
    • Verified JWT claims = security context; available in query_rewrite, COMPILE_CONTEXT, extend_context, context_to_app_id and access policies.
    • query_rewrite(query, ctx) runs per query; patterns documented: row-level filter by user_id, mandatory global filters, role-based filters (raise if no role), "column-based" (add a filter only if a given cube is referenced).
    • COMPILE_CONTEXT + context_to_app_id → one compiled data model per app id; Jinja/Python helpers (e.g. masked() in globals.py) render different SQL per tenant; public: of cubes/views can be computed from COMPILE_CONTEXT for member-level visibility.
    • extend_context enriches the security context before rules run (e.g. derive isFinance).
    • cubeCloud key in the security context is reserved (Cloud puts user attributes / groups / auth-integration info there).
    • "Enable Cloud Auth Integration" toggle (Cloud deployment setting) enriches the context with the Cloud-authenticated user — Cloud only.
    • Pre-aggregations that depend on COMPILE_CONTEXT need scheduledRefreshContexts.
  • Availability: CORE (auth-integration toggle is CLOUD-ONLY). Evidence: queryRewrite, extendContext, contextToAppId in server-core; cubeCloud shorthand handled in schema-compiler.
  • Core building blocks to use: queryRewrite, extendContext, contextToAppId, COMPILE_CONTEXT, access_policy (row_level, member_level, groups), Playground security-context editor (dev only).
  • To build on Core: nothing for the engine. If you want Cloud-like "user attributes", define a convention securityContext.cubeCloud.userAttributes and populate it when minting tokens. S.
  • Gotchas: COMPILE_CONTEXT changes require a distinct app id or you get cross-tenant model caching; query_rewrite doesn't isolate caches/pre-aggs.

Core embedding: IdP recipes (Auth0, AWS Cognito) ​

  • Docs: pages/embedding/authentication/auth0.md, pages/embedding/authentication/aws-cognito.md
  • What it does:
    • Auth0: SPA app + API (identifier = audience); a Rule adds a namespaced custom claim object (company_id, user_id, roles) to the access token.
    • Cognito: Pre Token Generation Lambda adds claims (value JSON-stringified under a namespace key).
    • Cube config for both: CUBEJS_JWK_URL=<issuer>/.well-known/jwks.json, CUBEJS_JWT_AUDIENCE, CUBEJS_JWT_ISSUER, CUBEJS_JWT_ALGS=RS256, CUBEJS_JWT_CLAIMS_NAMESPACE.
    • Testing: get a token from openidconnect.net, paste it into Playground → Add Security Context → Token.
  • Availability: CORE. Evidence: pure env-var configuration of Core JWT verification.
  • Core building blocks to use: jwt.* options / env vars.
  • To build on Core: nothing. S.
  • Gotchas: Cognito puts the namespaced claim as a JSON string — verify that claimsNamespace parses it as you expect (may need check_auth to JSON.parse). Cognito docs use the id_token, Auth0 the access_token.

Core embedding: Multitenancy ​

  • Docs: pages/embedding/multitenancy.md
  • What it does:
    • Tenant-aware functions of the context: context_to_app_id (compiled model cache key), context_to_orchestrator_id (connections, queues, in-memory result cache key), driver_factory, repository_factory (e.g. new FileRepository('model/'+appId)), schema_version, pre_aggregations_schema, query_rewrite, scheduled_refresh_contexts, scheduled_refresh_time_zones.
    • Scenarios: same DB + RLS (query_rewrite, shared queues/pre-aggs); same DB + per-tenant model (context_to_app_id only — warning: everything below the model, incl. pre-agg tables, stays shared); per-tenant DB (driverFactory + both ids); per-tenant pre-agg schema; mixed drivers (Mongo BI vs Postgres) + per-tenant repo.
    • Multi-data-source (data_source on cube + driverFactory({dataSource})) is distinct from multitenancy; a default data source must exist.
    • Memory: each app id / orchestrator id costs MBs–tens of MBs; strategies: bucket tenants, or shard tenants across Cube nodes with matching refresh workers (what Cube Cloud does).
    • Unset scheduled_refresh_contexts → refresh worker runs with undefined security context.
  • Availability: CORE. Evidence: all options present in server-core (contextToAppId 5 files, contextToOrchestratorId 4, repositoryFactory, driverFactory, preAggregationsSchema, scheduledRefreshContexts, scheduledRefreshTimeZones).
  • Core building blocks to use: listed options; FileRepository; refresh worker (CUBEJS_REFRESH_WORKER).
  • To build on Core: tenant router / sharding layer if tenants exceed a node's memory (L); otherwise config only (S).
  • Gotchas: forgetting contextToOrchestratorId leaks cached results between tenants with identical SQL; per-tenant refresh needs scheduledRefreshContexts enumerating tenants.

Headless embedding (Core Data APIs) ​

  • Docs: pages/embedding/index.md
  • What it does: Three embedding approaches: iframe (Premium/Enterprise), React Embed SDK (Premium/Enterprise), headless (Chat API — Cloud; Core Data APIs — REST/GraphQL/SQL for fully custom UIs).
  • Availability: CORE for the Core Data APIs part; Chat API is CLOUD-ONLY (see below).
  • Core building blocks to use: /v1/load, /v1/meta, /v1/cubesql, GraphQL, SQL API (Postgres wire), @cubejs-client/*.
  • To build on Core: your own UI. Effort depends on UI scope.
  • Gotchas: none.

Part B — Cube Cloud embedding (iframes, signed sessions, SDK, Creator Mode) ​

Cloud embedding: Private embedding ​

  • Docs: pages/embedding/iframe/auth/private.md
  • What it does:
    • Internal use: paste <iframe src="https://<acct>.cubecloud.dev/embed/dashboard/<publicId>"> (or /embed/chat); viewer signs in with their own Cube account; access governed by Cube roles.
    • Examples: Notion /embed with the URL; Salesforce Visualforce page with iframe allow="microphone; fullscreen".
    • No session layer → no session settings; only account settings + URL params apply. Creator Mode not supported.
  • Availability: CLOUD-ONLY. Premium and Enterprise. Evidence: plan badge; relies on Cube Cloud accounts/roles and hosted /embed/* UI; no embed routes in Core.
  • Core building blocks to use: none directly; your own app's SSO + Core JWT.
  • To build on Core: a hosted dashboard/chat app with its own login (OIDC) that can be framed (CSP frame-ancestors, SameSite=None cookies). M (assuming dashboards app exists).
  • Gotchas: third-party-cookie blocking in iframes (Safari/Chrome) breaks login-in-iframe flows — Cloud's private mode inherits that; plan a popup login.

Cloud embedding: Signed embedding & sessions (Generate Session / token exchange / revoke) ​

  • Docs: pages/embedding/iframe/auth/signed.md, pages/reference/embed-apis/generate-session.md, pages/reference/embed-apis/index.md; spec tag Embed
  • What it does:
    • Backend calls POST /api/v1/embed/generate-session with Authorization: Api-Key <admin key> → {sessionId}. Personal keys → 403; deployment-scoped keys must cover deploymentId.
    • Body (GenerateSession): deploymentId*, externalId (lowercase/trimmed) XOR internalId (existing Cube user; then no attributes/groups/securityContext/profile allowed), email, userProfile{displayName,picture} (persisted per external user; overwrites when sent), embedTenantName (lowercase, 5–36 chars, [a-z0-9-], starts with letter), creatorMode, userAttributes[{name,value: string|number|string[]|number[]|null}] (names must exist in the attribute catalog; duplicates 400), groups (names; omit=keep, []=clear, list=replace), securityContext (free object), settings (see Feature visibility), branchName (404 unknown branch, 400 branch not served), embedTheme, embedTenantProfile{displayName}, plus spec-only isEphemeral, roles, publicDashboardId, tenantGroups, tenantGroupDefinitions, userAttributeDefinitions.
    • Session id is single-use, valid 5 min. Iframe (or your code) exchanges it via POST /api/v1/embed/session/token {sessionId} (no auth header) → {token} (JWT, 24 h; iframe stops trusting it after ~23 h). Embed token is sent as Authorization: Embed-Token <jwt> (or Bearer).
    • POST /api/v1/embed/session/revoke {sessionId} → 204; any admin principal; deployment scope of key NOT checked; old tokens without the revocation claim keep working until expiry. Doesn't revoke Cube API tokens obtained via POST /api/v1/deployments/{id}/token.
    • POST /api/v1/deployments/{id}/token {expiresIn 60–86400} with Bearer <embed token> → {cubeApiToken}: a Core Data API JWT carrying the embed user's security context (used for /v1/cubesql).
    • External users are upserted by externalId; account limit 10,000 external users. Data filtering via user attributes → access policies.
    • Spec divergence from prose docs: groupDefinitions is now "deprecated and ignored"; per-tenant groups use tenantGroups + tenantGroupDefinitions (namespaced in the security context as system:tenant:{tenant}:group:{name}); global groups are placed verbatim in securityContext.cubeCloud.groups.
    • Dashboard must have "Allow signed embedding" (PATCH /api/v1/embed/dashboard/{publicId} {allowEmbed}, or CLI cube embed enable-dashboard).
  • Availability: CLOUD-ONLY. Premium and Enterprise. Evidence: plan badge; Cloud API host {account}.cubecloud.dev/api/v1/embed/*; no equivalent in Core gateway.
  • Core building blocks to use: Core JWT verification — the whole "session" concept collapses to: your backend signs a short-lived Core JWT with {sub/externalId, cubeCloud:{userAttributes, groups}, ...securityContext}; contextToGroups + access_policy with userAttributes/groups shorthands; queryRewrite.
  • To build on Core: session service (one-time code → JWT exchange, revocation list/jti denylist, refresh), external-user store (profile, attribute values, group memberships, tenant), attribute/group catalog with type validation, API keys for your backend. M.
  • Gotchas: don't put the long-lived JWT in the iframe URL — Cloud's one-time 5-min code exchanged for a token is the pattern to copy. Revocation needs a server-side check on every request (Core's checkAuth can consult a denylist). Branch selection has no Core equivalent beyond schemaVersion/repositoryFactory keyed by a context field.

Cloud embedding: Embedded dashboards (iframe, URL parameters) ​

  • Docs: pages/embedding/iframe/dashboards.md
  • What it does:
    • URL /embed/dashboard/{publicId}?session=… (signed) or without session (private). allow="microphone; fullscreen" enables dictation and app slide-deck full screen.
    • Pre-set state via URL: f_<view>.<dim>=<JSON {"value":…, "type"?}> (filter), tg_<view>.<timeDim>=<granularity> (time-grain switcher; lowercase; custom granularity by model name), ms_<view>.<replaced>=<selected> (field switcher), dc_<key>=<JSON {type, config}> (adds a Dynamic-controls control; published only), tab_<widgetId>=<tabId> (published only). Detailed resolution rules: f_ falls back to another filter on the same cube dimension or a dynamic-controls slot, else "Unable to filter by"; disabled filters ignore f_; {"value":[]} or empty tg_ clears; multiple filters per member get value by matching type. Apps (kind: APP) ignore all but f_, which applies to every report the app reads.
    • Reverse sync: on published dashboards, viewer changes are written back into the URL in the same format.
    • Export: allowExport=true (exact literal) enables per-widget CSV/PNG/PDF (+ table print version) and whole-dashboard PNG/PDF/print (A4 PDF with a summary line of all control values incl. hidden ones — tenant filters leak as text). showDashboardExportMenu=false hides the dashboard-level button. CSV is generated client-side from loaded data. AI-off sessions disable PNG/PDF. Account "Allow data downloads" outranks. Sandboxed iframes need allow-downloads (silently dropped otherwise).
    • Header switches: showDashboardHeader|BackButton|Title|EditButton|DuplicateButton=false (exact literal false; URL-only; pinned for life of embed).
    • autoRefresh=true (published interval) or =<1..1440 minutes>.
    • AI chat on dashboards: account toggle + settings.showDashboardChat; settings.allowAi is the server-enforced master switch.
    • Comments panel (account toggle) → Dashboard Comments API.
    • ?locale= and theme from dashboard Theme tab.
  • Availability: CLOUD-ONLY. Premium and Enterprise. Evidence: plan badge; Cloud dashboard product; no dashboard storage/UI in Core.
  • Core building blocks to use: /v1/load (filters, timeDimensions.granularity, timezone), /v1/meta (member titles, custom granularities), drillMembers, /v1/subscribe or polling for refresh, pre-aggregations.
  • To build on Core: dashboard renderer + URL-state codec (f_/tg_/ms_/dc_/tab_), export service (headless Chromium for PNG/PDF), embed shell with header switches and auto-refresh. L (on top of a dashboard product).
  • Gotchas: URL params are viewer-editable → never use them for entitlements; percent-encode JSON. Print version reveals hidden control values.

Cloud embedding: Embedded Analytics Chat (iframe) ​

  • Docs: pages/embedding/iframe/analytics-chat.md
  • What it does:
    • /embed/chat (private) or /embed/chat?sessionId=… (signed); chatId= deep-links to a past conversation.
    • URL switches: showNewChat=false, showChatInput=false (read-only transcript), showChatHistory=false; legacy hideNewChat|hideChatInput|hideHistory=1|true still honored, show… wins.
    • Chat history lists the user's past threads (matched by externalId). Voice input requires microphone in iframe allow and host Permissions-Policy.
    • User attributes from the session personalize answers; settings.allowAi decides whether chat is available at all.
  • Availability: CLOUD-ONLY. Premium and Enterprise. Evidence: plan badge; hosted AI agent.
  • Core building blocks to use: /v1/meta (model search), /v1/cubesql or /v1/load for agent tool calls, security context for RLS.
  • To build on Core: see Chat API section (agent backend) + chat UI with thread list, deep-linking, read-only mode, speech-to-text. L.
  • Gotchas: none beyond Chat API.

Cloud embedding: Feature visibility layers (account / session / URL) ​

  • Docs: pages/embedding/iframe/feature-visibility.md
  • What it does:
    • Three layers: Account settings (Embed → Settings; defaults for all embeds incl. private), Session settings (settings in Generate Session; signed into the token; tri-state booleans; per viewer; tamper-proof), URL parameters (per placement; viewer-editable). Plus runtime host messages for locale/timezone/theme.
    • Rule: session = what the customer is entitled to; URL = how this placement looks; account = default.
    • Session keys: allowAi (master, server-enforced: session cannot obtain AI credentials), showDashboardChat, showWorkbookChat, showAiWidgets, allowChatWorkspaceAuthoring (server-side: changes agent tools/instructions), locale, timezone, showWorkbookShare, showDashboardSettings, showMemberNames (also pins pane to titles + hides CSV header choice), showGroupByCube.
    • URL keys: allowExport=true, showDashboardExportMenu|Header|BackButton|Title|EditButton|DuplicateButton=false, showWorkbookBackButton=false, locale, timezone; chat showNewChat|showChatInput|showChatHistory. Parsing: grants need exact true, hides need exact false, values fall through if unusable.
    • Account keys (EmbedSettings in app-config): allowAi, showDashboardChat, showWorkbookChat, showAiWidgets, enableDashboardComments (hides panel only — API still answers), locale, timezone; Creator Mode workspace title/SQL visibility.
    • Hiding ≠ permission: permissions apply underneath; only allowAi and allowChatWorkspaceAuthoring are server-enforced.
  • Availability: CLOUD-ONLY. Evidence: Cloud UI settings + Generate Session API.
  • Core building blocks to use: none (Core has no UI). Server-enforced parts map onto JWT claims checked by your backend / contextToApiScopes.
  • To build on Core: a settings resolver (account → session claims → URL → runtime) shared by all embed surfaces; store account defaults. S–M.
  • Gotchas: the precedence ladder and "exact literal" parsing are deliberate security choices — copy them.

Cloud embedding: postMessage events & actions, session renewal ​

  • Docs: pages/embedding/iframe/events.md
  • What it does:
    • Envelope {source:"cube-embed", direction:"event"|"action", type, payload, timestamp(ms), surface?:"dashboard"|"app"|"chat"} (surface always on events, never on actions). Host must validate event.origin and source; send actions with explicit target origin.
    • Events: cube:event:ready {embedTenant, deploymentId, mode:"signed"|"private", surface, publicId?}, view {surface, path, publicId?, title?}, navigate {path, previousPath?}, dashboard-loaded {publicId?, widgetCount?, loadDurationMs?}, app-loaded {path, title?}, download {format: csv|xlsx|png|pdf, target: widget|dashboard, widgetId?, title?, rowCount?}, drilldown {member, value?, widgetId?}, ai-query {query, status: submitted|completed|error, chatId?, agentId?}, session-expiring {expiresAt, expiresInMs} (~30 min before), session-expired {expiredAt}, error {message, name?, context?, fatal?}.
    • Actions: cube:action:set-color-scheme {scheme: light|dark|auto}, set-theme <embedTheme>, set-locale {locale}, set-timezone {timezone}, set-filter {filterUrlParameter: 'f_…'} (replaces all filter params; dashboards keep omitted controls, apps drop them), navigate {path}, refresh, set-session {sessionId} (in-place token swap without reload; rejection → error with context:"session-renewal", name:"EmbedSessionExchangeError").
    • Renewal: on session-expiring/session-expired mint a new session server-side and send set-session; @cube-dev/embed-sdk connectCubeEmbed(iframe).autoRenewSession({mintSession}) also renews on tab foregrounding and de-duplicates. Logout: revoke every session id minted for the viewer.
    • Premium and above.
  • Availability: CLOUD-ONLY. Evidence: plan badge; iframe app behaviour.
  • Core building blocks to use: none.
  • To build on Core: a small typed postMessage bridge in the embed app + host SDK (connect, on, send, autoRenewSession). S–M.
  • Gotchas: timers in hidden tabs are throttled — renew on visibilitychange too; "download" event fires even if the sandbox drops the file.

Cloud embedding: Localization ​

  • Docs: pages/embedding/iframe/localization.md
  • What it does: 12 locales (en-US default, de-DE, es-ES, es-MX, fr-FR, it-IT, ja-JP, nb-NO, pt-BR, pt-PT, sv-SE, vi-VN). Fuzzy resolution (es/es-AR → es-MX, pt → pt-PT; unknown ignored). Precedence: runtime set-locale > ?locale= (pinned on load) > settings.locale > account default (Embed → Settings) > en-US. Creator Mode workspace title has per-language overrides resolved against the same locale.
  • Availability: CLOUD-ONLY. Premium and Enterprise. Evidence: plan badge; UI translation of Cloud app.
  • Core building blocks to use: model title/description (Core has no i18n of member titles; could use meta per locale or COMPILE_CONTEXT-driven titles via contextToAppId per locale).
  • To build on Core: i18n framework in your UI + locale resolver; optional per-locale model titles. S (UI strings) / M (translated model metadata).
  • Gotchas: per-locale compiled models multiply memory (app id per locale).

Cloud embedding: Time zones for embeds ​

  • Docs: pages/embedding/iframe/time-zones.md
  • What it does: Precedence: runtime set-timezone > ?timezone= > settings.timezone > dashboard's pinned zone (or viewer zone — signed viewers have none) > account embed default > account-wide zone > deployment default. IANA names only; bare offsets and unknown names fall through (never forwarded, because Cube would silently use UTC). Requires account "user time zones" policy; if off, no zone is sent. Premium and above.
  • Availability: CORE+CLOUD. Core: per-query timezone in /v1/load timeDimensions queries and timezone body field on /v1/cubesql (verified in gateway: execSql(body.query, …, body.timezone, …)), scheduledRefreshTimeZones for pre-aggs, CUBEJS_DEFAULT_TIMEZONE-style deployment default. Cloud: the resolution ladder, account policy, dashboard pinning, UI.
  • Core building blocks to use: query timezone, scheduled_refresh_time_zones.
  • To build on Core: resolver + IANA validation in your API layer. S.
  • Gotchas: pre-aggregations only match if built for that zone — add zones to scheduledRefreshTimeZones or queries fall back to source.

Cloud embedding: Customization / theming ​

  • Docs: pages/embedding/iframe/customization.md
  • What it does: Dashboard Theme tab (per dashboard; same in app and embed). App-level embedTheme on Generate Session (session-scoped): documented keys analyticsChat.backgroundColor, analyticsChat.chatInput.backgroundColor|borderColor; spec EmbedTheme also has primaryColor, font, chat.inputColor; set-theme action mentions primaryColor, borderRadius, font. Account-level App Theme (accent, background, text, logo, fonts; AppTheme{palette, logoUrl, typography} in GET /api/v1/app-config), optionally applied to the whole console.
  • Availability: CLOUD-ONLY. Evidence: Cloud UI/Generate Session.
  • Core building blocks to use: none.
  • To build on Core: CSS-variable theming in your UI fed from account/session/runtime. S.
  • Gotchas: docs vs spec key sets differ — the spec is broader than the docs table.

Cloud embedding: Creator Mode (embedded authoring app, embed tenants) ​

  • Docs: pages/embedding/iframe/creator-mode.md; spec tags Embed Tenants, Dashboard Embed Access
  • What it does:
    • creatorMode: true on Generate Session (signed only; Enterprise; tenant flag useCreatorMode) → iframe /embed/d/{deploymentId}/app?session=… embeds the full Cube app: workbooks, dashboards, reports, folders, AI chat, Analysis widgets.
    • Embed tenant (embedTenantName) scopes content, tenant groups and tenant attribute catalog (embed_user_groups, embed_user_attributes); sharing only within a tenant.
    • Default dashboards: share items from the main workspace with the system group All embed users (all_embed_users, read-only "Can view", can't rename/delete); folder share = recursive; single item share exposes its ancestor folders; same set for all tenants; workbook must have a published dashboard.
    • Embed users can share (Full access / Can edit / Can view), create/rename/delete folders, rename/duplicate/delete workbooks (permission-gated).
    • Account-only switches: showWorkspaceTitle, workspaceTitle (+ localizedTitles ≤50), showSemanticSql (default on), showGeneratedSql (default off — exposes physical tables). Source tables tab always hidden in embeds.
    • Agent authors workspace content only in Creator Mode sessions; allowChatWorkspaceAuthoring:false removes authoring tools.
    • Sandboxed iframes need allow-scripts allow-same-origin allow-forms (+allow-downloads); missing allow-forms silently blocks every save.
    • Admin APIs: GET /api/v1/embed-tenants (EmbedTenant{id,name,displayName,userCount,createdAt}), DELETE /embed-tenants/{name}, tenant groups CRUD + members, POST /embed-tenants/{name}/user and bulk /users (1–100; ProvisionEmbedUserInput{externalId, email, groups, tenantGroups, userProfile}), GET /embed-tenants/{name}/users; legacy /embed-tenants/{name}/user-attributes (docs). Per-dashboard embed ACL: GET|PUT /deployments/{id}/workbooks/{wid}/embed-access ({allowEmbed, allEmbedUsers{enabled,action}, tenants[{embedTenantName, action: read|none, groupId}]}), GET /deployments/{id}/embed-tenants/{name}/workbooks.
  • Availability: CLOUD-ONLY. Enterprise. Evidence: plan badge; requires Cloud workspace/workbook product and tenant flag.
  • Core building blocks to use: contextToAppId (if tenants have different models), queryRewrite/access policies keyed on tenant, /v1/meta (data pane), /v1/load + /v1/sql (show generated SQL), /v1/cubesql.
  • To build on Core: essentially the whole BI authoring product (workbooks, report builder, dashboard builder, folders, sharing ACLs) made multi-tenant with an embed-tenant dimension on every row, plus system group semantics and provisioning APIs. XL.
  • Gotchas: two group namespaces (global data-access groups vs tenant content-sharing groups) — keep them separate as Cloud now does (system:tenant:{t}:group:{g}). Generated SQL exposure is a schema leak.

Cloud embedding: User attributes & groups in sessions (row-level security) ​

  • Docs: pages/embedding/iframe/auth/signed.md (User attributes), pages/reference/embed-apis/generate-session.md; spec tags User Attributes, User Attribute Values
  • What it does:
    • Admin defines attribute catalog (UserAttribute{id, name, displayName, type: string|number|boolean|string_array|number_array, defaultValue, description}) via UI or GET|POST /api/v1/user-attributes, PUT /user-attributes/{id}; values per internal user via POST /api/v1/user-attribute-values {userId, userAttributeId, value}, GET /user-attribute-values/{userId}.
    • External users get values from the session (userAttributes), persisted per user; Creator Mode can upsert definitions (userAttributeDefinitions, type immutable → cannot change type).
    • Access policies reference userAttributes.<name> and groups → RLS/member visibility; chat agent sees them for personalization.
  • Availability: CORE+CLOUD. Core: the data-model side — access_policy and model expressions accept userAttributes/user_attributes/groups shorthands which compile to securityContext.cubeCloud.* (schema-compiler CubePropContextTranspiler), and contextToGroups drives group-based policies. Cloud: catalog, typed validation, per-user value storage, injection into cubeCloud at token mint.
  • Core building blocks to use: access_policy (group, row_level.filters with userAttributes.x, member_level), contextToGroups, extendContext (to load attributes from your DB by user id instead of carrying them in the JWT).
  • To build on Core: attribute catalog + value tables + admin UI/API, and token minting that writes cubeCloud.userAttributes / cubeCloud.groups. S–M.
  • Gotchas: large attribute arrays bloat the JWT (header-size limits 8–16 KB — the Chat API added a body-carried security context for exactly this); prefer extendContext lookup keyed by user id.

Cloud embedding: React Embed SDK ​

  • Docs: pages/embedding/react-embed-sdk.md
  • What it does: @cube-dev/embed-sdk (public preview); requires TanStack Query; <QueryClientProvider><CubeEmbedProvider apiUrl="https://<acct>.cubecloud.dev" sessionId=…>; same session auth as signed embedding; talks to Cube APIs directly (no iframe, so no postMessage renewal — re-mint sessionId before ~23 h and re-render). Same package exposes connectCubeEmbed(iframe) + autoRenewSession. Example repo antd-cube-embed-sdk.
  • Availability: CLOUD-ONLY. Premium and Enterprise. Evidence: plan badge; talks to Cloud APIs.
  • Core building blocks to use: @cubejs-client/core + @cubejs-client/react (Core client libs) for data hooks.
  • To build on Core: React component library (charts, dashboard, chat) over Core client. M–L.
  • Gotchas: component list isn't documented here (only the provider) — scope unknown.

Cloud API: Dashboard Comments (embed) ​

  • Docs: pages/reference/embed-apis/dashboard-comments.md; spec tag Embed (/embed/dashboard/{publicId}/comments*)
  • What it does:
    • Endpoints under /api/v1/embed: GET /dashboard/{publicId}/comments?includeResolved&resolvedOnly&first&after (thread list), POST …/comments {body, parentId?}, GET …/comments/mentionable-users?search&first&after, PATCH …/comments/{id} {body}, DELETE …/comments/{id} (204), POST …/comments/{id}/resolve {resolved}.
    • Auth: Embed-Token <jwt> (or Bearer) from an externalId session; internalId sessions, API keys, console sessions → 403. Caller must be able to read the dashboard (404 before 403).
    • Model: Comment{id, dashboardId(=publicId), userId(embed user id, null if deleted), body ≤10,000 chars verbatim, editedAt, removedAt, createdAt, isOwn}; Thread{root, replies[] oldest-first, resolvedAt, resolvedBy}; one nesting level (reply-to-reply 400); threads ordered newest-first by start; soft delete, never returned; deleting root removes thread.
    • Permissions: author-only edit/delete/resolve. Visibility scoped per embed tenant (sessions without embedTenantName all share one tenant!). Mentionable users = embed users of the same tenant; no server-side mention parsing/notifications.
    • Cursor pagination first default 100, max 200 (clamped); pageInfo{hasNextPage, hasPreviousPage, startCursor, endCursor}.
    • Account toggle "Allow comments on embedded dashboards" only hides the panel; API always answers.
    • Premium and above.
  • Availability: CLOUD-ONLY. Evidence: plan badge; Cloud API.
  • Core building blocks to use: none.
  • To build on Core: comments table (tenant, dashboard, parent, author, body, timestamps, resolved), REST endpoints, panel UI, mention autocomplete. S–M.
  • Gotchas: copy the tenant scoping and "author is the whole permission" rule; note Cloud's own gap — no server switch to stop writes.

Cloud API: Chat API (streaming AI agent) — protocol ​

  • Docs: pages/reference/embed-apis/chat-api.md; spec specs/chat.yaml
  • What it does:
    • Endpoint: POST https://ai.{cloudRegion}.cubecloud.dev/api/v1/public/{account}/agents/{agentId}/chat/stream-chat-state or /deployments/{deploymentId}/chat/stream-chat-state (deployment form → Auto agent or default agent; only with Cube-token auth). Abort: same URL with /abort.
    • Auth: (a) Authorization: Api-Key <key> + sessionSettings{externalId|internalId, email, userAttributes, groups, securityContext, roles?, publicDashboardId?, allowChatWorkspaceAuthoring, timezone} (users auto-provisioned; ephemeral by default, TTL ephemeralTtlSeconds = 1 week unless isEphemeral:false; 10,000 non-ephemeral external users); (b) X-Cube-Auth-Token: <deployment's own Core JWT> (opt-in deployment setting) — validated with the deployment's secret/JWKS/check_auth; resolved security context must contain externalId (or sub, lowercased) and scope containing "chat"; agent queries run with that same token, so RLS identical to direct API calls. Optional chat-security-context scope allows sessionSettings.securityContext in the body (≤64 KB), stored on the external user, replaces token claims for agent queries, reused until replaced/cleared with {}, reserved claims stripped (scope, cubeCloudScope, cubeCloud, requestSource, override, iat, exp, aud, iss, sub), up to 15 s propagation lag. Authorization wins over X-Cube-Auth-Token if both sent.
    • Request: {input?, chatId?, messageId?: "<13+ digit ms>-message", sessionSettings, activeBranchName?, isDefaultBranch?, streamRunStatus?, images?: [{data, mimeType, name?}]} (images is spec-only). No input + chatId = read thread state.
    • Response: HTTP 200, Content-Type: application/json, NDJSON — one JSON object per line. Message frame: {id, role: user|assistant, content, thinking, toolCall?{name, input(JSON string), result(JSON string, only when done; {error} on failure)}, graphPath: string[], isDelta, isInProcess, isStructuredResponse, sort}. Deltas repeat the same id; clients must upsert by id, not append.
    • Sentinel frames: __cutoff__ (first; state{isStreaming, chatId, suspended?.messageId}), __state__ (near end; full LangChain-serialized state.messages — reveals the backend is LangChain/LangGraph), __status__ (type:"status", status: waiting_for_deployment|initializing|running, only with streamRunStatus, never stored), __aborted__ (type:"abort", code:"chat_aborted", error), __suspended__ (type:"suspend", code:"chat_suspended", retryable:true, messageId, error), __usage__ (always last; usage{models[], llmCalls, inputTokens, outputTokens, cacheWriteTokens, cacheReadTokens, totalTokens}, no cost). Mid-stream errors: bare {"error": "..."} line; auth errors: JSON-RPC error object in a 200 ({"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":…}}).
    • Final answer: last message with role:"assistant", graphPath[0]==="final", graphPath.length<=2. Graph nodes: cube_data_analyst_agent, …/tools, final.
    • Tools: cubeMeta {searchQuery} → {cubes:[{name, type: view|cube, title, members:[{name, title, description, type, aggType?}]}], searchQuery}; cubeSqlApi {sqlQuery, queryTitle, description, userRequest, purpose: answer|lookup, memoryId, vegaSpec?, periodComparisons?} → {sqlQuery, queryTitle, description, userRequest, purpose, schema:[{name, column_type}], data: rows-as-arrays (≤100), totalRows, truncated, uuid, vegaSpec (Vega-Lite v5 without data), periodComparisonColumns?, periodComparisonErrors?}. Pick results with purpose:"answer" from the current turn (after last user message). Chat history also shows a runSql tool (warehouse SQL).
    • Full results: re-run sqlQuery on Core /cubejs-api/v1/cubesql as the same user (Cube token, or session → embed token → POST /api/v1/deployments/{id}/token → cubeApiToken), passing the same timezone; SQL API returns NDJSON (schema line then data chunks; errors as error line with 200).
    • Idempotency/resume: same messageId while streaming → resubscribe to the live stream; otherwise concurrent message → "Streaming for thread is in progress". Server shutdown → __suspended__; resend same chatId+messageId (input optional) within 24 h to resume (response replays thread then continues).
    • Abort: POST …/chat/abort {chatId, sessionSettings{externalId}} → 204 (idempotent), 403 not owner, 404 unknown; the stream emits __aborted__, then possibly late messages, __state__, __usage__.
    • Branch: activeBranchName/isDefaultBranch run queries against a dev branch. Vega styling config sample provided.
    • Premium and Enterprise.
  • Availability: CLOUD-ONLY. Evidence: plan badge; separate ai.{region}.cubecloud.dev service; no agent code in Core.
  • Core building blocks to use: /v1/meta (+ member description, meta) for the cubeMeta search tool; /v1/cubesql (Core SQL API over HTTP, NDJSON, timezone param) for cubeSqlApi; Core JWT/security context for RLS (forward the user's token); contextToApiScopes to add a chat scope check; pre-aggregations.
  • To build on Core: agent service (LLM provider, tool loop with cubeMeta-style semantic search — embeddings index over /v1/meta — and SQL execution; Vega-Lite generation), thread store (threads, turns, steps, query results ≤100 rows, feedback), NDJSON streaming endpoint replicating the frame protocol (upsert-by-id deltas, sentinels, usage), resumable runs (checkpointing, e.g. LangGraph), abort channel (pub/sub), external-user provisioning + ephemeral TTL, token usage accounting. L (basic) to XL (resume/suspend, multi-agent, period comparisons, certified queries/skills).
  • Gotchas: results are capped at 100 rows in the agent context by design; tool input/result are JSON strings; HTTP status is 200 even for auth failures/aborts/suspends — clients must parse frames. Agent queries via Cube token mean RLS parity for free; body security context replaces token claims (must include everything query_rewrite reads).

Cloud API: Control Plane API (doc page) ​

  • Docs: pages/reference/control-plane-api.md
  • What it does:
    • Auth Authorization: Bearer <API key>; errors {error}; list pagination offset/limit (default 20) with pagination{offset,limit,total}.
    • GET /api/v1/deployments; GET /api/v1/deployments/{id}/environments?type=production|staging|development with api_credentials (REST url, SQL host/port).
    • POST …/environments/{envId}/tokens-for-meta-sync {security_context*, scopes?: ["meta-private"], expires_in ≤3600} → token with meta scope (Metadata API: /v1/data-sources, /v1/entities, /v1/model-export), meta-private only for admins / SchemaRead holders; model-export with meta-private bypasses DAP hiding for lineage.
    • PUT /build/api/v1/deployments/{id}/branches/staging-environment {enabled, branchName|branchId} — keep a shared branch's staging env always on.
    • GET /api/v1/deployments/{id}/versions → [{releaseChannelVersion, version, releaseChannel, isLatestInChannel, isCurrent}]; change via PUT /api/v1/deployments/{id} {releaseChannelVersion | releaseChannel}.
    • GET /api/v1/audit-logs/export?start&end&search&eventName&userEmail → CSV (Enterprise, AuditLogManage, key scoped to all deployments + endpoint scope).
    • POST /api/v1/deployments/{id}/dashboard-exports (async render job; see Dashboard Exports).
    • "Control Plane API is only available in Cube Cloud."
  • Availability: CLOUD-ONLY. Evidence: explicit statement; Metadata API routes absent from Core gateway.
  • Core building blocks to use: Core JWT signing for tokens; /v1/meta (incl. extended) as a partial substitute for the Metadata API.
  • To build on Core: see per-group sections below.
  • Gotchas: Core has no /v1/model-export or lineage API — catalogs integrations would need a custom endpoint built from /v1/meta + compiler internals.

Part C — Cube Platform API (specs/api.yaml) by endpoint group ​

Common conventions (copy these): host https://{tenant}.cubecloud.dev, Authorization: Bearer <API key>; data-model/branch endpoints under /build/api/v1 (routed to build pods); newer lists use cursor pagination first/after + pageInfo; PUT …/by-slug/{slug} and …/by-public-id/{publicId} upserts for GitOps; JSON-config "file" endpoints (GET …/file → {content: canonical JSON (sorted keys, 2-space), hash: sha256}, PATCH …/file {edits:[{oldText,newText,replaceAll?}], expectedHash?} → all-or-nothing, 409 on hash mismatch) designed for LLM/agent editing; long jobs are submit (202) → poll → result/download; idempotency keys on promotions and syncs. GET /api/v1/spec returns the OpenAPI document.

Platform API: Deployments, Deployment Creation, Environments, Env Variables, Regions, Versions ​

  • Docs: specs/api.yaml tags Deployments (12 ops), Deployment Creation, Environments, Env Variables, Regions; control-plane-api.md
  • What it does:
    • Deployment{id, name, deploymentUrl, creationStep}; DeploymentSettings{…, cloudProvider, region, template: single|simpleCluster|multiCluster, deployMode, releaseChannel, releaseChannelVersion(+Hold), cubeImageVersion, deployBranchName, deployBranchReadOnly, deployBranchMergeAllowed, deployProjectRoot, customDomain, autoDomain, isCubeSqlEnabled, isSupportPreAggregations, isCold, isManaged, autoAgentEnabled, defaultAgentId, launchpadTabs, defaultLaunchpadViewGroup, cspsConfig}; GET/PUT/DELETE; GET …/settings.
    • Onboarding wizard state: POST …/creation-step/advance|reset.
    • POST /build/api/v1/deployments {name, cloudProvider, region, targetPlatform, isManaged, creationStep, starterProject: empty|none, template} creates + first build.
    • Ops: GET …/build-status?branch ({status, mode, buildJobId, cubeVersion, errorText, filesHash, lastHash}), GET …/logs?source=production|dev&container ({date, message, pod}), GET …/pods ({name, type, status, ready, restartCount, containers}), GET /api/v1/regions.
    • DeploymentEnvironment{id, type: production|staging|development, branch, user, api_credentials[{type, url|host,port,database, version}]}.
    • Env vars: GET|PUT …/env-vars {env_variables:[{name,value}]} — includes DB connection settings.
  • Availability: CLOUD-ONLY (managed hosting). Core equivalent: env vars / cube.js config and your own container orchestration; no deployment API.
  • Core building blocks to use: Core Docker image, CUBEJS_* env vars, health endpoints (/readyz, /livez), refresh worker / Cube Store topology.
  • To build on Core: control plane (K8s operator or Terraform + API) for provisioning, version pinning, env var store/secrets, log/pod passthrough. L–XL.
  • Gotchas: Cloud's per-branch environments (dev/staging) imply running extra Cube API instances per branch — costly to replicate.

Platform API: Tokens (deployment token, environment tokens, meta-sync, usage analytics) ​

  • Docs: specs/api.yaml POST /deployments/{id}/token, GET|POST …/environments/{envId}/tokens, …/tokens-for-meta-sync, POST /usage-analytics/token
  • What it does: CreateDeploymentEnvironmentTokenInput{security_context*, scopes?, expires_in?} → {token, created_at, expires_at, security_context}; tokens are listable per environment. POST /deployments/{id}/token {expiresIn 60–86400, default 86400} → {cubeApiToken} for the caller's (e.g. embed user's) security context. Usage Analytics token → {token, apiUrl, deploymentId, expiresAt} for a Cloud-hosted deployment modelling the tenant's own usage data.
  • Availability: CORE+CLOUD. Core: tokens are ordinary JWTs signed with the API secret (or your IdP). Cloud: minting service, scopes (meta, meta-private), token listing, per-user context resolution.
  • Core building blocks to use: CUBEJS_API_SECRET, contextToApiScopes, checkAuth.
  • To build on Core: token service endpoint + audit table. S.
  • Gotchas: Core can't list/revoke issued JWTs without a jti denylist in checkAuth.

Platform API: Data Model, branches, dev mode, uploads, history, GitHub ​

  • Docs: specs/api.yaml tags Data Model (15), Data Model Uploads (4), Data Model History (3), GitHub (4), GitHub Connection (1); control-plane-api.md (staging environment)
  • What it does: Branch model {id, name, parentBranch, lastHash, isStagingEnvironmentEnabled}; create ({name, from, activate}), delete, enter/exit dev mode, commit {message, exitDevMode, resolveMergeConflict}, merge (git-flow into parent), merge-to-default, pull; file CRUD GET|PUT|DELETE /data-model/files, rename; GET /data-model/validate → {valid, errors[{fileName,message}], cubesCount, mode}; transactional upload (start → upload/file → finish {files, autoRemoveFiles, commitMessage}; file-hashes for diffing) — this is what the Core @cubejs-backend/cloud CLI uses; history: commits, commit-diff, branch-diff; GitHub App installations/repos/branches, github/connect.
  • Availability: CLOUD-ONLY. Core: reads model files from disk (repositoryFactory, schemaPath), recompiles on change in dev mode; no git/branch/IDE API.
  • Core building blocks to use: repositoryFactory (serve a branch's files), schemaVersion (invalidate on commit hash), contextToAppId (branch as part of app id to preview branches on one instance), Core compile errors via /v1/meta failure.
  • To build on Core: git-backed model service (isomorphic-git/libgit2), branch → Cube instance or app-id mapping, validation endpoint (compile via schema-compiler in a sandbox), web IDE. L.
  • Gotchas: validating a model requires running the Core compiler (Node + Python/Jinja for YAML templates).

Platform API: Model sync integrations (dbt Sync, Snowflake Semantic Views, Databricks Metric Views, Apache Ossie) ​

  • Docs: specs/api.yaml tags dbt Sync (7), Snowflake Semantic View Sync (6), Databricks Metric View Publication (4) + Integration (6), Ossie Conversion (5)
  • What it does: Async jobs. dbt: {source: git|manifest, manifest?, ref, namePrefix, outputPath, output: branch|files, branchName} → generated cube files committed to a new branch or returned. Snowflake: push Cube views to Semantic Views ({schema, prefix, viewNames, dataSource, branchName, idempotencyKey}) and pull Semantic Views into Cube files. Databricks: per-datasource publication config (targetCatalog/Schema, selectionMode, viewNames|viewNameRegex, deletionPolicy, syncOnDeploy, optimistic expectedConfigurationVersion) + runs + previews. Ossie: import/export between Cube models and "Apache Ossie" YAML (direction, dialect: ANSI_SQL|SNOWFLAKE|DATABRICKS|BIGQUERY, strictFanout).
  • Availability: CLOUD-ONLY. Core contains @cubejs-backend/dbt-schema-extension (Core package, v1.8.35) — a dbt-to-model helper usable from model code — but not the sync job API. Likely covered in depth by another slice.
  • Core building blocks to use: dbt-schema-extension, /v1/meta for export.
  • To build on Core: converters + job runner per target. M each.
  • Gotchas: out of scope for embedding; listed for completeness.

Platform API: Workspace & Folders ​

  • Docs: specs/api.yaml tags Workspace (5), Folders (5)
  • What it does: Unified tree of type: FOLDER|WORKBOOK|REPORT items; Folder{id, name, parentId, position, folderPath[], user, createdBy/updatedBy}; GET /workspace?folderId&types&orderByField&orderByDirection&search&first&after (returns Workbook-shaped items), GET /shared-workspace, move, bulk-move, bulk-delete (with per-item failures); folder CRUD + ancestors.
  • Availability: CLOUD-ONLY. Evidence: Cloud workspace product; nothing in Core.
  • Core building blocks to use: none.
  • To build on Core: content tree tables + ACL (see Roles/Policy resource types Folder, Workbook, Report). S–M.
  • Gotchas: sharing ACLs per folder are recursive (see Creator Mode).

Platform API: Workbooks, dashboards & calculated fields ​

  • Docs: specs/api.yaml tag Workbooks (16)
  • What it does:
    • Workbook{id, name, slug, type, folderId, folderPath, meta, calculatedFields, dashboardDraft: DashboardConfig, dashboardPublished: DashboardConfig, publishedDashboard: Dashboard, promotion, user, isFavorite}; CRUD, upsert by slug, duplicate ({shared, addedControls}), AI name-suggestion.
    • DashboardConfig{kind: CLASSIC|APP, title, description, widgets[], layout{breakpoints, cols, rowHeight, margin, containerPadding}, theme, settings, app?: {entry, files, manifest{dependencies, version}}} — APP kind = code-based dashboard apps.
    • DashboardWidget{id, type: CHART|TEXT|FILTER|AI|TIME_GRAIN|FIELD|PARENT|SPACER|DIVIDER|DYNAMIC_CONTROLS|CONTAINER, position{x,y,w,h}, responsiveLayouts{lg,md,sm,xs,xxs}, config, style} (react-grid-layout model).
    • Dashboard (published version) {id, publicId, workbookId, versionId, versionNumber, status: draft|published|archived, allowEmbed, restrictDataDownload, config, reportSnapshots[], title}; PUT …/dashboard {dashboardDraft}; POST …/publish {workbookId, dashboardId?, config?, allowEmbed?, expectedVersionId?} (optimistic concurrency); dashboard/file GET/PATCH text editing; dashboard/ai-widget-thread.
    • Filter model (shared by notifications/exports): DashboardFilter{member, operator: equals|not_equals|gt…|contains…|in_month|in_quarter|in_year|is_null|is_empty|between|custom|top_n|bottom_n, value, caseSensitive, startInclusive, endInclusive, rankMeasure}, DashboardCrossFilter{sourceWidgetId, view, dimensions[]}, DashboardTimeGrain{member, grain}, DashboardMemberSwitcher{member, selected}, DashboardAddedControl{key, type, config}.
    • CalculatedField{id, name, title, description, semanticView, expression, memberRole: measure|dimension, valueType: string|time|boolean|number|number_agg|count|count_distinct|count_distinct_approx|sum|avg|min|max|geo, format: percent|currency|imageUrl|id|link} — workbook-scoped ad-hoc members.
    • ReportSnapshot{id, reportId, versionNumber, kind: vega|table|kpi|html|map|sankey, spec, sqlQuery, pythonCode, periodComparisons[{measure, timeDimension, offset{amount,unit}, outputs}], fillMissingRows, preferences.columnFormats}.
  • Availability: CLOUD-ONLY. Evidence: Cloud BI product; no storage in Core.
  • Core building blocks to use: /v1/load + /v1/cubesql for widget queries; Core SQL API supports ad-hoc expressions (calculated fields can compile to SQL API MEASURE()/expressions over views); /v1/meta for pickers; drillMembers.
  • To build on Core: workbook/dashboard service (draft vs published versions, optimistic concurrency, publicId), grid dashboard UI, calculated-field compiler to SQL API, Vega/table/KPI renderers, Python sandbox for pythonCode (embed python-run endpoint). XL.
  • Gotchas: period comparisons and fill-missing-rows are post-processing Cloud features, not Core query features.

Platform API: Workbook Promotions ​

  • Docs: specs/api.yaml tag Workbook Promotions (5)
  • What it does: Copy a workbook+published dashboard to another deployment (e.g. staging→prod): promotion-previews {targetDeploymentId, …} → {sourceHash, destinationHash, destinationWasDiverged, reportCount, targetWorkbookId}; promotions {targetDeploymentId, targetFolderId, expectedSourceHash, expectedDestinationHash, idempotencyKey, override} → WorkbookPromotion{outcome, performedBy, source, target, targetDashboardVersionId, destinationChangedSincePreview}; promotion links and history.
  • Availability: CLOUD-ONLY.
  • Core building blocks to use: none.
  • To build on Core: content export/import with hashing and divergence detection. M.
  • Gotchas: member names must exist in the target deployment's model.

Platform API: Reports & External Documents (Sheets/Excel) ​

  • Docs: specs/api.yaml tags Reports (11), External Documents (2)
  • What it does: Report{id, publicId, name, title, description, jsonQuery (Core REST query JSON as string), sqlQuery, pivotItems{rows, columns, measures, filters, measuresAxis, totals…}, source: GOOGLE_SHEETS|EXCEL|PLAYGROUND|D3, workbookId, folderId, externalWorkbookId, externalWorkbookPlacements[{workbookId, sheetId, anchorCell, resultLocation, endResultCell, queryChecksum, resultChecksum, syncStatus: UP_TO_DATE|CHANGED|UNKNOWN, refreshedAt}], rolesWithAccess, version}; CRUD, upsert by publicId, refresh, connect-workbook (bind to a spreadsheet location with a placementProof obtained from external-documents/{id}/placement-proof using a Google Apps Script OAuth token), file GET/PATCH.
  • Availability: CLOUD-ONLY. Evidence: Cloud Sheets/Excel add-ins.
  • Core building blocks to use: /v1/load (jsonQuery is a Core query), /v1/sql, /v1/cubesql.
  • To build on Core: saved-query store + spreadsheet add-ins (Apps Script / Office.js) that write ranges, placement tracking with checksums. L.
  • Gotchas: proof-of-placement exists to stop users binding reports into sheets they can't access.

Platform API: Report Deliveries (scheduled Google Sheets writes) ​

  • Docs: specs/api.yaml tag Report Deliveries (10)
  • What it does: ReportDelivery{id, name, reportId, destination{spreadsheetId, sheetId|sheetName, anchorCell}, schedule{cronExpressions[], timezone}|null(manual), writeMode: overwrite|append|new_sheet, shape.columns[{column, header, placeholder}], notifications{email, inbox, slackChannelId}, status: active|failing|needs_reconnect|no_sheet_access|orphaned, ownerUserId (whose Google account writes), runAsUserId (whose data access), lastRunAt, lastSuccessAt, nextRunAt, pausedAt, runningSince}; pause/resume; runs {trigger: manual|schedule, status, rowsWritten, cellsWritten, error{code: collision|shape-changed|query-failed|reconnect, text}}.
  • Availability: CLOUD-ONLY.
  • Core building blocks to use: /v1/load with a minted token for runAsUserId's security context.
  • To build on Core: scheduler (cron + tz), Google OAuth per user, Sheets writer, run log, alerting. M.
  • Gotchas: separate "owner" (credentials) vs "run as" (data access) identities.

Platform API: Dashboard Exports (server-rendered PNG/PDF) ​

  • Docs: control-plane-api.md; specs/api.yaml tag Dashboard Exports (3)
  • What it does: POST /deployments/{id}/dashboard-exports {dashboardId XOR dashboardPublicId, format: png|pdf, layout: screenshot|print (print = PDF only, A4, all tabs and all table rows, controls summarised), filters, timeGrains, memberSwitchers, renderAs?: {type: USER|EMBED_USER, userId|email | externalId, embedTenantName, groups, userAttributes, securityContext}} → {jobId, expiresAt} (5 min; 15 for print); poll {status: pending|processing|completed|failed, progress, error, contentType}; …/download. Only submitter can poll. Requires workbook read + DownloadData. renderAs (admin) renders under another user's RLS — embed subjects are provisioned on the fly, context applies to that render only — for per-recipient scheduled reports. Errors 400/403/404/429 (per-identity concurrency limit).
  • Availability: CLOUD-ONLY.
  • Core building blocks to use: Core JWT minting for the renderAs subject; /v1/load.
  • To build on Core: headless-browser render farm (Playwright) + job queue + temp file store; print layout renderer. M.
  • Gotchas: must wait for all widget queries (Core Continue wait long-polling) before capture.

Platform API: Notifications (scheduled dashboard snapshots) ​

  • Docs: specs/api.yaml tag Notifications (8)
  • What it does: Notification{id, dashboardId, cronExpression, humanReadableSchedule, timezone, isEnabled, notificationEnabled, notificationFormat: png|pdf|pdf_print, notificationAiSummary (AI "what changed" summary), filters, crossFilters, timeGrains, memberSwitchers, addedControls}; create via scheduleType: HOURLY|DAILY|WEEKLY|MONTHLY|CUSTOM + minute/hour/dayOfWeek/dayOfMonth/customCron; recipients {type: USER|EMBED_USER|SLACK, userId|email | externalId+embedTenantName | channelId} add/list/remove.
  • Availability: CLOUD-ONLY.
  • Core building blocks to use: as Dashboard Exports.
  • To build on Core: scheduler + export renderer + email/Slack senders + per-recipient RLS rendering + optional LLM diff summary. M.
  • Gotchas: embed users can be recipients — each needs their own render under their context.

Platform API: Scheduled Tasks (scheduled agent prompts with conditions) ​

  • Docs: specs/api.yaml tag Scheduled Tasks (7)
  • What it does: ScheduledTask{id, name, description, prompt (instructions; each run = new chat thread), agentId|null(default), cronExpression (5-field)|null(manual), timezone (default UTC), isEnabled, nextRunAt, userId (runs as creator), notification{channels{inbox, email, slack}, userIds, groupIds, slackChannels[{id,name}], optedOutUserIds}, condition?{measure, timeDimension, granularity: day..year, rule{type: threshold(op gt|lt|eq, value) | change(direction up|down|either, percent) | anomaly}}, lastConditionCheck{status, value, previous, changePercent, band{low,median,high}, period, notifiedAt}}; run now; runs {chatThreadUuid, status}. Condition is evaluated by reading the measure once before running the agent; agent runs only when it holds (alerting).
  • Availability: CLOUD-ONLY.
  • Core building blocks to use: /v1/load for the condition measure (last complete period via timeDimensions + dateRange), agent service (Chat API rebuild).
  • To build on Core: scheduler, condition evaluator (threshold/change/anomaly band), agent runner, notifier with unsubscribe. M (on top of an agent).
  • Gotchas: "last complete period" semantics and hold/re-notify state machine (held-notified, held-already-notified).

Platform API: Agents & Chat History ​

  • Docs: specs/api.yaml tags Agents (2), Chat History (2); chat-api.md
  • What it does: GET …/agent-defaults → {autoAgentEnabled, defaultAgentId}; GET …/agent-suggestions → suggested prompts. Chat history (audit/analytics of conversations): GET …/chat-history/threads?createdAfter/Before&updatedAfter/Before&userId&userEmail&externalUserId&userType: internal|external&source: web|api|mcp|slack|scheduled&initialContext&dashboardPublicId&agentId&search&sortBy&sortOrder&includeTurns&first&after; ChatHistoryThread{chatId, agentId|null(Auto), title, source, initialContext, dashboard{publicId,title}, user{id, type, email, name, externalId}, turns[{index, messageId, prompt, files[], finalAnswer, tools[], queries[{tool: cubeSqlApi|runSql, sql, title, status, rowCount, columns, rows(≤100), error, dataSource, feedback{isPositive,userId}}], steps[{type: model|tool, text, reasoning, tool, input, status}], startedAt, endedAt}]}. Agent configuration itself (rules, skills, certified queries, multi-agent) is not in this spec.
  • Availability: CLOUD-ONLY.
  • Core building blocks to use: none.
  • To build on Core: thread/turn/step/query schema exactly like above in your agent store + query API. S–M (given an agent).
  • Gotchas: embedded users have ids in a separate number space; identify by externalId.

Platform API: Email ​

  • Docs: specs/api.yaml tag Email (1)
  • What it does: POST /api/v1/email {subject, body (plain text), recipients[{email}] (workspace members only), groups[{name}], attachments[{filename, contentType: pdf|png|csv, content base64}] ≤20 MiB} → {sent, queued, recipientCount, skipped[{reason}]}; no recipients = send to caller. Descriptions are written for an AI agent tool ("do not say it was delivered").
  • Availability: CLOUD-ONLY.
  • To build on Core: SMTP/SES wrapper with recipient allow-list. S.
  • Core building blocks to use: none. Gotchas: restrict to workspace members to avoid becoming a spam relay.

Platform API: Users, Users Admin, API Keys ​

  • Docs: specs/api.yaml tags Users (1), Users Admin (5), API Keys (4)
  • What it does: User{id, username, email, firstName, title, picture, isAdmin, isDeactivated, externalId, samlId, gitUser, aliases[{username, source: ldap|saml|scim|manual}], defaultRoles, activeRoleId, userPolicies (effective), settings, notifications, impersonation{impersonatedUser, startedAt, expiresAt}, lastLogin}; create/update/delete, bulk DEACTIVATE|ACTIVATE|DELETE, GET /users/{id}/roles, PATCH /users/me/settings; UserUpdateInput also carries securityContext and embedTheme. API keys {name, deploymentIds (scope), allowedEndpoints (endpoint scope), ttlHours, expiresAt, lastUsedAt, suffix}; token returned once on create.
  • Availability: CLOUD-ONLY. Core has no user store (identity comes from the JWT).
  • Core building blocks to use: checkAuth to map your users to security contexts.
  • To build on Core: user/identity service (or adopt Keycloak/Zitadel), API-key service with deployment + endpoint scoping. M.
  • Gotchas: per-user stored securityContext is a Cloud concept that Core would receive via the minted JWT.

Platform API: Roles & policies ​

  • Docs: specs/api.yaml tag Roles (8)
  • What it does: Role{id, name, description, policies[]}; Policy{resourceType: Global|Deployment|Report|ReportFolder|Agent|AgentSpace|Workbook|Dashboard|Folder|ChatThread|ScheduledTask, resources[ids], actions[]} with ~60 actions (e.g. DeploymentRead/Update, SchemaRead/Update, SchemaUpdateDevBranches, DownloadData, PlaygroundRead, APMRead, ChatHistoryRead, PreAggregationRead/Build, AuditLogManage, SqlRunnerRead, ReportRead/Edit/Manage, WorkbookRead/Edit/Manage, AgentManage/Read/Admin, ScheduledTasks*, OAuthIntegrations*, McpToolsManage, AIBIDevelop/Explore/View, EmbedDeploymentRead, EmbedDashboardRead, Folder*, ChartPalettesManage, DashboardThemesManage). Built-in role names reserved (Admin, Developer, …). Assign/unassign roles to users; list holders.
  • Availability: CLOUD-ONLY for product RBAC. Core has data-level access_policy keyed on groups (contextToGroups) — not product permissions.
  • Core building blocks to use: access_policy + contextToGroups for data; contextToApiScopes for API-level gating.
  • To build on Core: policy engine (e.g. Casbin/OpenFGA) over your content resources. M.
  • Gotchas: keep product RBAC and data access policies separate, as Cloud does.

Platform API: Tenant settings, App config/theme, OAuth integrations, OIDC token configs ​

  • Docs: specs/api.yaml tags Tenant Settings (2), App Theme (1), OAuth Integrations (5), User OAuth Tokens (4), OIDC Token Configs (5)
  • What it does: TenantSettings{auditLogEnabled, oidcEnabled, hasSupportAccess, maintenanceWindow{Enabled,Day,Time}, aiTokensAutoPurchase{Enabled,Threshold,Amount}, useAIBIUserInterface}. GET /app-config → {appTheme, applyThemeGlobally, embedding: EmbedSettings, creatorMode, timezoneSettings{enabled, timezone, allowUserOverride}, restrictDataDownload, aiPaywalled, dashboardAppsEnabled, boardDashboardsEnabled, sheetsUi…}. OAuth integrations {name, type, authUrl, tokenUrl, clientId, redirectUri, scopes, config} + per-user tokens (initiate flow, status, revoke) — lets agents/tools act with users' third-party credentials. OIDC token configs {name, audience, audienceType, subFormat, customClaims, targetEnvVar, isEnabled} — Cube Cloud acting as an OIDC issuer for workload identity (e.g. federated warehouse auth).
  • Availability: CLOUD-ONLY.
  • Core building blocks to use: OIDC configs map to Core driver auth via env vars (the targetEnvVar hint).
  • To build on Core: settings store + OAuth client broker + OIDC issuer. M.
  • Gotchas: none specific.

Platform API: SCIM 2.0 ​

  • Docs: specs/scim.yaml
  • What it does: RFC 7643/7644 at https://<tenant>.cubecloud.dev/api/scim/v2, Bearer <SCIM token>. User{id, userName* (email), name{givenName,familyName}, emails[{value,primary}], active, externalId, meta}; Group{id, displayName*, members[{value, display}], meta}; list (filter e.g. userName eq "…", startIndex, count), get, POST, PUT, PATCH (PatchOp{Operations[{op,path,value}]} — deactivate via active:false, add/remove members), DELETE (group delete keeps users). application/scim+json accepted.
  • Availability: CLOUD-ONLY. Core has no user/group store.
  • Core building blocks to use: groups provisioned by SCIM feed contextToGroups via token claims.
  • To build on Core: SCIM server (libraries exist, e.g. scim2 node/py) over your user/group tables. S–M.
  • Gotchas: user aliases with source: scim link IdP identities to existing users.

Platform API: Audit Log export ​

  • Docs: control-plane-api.md; specs/api.yaml tag Audit Log (1)
  • What it does: GET /api/v1/audit-logs/export?start&end&search&eventName&userEmail streams CSV; Enterprise; AuditLogManage; key must be all-deployment scoped and endpoint-scoped. Tenant settings toggle auditLogEnabled.
  • Availability: CLOUD-ONLY. Enterprise.
  • Core building blocks to use: none (Core does not audit admin events).
  • To build on Core: append-only event table in your control plane + CSV export. S.
  • Gotchas: event catalogue isn't in this slice.

Platform API: Query History ​

  • Docs: specs/api.yaml tag Query History (2)
  • What it does: GET …/query-history/requests?from&to&status&apiType&minDurationMs&search&first&after → QueryHistoryRequest{id, requestId, spanId, timestamp, apiType: rest|graphql|sql|ws, query, securityContext (JSON), status: success|error|running|noResponse, durationMs, responseBytes, cacheType (cube|cube-suboptimal|…), usedPreAggregations, preAggregations, isPlayground, isSubscription, error}; detail adds sqlQueries[≤100]{executor: dataSource|cubeStore, sql, params, durationMs, executionDurationMs, queueDurationMs, error}.
  • Availability: CORE+CLOUD. Core emits the raw events through its logger (verified event names in Core: Load Request, Load Request Success, Executing SQL, Performing query completed, Query completed, Found cache entry, Missing cache for) with requestId, query, duration and security context; Cloud adds APM ingestion, storage, search and API.
  • Core building blocks to use: logger config option (JSON logs), requestId/x-request-id correlation, /v1/running-query/:requestId.
  • To build on Core: log shipper → ClickHouse/Postgres table keyed by requestId with child SQL spans; query API + UI. M.
  • Gotchas: security context is logged — treat the store as sensitive.

Platform API: Usage Analytics & OpenAPI spec ​

  • Docs: specs/api.yaml tags Usage Analytics (1), OpenAPI Spec (1)
  • What it does: Usage Analytics issues a JWT for a Cloud-hosted Cube deployment whose model covers the tenant's own Cube usage (queried via standard Core REST). GET /api/v1/spec serves the OpenAPI doc.
  • Availability: CLOUD-ONLY (but the delivery mechanism — a Cube deployment over usage data — is reproducible with Core once Query History data exists).
  • Core building blocks to use: a second Core instance modelling your query-history tables.
  • To build on Core: S once Query History store exists.
  • Gotchas: none.

Summary table ​

FeatureAvailabilityPlanEffort to build on CoreDepends on
JWT authentication (check_auth, JWKS, claims)COREallSjwt options, checkAuth
Security context (query_rewrite, COMPILE_CONTEXT, extend_context)CORE (Cloud auth-integration toggle: CLOUD-ONLY)allSqueryRewrite, extendContext, contextToAppId
IdP recipes (Auth0, Cognito)COREallSJWKS env vars
MultitenancyCOREallS (config) / L (sharding router)contextToAppId, contextToOrchestratorId, driverFactory, repositoryFactory, scheduledRefreshContexts
Headless embedding via Core Data APIsCOREalldepends on UIREST/GraphQL/SQL APIs
Private iframe embeddingCLOUD-ONLYPremium, EnterpriseMuser login/SSO, dashboard app
Signed embedding & sessions (generate/exchange/revoke)CLOUD-ONLYPremium, EnterpriseMCore JWT, user/attribute store, denylist in checkAuth
Embedded dashboards + URL params/export/header/autoRefreshCLOUD-ONLYPremium, EnterpriseLdashboard product, /v1/load, headless browser
Embedded Analytics Chat iframeCLOUD-ONLYPremium, EnterpriseLagent service
Feature visibility layersCLOUD-ONLYPremium, EnterpriseS–Msession claims, settings store
postMessage events/actions + session renewalCLOUD-ONLYPremium and aboveS–Membed app shell
Localization of embedsCLOUD-ONLYPremium, EnterpriseS–MUI i18n
Time zones for embedsCORE+CLOUDPremium and aboveSquery timezone, scheduledRefreshTimeZones
Customization / embedTheme / app themeCLOUD-ONLYnot stated (Premium via embedding)SUI theming
Creator Mode (embed tenants, default dashboards, sharing)CLOUD-ONLYEnterpriseXLfull BI authoring product
User attributes & groups (RLS)CORE+CLOUDnot statedS–Maccess_policy userAttributes/groups → securityContext.cubeCloud, contextToGroups
React Embed SDKCLOUD-ONLYPremium, Enterprise (preview)M–L@cubejs-client/react
Dashboard Comments APICLOUD-ONLYPremium and aboveS–Mcomments store, embed tenant
Chat API (NDJSON streaming agent)CLOUD-ONLYPremium, EnterpriseL–XLLLM, /v1/meta, /v1/cubesql, thread store
Control Plane API (doc page)CLOUD-ONLYCloud; audit export Enterpriseper group—
Deployments / creation / environments / env vars / regions / versions / logs / podsCLOUD-ONLYnot statedL–XLorchestration (K8s)
Tokens (deployment, environment, meta-sync, usage analytics)CORE+CLOUDnot statedSAPI secret, contextToApiScopes
Data model, branches, dev mode, uploads, history, GitHubCLOUD-ONLYnot statedLgit service, repositoryFactory, schemaVersion
Model sync integrations (dbt, Snowflake SV, Databricks MV, Ossie)CLOUD-ONLYnot statedM eachconverters; Core dbt-schema-extension
Workspace & foldersCLOUD-ONLYnot statedS–Mcontent store, ACL
Workbooks, dashboards, calculated fieldsCLOUD-ONLYnot statedXL/v1/load, /v1/cubesql, UI
Workbook promotionsCLOUD-ONLYnot statedMcontent export/import
Reports & external documents (Sheets/Excel)CLOUD-ONLYnot statedLspreadsheet add-ins, /v1/load
Report deliveries (Google Sheets)CLOUD-ONLYnot statedMscheduler, Google OAuth
Dashboard exports (PNG/PDF, renderAs)CLOUD-ONLYnot statedMheadless browser, JWT minting
Notifications (scheduled dashboard snapshots)CLOUD-ONLYnot statedMscheduler, exports, email/Slack
Scheduled tasks (agent + conditions)CLOUD-ONLYnot statedMagent, scheduler, /v1/load
Agents & chat history APICLOUD-ONLYnot statedS–Magent store
Email APICLOUD-ONLYnot statedSSMTP
Users, users admin, API keysCLOUD-ONLYnot statedMidentity service
Roles & policies (product RBAC)CLOUD-ONLYnot statedMpolicy engine
Tenant settings, app config, OAuth integrations, OIDC token configsCLOUD-ONLYnot statedMsettings store, OAuth broker
SCIM 2.0CLOUD-ONLYnot statedS–Muser/group store
Audit log exportCLOUD-ONLYEnterpriseSevent table
Query historyCORE+CLOUDnot statedMCore logger events, log store
Usage analytics token / OpenAPI specCLOUD-ONLYnot statedSquery history store

Pages read ​

  1. pages/embedding/index.md
  2. pages/embedding/react-embed-sdk.md
  3. pages/embedding/multitenancy.md
  4. pages/embedding/authentication/jwt.md
  5. pages/embedding/authentication/security-context.md
  6. pages/embedding/authentication/auth0.md
  7. pages/embedding/authentication/aws-cognito.md
  8. pages/embedding/iframe/auth/private.md
  9. pages/embedding/iframe/auth/signed.md
  10. pages/embedding/iframe/analytics-chat.md
  11. pages/embedding/iframe/customization.md
  12. pages/embedding/iframe/localization.md
  13. pages/embedding/iframe/time-zones.md
  14. pages/embedding/iframe/dashboards.md
  15. pages/embedding/iframe/events.md
  16. pages/embedding/iframe/feature-visibility.md
  17. pages/embedding/iframe/creator-mode.md
  18. pages/reference/embed-apis/index.md
  19. pages/reference/embed-apis/generate-session.md
  20. pages/reference/embed-apis/dashboard-comments.md
  21. pages/reference/embed-apis/chat-api.md
  22. pages/reference/control-plane-api.md

Specs/indexes: specs/api.yaml (Cube Platform API 1.0.0, 46 tags, 226 operations), specs/chat.yaml (Chat API: stream-chat-state, abort), specs/scim.yaml (SCIM Users/Groups, 12 ops), api.txt (API page index; confirms tag list incl. Core Data endpoints JSON query / SQL query / Load Metadata, which belong to another slice).