Skip to main content
POST
/
ui
/
initSession
Init Session
curl --request POST \
  --url https://partner.peaka.studio/api/v1/ui/initSession \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "timeoutInSeconds": 300,
  "projectId": "projectId",
  "theme": "dark",
  "themeOverride": true,
  "featureFlags": {
    "feature1": true,
    "feature2": false
  }
}
'
{
  "sessionUrl": "https://partner.peaka.studio/api/v1/ui/session?code=2eccdbf31efa110943b470b9023e9a52587c166e4d1c21f23fabbcd7de5b74ab"
}

Feature Flags

Feature flags are used to control the visibility of certain features in the Peaka UI. You can use feature flags to hide or show certain sections of the Peaka UI. Available feature flags are:
Feature FlagDefault Value
createDataInPeakatrue
queriestrue
tablestrue
cachingtrue
metadatatrue
aiAgenttrue
queryHistorytrue
Feature flags are defined in the featureFlags object of the request body.
curl --request POST \
  --url https://partner.peaka.studio/api/v1/ui/initSession \
  --header 'Content-Type: application/json' 'Authorization: Bearer <token>'\
  --data '{
    "projectId": <your_project_id>
    "theme": <your_theme_name>,
    "themeOverride": true,
    "featureFlags": {
      "queries": false,
    }
}'

Authorizations

Authorization
string
header
required

Use the Authorization header with the value 'Bearer ' to authenticate. Partner API Keys have full access; Project API Keys are limited to their project scope. Learn more: https://docs.peaka.com/api-reference/authentication

Body

application/json

Session Initialization Request

projectId
string

The project ID.

theme
string

The theme to be used.

sessionMode
enum<string>

The session mode, determining the type of session to be initialized.

Available options:
CONNECTOR_MODAL_ONLY,
FULL_STUDIO
themeOverride
boolean

Flag indicating whether the theme should be overridden.

timeoutInSeconds
integer<int32>

The timeout duration in seconds.

Response

200 - */*

Session created successfully

sessionUrl
string

The URL of the Embedded Peaka session to be followed.

It is a one-time use URL that will redirect the user to the Peaka session.

partnerOrigin
string

The origin of the partner that the embedded studio is coming from.