Documentation
Generate Session

Generate Session

The Generate Session API provides secure, session-based authentication for signed embedding. This API creates temporary sessions that allow external users to access embedded dashboards and visualizations without exposing your API keys.

The Generate Session API is available on Premium and Enterprise plans (opens in a new tab).

Authentication

The Generate Session API requires your Cube Cloud API key for authentication.

Endpoint

POST https://{accountName}.cubecloud.dev/api/v1/embed/generate-session

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
AuthorizationApi-Key YOUR_API_KEYYes

Request Body

FieldTypeRequiredDescription
externalIdstringYesUnique identifier for the external user
emailstringNoUser's email address
userAttributesarrayNoArray of {name, value} pairs for row-level security
groupsstring[]NoArray of group names for user
securityContextobjectNoCustom security context object passed to Cube queries

Accounts are limited to 10,000 external users. To increase this limit, please contact support.

Response

The API returns a session object:

{
  "sessionId": "abc123def456..."
}
FieldTypeDescription
sessionIdstringUnique session identifier to use for embedding content

Use the sessionId directly in your embed URL to authenticate and load content securely.

Code Example

Python
JavaScript
Bash

Use session ID in signed embedding.