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

# Add app to session

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Lets a session watch one more app. The browser then joins the app's room itself. Adding an app the session already watches changes nothing.

Available only to white-label workspaces on the Builder plan or higher, with live AI chat updates turned on. Ask your onboarding contact to turn them on for your workspace.

The credential must be able to watch the app, and a session watches up to 8 apps. Session calls are limited to 600 requests a minute per workspace. Some workspaces have a different limit. Every request that counts against the limit gets `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix time in seconds) headers, and a `429` also gets `Retry-After` in seconds.



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json put /api/v1/socket-sessions/{session_id}/apps/{app_id}
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/v1/socket-sessions/{session_id}/apps/{app_id}:
    put:
      summary: Add app to session
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Lets a session watch one more app. The browser then joins the app's room
        itself. Adding an app the session already watches changes nothing.


        Available only to white-label workspaces on the Builder plan or higher,
        with live AI chat updates turned on. Ask your onboarding contact to turn
        them on for your workspace.


        The credential must be able to watch the app, and a session watches up
        to 8 apps. Session calls are limited to 600 requests a minute per
        workspace. Some workspaces have a different limit. Every request that
        counts against the limit gets `X-RateLimit-Limit`,
        `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix time in seconds)
        headers, and a `429` also gets `Retry-After` in seconds.
      operationId: >-
        add_socket_session_app_api_v1_socket_sessions__session_id__apps__app_id__put
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            description: >-
              ID of the session, from `session_id` in [Create socket
              session](/api-reference/create-socket-session).
            title: Session Id
          description: >-
            ID of the session, from `session_id` in [Create socket
            session](/api-reference/create-socket-session).
          example: 3f9a1c0e7b2d4e8f9a6b5c4d3e2f1a0b
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{24}$
            description: ID of the app.
            title: App Id
          description: ID of the app.
          example: 6a2024af837c7a06c83021c1
      responses:
        '200':
          description: >-
            The session may watch the app. `app_ids` lists every app it may
            watch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SocketSessionAppsResponse'
          headers:
            X-RateLimit-Limit:
              description: Requests allowed in the current minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the limit resets, in Unix time in seconds.
              schema:
                type: integer
        '401':
          description: >-
            The request has no Bearer token, or the key or personal access token
            isn't valid (`unauthenticated`).
          content:
            application/json:
              examples:
                unauthenticated:
                  summary: unauthenticated
                  value:
                    error:
                      code: unauthenticated
                      message: Invalid workspace API key
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '403':
          description: >-
            The key doesn't have the **Watch app builder updates** permission
            (`scope_required`), the workspace turned personal access tokens off
            (`personal_access_token_policy_violation`), live updates aren't
            turned on for the workspace (`whitelabel_sockets_disabled`), the
            workspace's plan is below Builder (`white_label_plan_required`), or
            the credential can't watch this app (`app_not_allowed`).
          content:
            application/json:
              examples:
                scope_required:
                  summary: scope_required
                  value:
                    error:
                      code: scope_required
                      message: The key needs the apps:watch scope
                      details:
                        required_scope: apps:watch
                personal_access_token_policy_violation:
                  summary: personal_access_token_policy_violation
                  value:
                    error:
                      code: personal_access_token_policy_violation
                      message: >-
                        Personal access tokens are turned off for this
                        workspace.
                      details: {}
                whitelabel_sockets_disabled:
                  summary: whitelabel_sockets_disabled
                  value:
                    error:
                      code: whitelabel_sockets_disabled
                      message: White-label sockets are not enabled for this workspace
                      details: {}
                white_label_plan_required:
                  summary: white_label_plan_required
                  value:
                    error:
                      code: white_label_plan_required
                      message: White label requires a Builder plan or higher
                      details: {}
                app_not_allowed:
                  summary: app_not_allowed
                  value:
                    error:
                      code: app_not_allowed
                      message: This credential cannot watch this app
                      details:
                        app_id: 6a2024af837c7a06c83021c1
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '404':
          description: >-
            The session ended, expired, or was opened by another key or token
            (`session_not_found`).
          content:
            application/json:
              examples:
                session_not_found:
                  summary: session_not_found
                  value:
                    error:
                      code: session_not_found
                      message: Socket session not found
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '409':
          description: The session already watches 8 apps (`app_limit_reached`).
          content:
            application/json:
              examples:
                app_limit_reached:
                  summary: app_limit_reached
                  value:
                    error:
                      code: app_limit_reached
                      message: A session can watch at most 8 apps
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '422':
          description: '`session_id` or `app_id` isn''t a valid ID (`invalid_request`).'
          content:
            application/json:
              examples:
                invalid_request:
                  summary: invalid_request
                  value:
                    error:
                      code: invalid_request
                      message: Invalid request
                      details:
                        errors:
                          - type: string_pattern_mismatch
                            loc:
                              - path
                              - session_id
                            msg: String should match pattern '^[0-9a-f]{32}$'
                            input: 3f9a1c0e
                            ctx:
                              pattern: ^[0-9a-f]{32}$
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '429':
          description: Rate limit reached (`rate_limited`). Retry later.
          content:
            application/json:
              examples:
                rate_limited:
                  summary: rate_limited
                  value:
                    error:
                      code: rate_limited
                      message: Rate limit exceeded
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
          headers:
            X-RateLimit-Limit:
              description: Requests allowed in the current minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: When the limit resets, in Unix time in seconds.
              schema:
                type: integer
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - WorkspaceApiKeyBearerAuth:
            - apps:watch
        - PersonalAccessTokenAuth:
            - read_only
components:
  schemas:
    SocketSessionAppsResponse:
      properties:
        session_id:
          type: string
          title: Session Id
          description: ID of the session.
          examples:
            - 3f9a1c0e7b2d4e8f9a6b5c4d3e2f1a0b
        app_ids:
          items:
            type: string
          type: array
          title: App Ids
          description: IDs of the apps the session may now watch.
          examples:
            - - 6a2024af837c7a06c83021c1
      type: object
      required:
        - session_id
        - app_ids
      title: SocketSessionAppsResponse
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.