---
title: "Generate an embed session"
method: POST
path: "/api/v1/embed/generate-session"
tags: ["Embed"]
---

# Generate an embed session

`POST /api/v1/embed/generate-session`

## Request body

- GenerateSession
  - `creatorMode` boolean, nullable
  - `deploymentId` number, required
  - `email` string, nullable
  - `embedTenantName` string, nullable
  - `embedTenantProfile` EmbedTenantProfile
    - `displayName` string, nullable
  - `embedTheme` EmbedTheme
    - `analyticsChat` EmbedThemeAnalyticsChat
      - `backgroundColor` string, nullable
      - `chatInput` EmbedThemeAnalyticsChatInput
        - `backgroundColor` string, nullable
        - `borderColor` string, nullable
    - `chat` EmbedThemeChat
      - `inputColor` string, nullable
    - `font` string, nullable
    - `primaryColor` string, nullable
  - `externalId` string, nullable
  - `groupDefinitions` GroupDefinition[], nullable — Deprecated and ignored. Global groups can no longer be created through this endpoint — define them beforehand via the Cube UI or admin API. Still accepted for backward compatibility (no error), but it has no effect. To create per-embed-tenant groups, use `tenantGroupDefinitions`.
    - `description` string, nullable
    - `name` string, required
  - `groups` string[], nullable — Global user groups — defined once at the tenant level and shared across every embed tenant — to assign this embed user to. Use `groups` for **data-model access control**: each name is placed verbatim into the Cube security context as `cubeCloud.groups`, where your data model's `access_policy` rules reference it to gate cubes, views, members, and row-/column-level filters. The groups must already exist in the tenant (create them via the Cube UI or admin API beforehand) — this endpoint never creates global groups, and names that do not resolve to an existing group are rejected. Global groups are NOT shown in an embed tenant’s Creator Mode UI. To share or organize content inside a single embed tenant, use `tenantGroups` instead.
  - `internalId` string, nullable
  - `isEphemeral` boolean, nullable
  - `publicDashboardId` string, nullable
  - `roles` string[], nullable
  - `securityContext` object, nullable
  - `settings` EmbedSessionSettings
    - `allowChatWorkspaceAuthoring` boolean, nullable — Whether AI Chat authenticated with this session may create or modify persistent Cube Workspace content. Set to `false` for headless chat integrations that render answers in their own UI: ad-hoc data analysis and inline tables/charts remain available, but the agent cannot save or update standalone explorations/reports, create or modify workbooks, create or publish dashboards, or direct users to those Cube UI surfaces. Omit or set to `true` to preserve the session user's role-derived authoring capabilities; `true` never grants access the user does not already have. This setting changes only AI Chat tools and instructions. It does not change user roles or permissions for direct API calls.
    - `showDashboardChat` boolean, nullable — Whether embedded published dashboards viewed with this session show the AI chat (agent panel and launcher bubble). Omit to inherit the account-wide embed setting (shown by default); `false` hides the chat even if it is enabled account-wide, `true` shows it even if it is disabled account-wide. Only affects the dashboard surface.
  - `tenantGroupDefinitions` GroupDefinition[], nullable — Idempotently create or update the per-embed-tenant groups referenced by `tenantGroups`, before they are assigned. Requires `creatorMode: true` and `embedTenantName`. Use this to declare a tenant’s groups in the same call that assigns them, so you do not need a separate admin request. Applies only to per-embed-tenant groups; global groups must be defined beforehand.
    - `description` string, nullable
    - `name` string, required
  - `tenantGroups` string[], nullable — Per-embed-tenant user groups — scoped to the single embed tenant named by `embedTenantName` — to assign this embed user to. Use `tenantGroups` for **content sharing and organization within one embed tenant**: for example, so a creator can share a workbook, dashboard, or folder with a group of that tenant’s users. These are the only groups shown in the embed tenant’s Creator Mode UI. Requires `creatorMode: true` and `embedTenantName`. Define the groups beforehand — or in the same request — via `tenantGroupDefinitions`. In the Cube security context they appear namespaced as `system:tenant:{embedTenantName}:group:{groupName}`, so a tenant group can never collide with — or be mistaken for — a global `groups` entry of the same name. For organization-wide data-model access policies, use `groups`.
  - `userAttributeDefinitions` UserAttributeDefinition[], nullable
    - `defaultValue` string, nullable
    - `description` string, nullable
    - `displayName` string, nullable
    - `name` string, required
    - `type` 'string' | 'number' | 'boolean' | 'string_array' | 'number_array', required
  - `userAttributes` UserAttributeInput[], nullable
    - `name` string, required
    - `value` union
      - string
      - number
      - boolean
      - string[]
      - number[]
  - `userProfile` EmbedUserProfile
    - `displayName` string, nullable
    - `picture` string, url, nullable

## Response `200`

- GenerateSessionResponse
  - `sessionId` string, required

## Changes

> 9 revisions in range; 2 could not be searched.

- **2026-07-31** `a0c6b1d2ac96` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/cube-js/apis/cube-cloud-rest-api/changes/api/v1/embed/generate-session/post.md)

---

[API](https://skmtc.dev/cube-js/apis/cube-cloud-rest-api.md) · [All operations](https://skmtc.dev/cube-js/apis/cube-cloud-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cube-js/cube-cloud-rest-api/revisions/97e151460143/schema)
