> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peaka.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Init Session

> Initializes an Embedded Peaka session and returns a session URL that can be used to embed the Peaka UI in an iframe.

[Embedded Peaka](https://docs.peaka.com/embedded-peaka/introduction) allows you to integrate Peaka's data management capabilities — including connections, catalogs, caching, queries, and a full UI — directly into your application.

The returned <code>sessionUrl</code> should be loaded inside an iframe. For security, direct iframe embedding requires enabling "Embedded UI" in Developer Settings and registering your domain over HTTPS.

#### Configuration options
- <code>theme</code> / <code>themeOverride</code>: Customize the look and feel of the embedded UI, including custom CSS theming.
- <code>featureFlags</code>: Control visibility of UI sections (e.g., enable/disable queries, connectors).
- <code>sessionMode</code>: Choose between <code>FULL_STUDIO</code> (complete Peaka experience) or <code>CONNECTOR_MODAL_ONLY</code> (streamlined connector setup).
- <code>connectorType</code>: Pre-select a specific connector type when using connector-only mode.
- <code>autoCreateCatalog</code>: Automatically create a catalog after a connection is established.

See also: [Data Management Tool with UI](https://docs.peaka.com/embedded-peaka/data-management-tool-with-ui)


<span style={{display: "flex", gap: "10px", flexDirection: "row", alignItems: "center"}}>
  <img src="https://cdn.peaka.com/badges/partner-api-key-badge.png" />

  <img src="https://cdn.peaka.com/badges/project-api-key-badge.png" />
</span>


## OpenAPI

````yaml post /ui/initSession
openapi: 3.0.1
info:
  title: Peaka Gateway API
  description: Peaka Gateway API Documentation
  version: '1.0'
servers:
  - url: https://partner.peaka.studio/api/v1
    description: Default Server URL (US Zone)
  - url: https://partner.eu.peaka.studio/api/v1
    description: EU Zone
security:
  - bearerAuth: []
paths:
  /ui/initSession:
    post:
      tags:
        - Embedded Peaka Api
      summary: Init Session
      description: >
        Initializes an Embedded Peaka session and returns a session URL that can
        be used to embed the Peaka UI in an iframe.


        [Embedded Peaka](https://docs.peaka.com/embedded-peaka/introduction)
        allows you to integrate Peaka's data management capabilities — including
        connections, catalogs, caching, queries, and a full UI — directly into
        your application.


        The returned <code>sessionUrl</code> should be loaded inside an iframe.
        For security, direct iframe embedding requires enabling "Embedded UI" in
        Developer Settings and registering your domain over HTTPS.


        #### Configuration options

        - <code>theme</code> / <code>themeOverride</code>: Customize the look
        and feel of the embedded UI, including custom CSS theming.

        - <code>featureFlags</code>: Control visibility of UI sections (e.g.,
        enable/disable queries, connectors).

        - <code>sessionMode</code>: Choose between <code>FULL_STUDIO</code>
        (complete Peaka experience) or <code>CONNECTOR_MODAL_ONLY</code>
        (streamlined connector setup).

        - <code>connectorType</code>: Pre-select a specific connector type when
        using connector-only mode.

        - <code>autoCreateCatalog</code>: Automatically create a catalog after a
        connection is established.


        See also: [Data Management Tool with
        UI](https://docs.peaka.com/embedded-peaka/data-management-tool-with-ui)
      operationId: initSession
      requestBody:
        description: Session Initialization Request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitSessionRequest'
            examples:
              Session Initialization Request:
                description: Session Initialization Request
                value:
                  timeoutInSeconds: 300
                  projectId: projectId
                  theme: dark
                  themeOverride: true
                  featureFlags:
                    feature1: true
                    feature2: false
        required: true
      responses:
        '200':
          description: Session created successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EmbeddedSession'
              examples:
                Session created successfully:
                  description: Session created successfully
                  value:
                    sessionUrl: >-
                      https://partner.peaka.studio/api/v1/ui/session?code=2eccdbf31efa110943b470b9023e9a52587c166e4d1c21f23fabbcd7de5b74ab
components:
  schemas:
    InitSessionRequest:
      type: object
      properties:
        projectId:
          type: string
          description: The project ID.
        theme:
          type: string
          description: The theme to be used.
        sessionMode:
          type: string
          description: The session mode, determining the type of session to be initialized.
          enum:
            - CONNECTOR_MODAL_ONLY
            - FULL_STUDIO
        themeOverride:
          type: boolean
          description: Flag indicating whether the theme should be overridden.
        timeoutInSeconds:
          type: integer
          description: The timeout duration in seconds.
          format: int32
      discriminator:
        propertyName: sessionMode
    EmbeddedSession:
      type: object
      properties:
        sessionUrl:
          type: string
          description: >
            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:
          type: string
          description: |
            The origin of the partner that the embedded studio is coming from.
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Use the Authorization header with the value 'Bearer <apiKey>' 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
      scheme: bearer
      bearerFormat: Api Key

````