> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-hypeship-changelog-august-13.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream login flow events via SSE

> Establishes a Server-Sent Events (SSE) stream that delivers real-time
login flow state updates. The stream terminates automatically once
the flow reaches a terminal state (SUCCESS, FAILED, EXPIRED, CANCELED).




## OpenAPI

````yaml https://api.onkernel.com/spec.json get /auth/connections/{id}/events
openapi: 3.1.0
info:
  description: Developer tools and cloud infrastructure for AI agents to use web browsers
  title: Kernel API
  version: 0.1.0
servers:
  - description: API Server
    url: https://api.onkernel.com
security:
  - bearerAuth: []
tags:
  - description: Create and manage browser sessions.
    name: Browsers
  - description: Control mouse, keyboard, and screen on the browser instance.
    name: Browser Computer Controls
  - description: Execute Playwright code against the browser instance.
    name: Browser Playwright
  - description: Read, write, and manage files on the browser instance.
    name: Browser Filesystem
  - description: Execute and manage processes on the browser instance.
    name: Browser Processes
  - description: Record and manage browser session video replays.
    name: Browser Replays
  - description: Stream logs from the browser instance.
    name: Browser Logs
  - description: Stream live telemetry events from a browser session.
    name: Browser Telemetry
  - description: Create, list, retrieve, and delete browser profiles.
    name: Profiles
  - description: Create and manage proxy configurations for routing browser traffic.
    name: Proxies
  - description: Create, list, retrieve, and delete browser extensions.
    name: Extensions
  - description: Create and manage browser pools for acquiring and releasing browsers.
    name: Browser Pools
  - description: Inspect the identity and authorization context for the current request.
    name: Authentication
  - description: >-
      Create and manage auth connections for automated credential capture and
      login.
    name: Managed Auth
  - description: Create and manage credentials for authentication.
    name: Credentials
  - description: Configure external credential providers like 1Password.
    name: Credential Providers
  - description: List applications and versions.
    name: Apps
  - description: Create and manage app deployments and stream deployment events.
    name: Deployments
  - description: Invoke actions and stream or query invocation status and events.
    name: Invocations
  - description: Read and manage organization-level limits.
    name: Organization
  - description: |
      Create and manage projects for resource isolation within an organization.
      When projects are disabled for the organization, project operations return
      `404` with code `projects_disabled`.
    name: Projects
  - description: Create and manage API keys for organization and project-scoped access.
    name: API Keys
  - description: Read audit log records for the authenticated organization.
    name: Audit Logs
  - description: Resolve browser and proxy recommendations for bot-protected sites.
    name: Site Configs
paths:
  /auth/connections/{id}/events:
    get:
      tags:
        - Managed Auth
      summary: Stream login flow events via SSE
      description: |
        Establishes a Server-Sent Events (SSE) stream that delivers real-time
        login flow state updates. The stream terminates automatically once
        the flow reaches a terminal state (SUCCESS, FAILED, EXPIRED, CANCELED).
      operationId: getAuthConnectionsEventsById
      parameters:
        - description: The auth connection ID to follow.
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ManagedAuthEvent'
          description: SSE stream of auth connection state updates.
          headers:
            X-SSE-Content-Type:
              description: Media type of SSE data events (always application/json).
              schema:
                const: application/json
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    ManagedAuthEvent:
      description: Union type representing any managed auth event.
      discriminator:
        mapping:
          error:
            $ref: '#/components/schemas/ErrorEvent'
          managed_auth_state:
            $ref: '#/components/schemas/ManagedAuthStateEvent'
          sse_heartbeat:
            $ref: '#/components/schemas/SSEHeartbeatEvent'
        propertyName: event
      oneOf:
        - $ref: '#/components/schemas/ManagedAuthStateEvent'
        - $ref: '#/components/schemas/ErrorEvent'
        - $ref: '#/components/schemas/SSEHeartbeatEvent'
    ErrorEvent:
      description: An error event from the application.
      properties:
        error:
          $ref: '#/components/schemas/Error'
        event:
          const: error
          description: Event type identifier (always "error").
          type: string
        timestamp:
          description: Time the error occurred.
          format: date-time
          type: string
      required:
        - event
        - timestamp
        - error
      type: object
    ManagedAuthStateEvent:
      description: An event representing the current state of a managed auth flow.
      properties:
        choices:
          description: >-
            Canonical choices awaiting selection. Prefer this over
            pending_sso_buttons, mfa_options, and sign_in_options when present.
          items:
            $ref: '#/components/schemas/ManagedAuthChoice'
          type: array
        discovered_fields:
          description: >-
            Fields awaiting input (present when flow_step=AWAITING_INPUT; may
            also be present with AWAITING_EXTERNAL_ACTION as fallback actions).
          items:
            $ref: '#/components/schemas/DiscoveredField'
          type: array
        error_code:
          description: Machine-readable error code (present when flow_status=FAILED).
          type: string
        error_message:
          description: Error message (present when flow_status=FAILED).
          type: string
        event:
          const: managed_auth_state
          description: Event type identifier (always "managed_auth_state").
          type: string
        external_action_message:
          description: >-
            Instructions for external action (present when
            flow_step=AWAITING_EXTERNAL_ACTION).
          type: string
        fields:
          description: >-
            Canonical fields awaiting input. Prefer this over discovered_fields
            when present.
          items:
            $ref: '#/components/schemas/ManagedAuthField'
          type: array
        flow_status:
          description: Current flow status.
          enum:
            - IN_PROGRESS
            - SUCCESS
            - FAILED
            - EXPIRED
            - CANCELED
          type: string
        flow_step:
          description: Current step in the flow.
          enum:
            - DISCOVERING
            - AWAITING_INPUT
            - AWAITING_EXTERNAL_ACTION
            - SUBMITTING
            - COMPLETED
          type: string
        flow_type:
          description: Type of the current flow.
          enum:
            - LOGIN
            - REAUTH
          type: string
        hosted_url:
          description: URL to redirect user to for hosted login.
          format: uri
          type: string
        live_view_url:
          description: Browser live view URL for debugging.
          format: uri
          type: string
        mfa_options:
          description: >-
            MFA method options (present when flow_step=AWAITING_INPUT; may also
            be present with AWAITING_EXTERNAL_ACTION as fallback actions).
          items:
            $ref: '#/components/schemas/MFAOption'
          type: array
        pending_sso_buttons:
          description: >-
            SSO buttons available (present when flow_step=AWAITING_INPUT; may
            also be present with AWAITING_EXTERNAL_ACTION as fallback actions).
          items:
            $ref: '#/components/schemas/SSOButton'
          type: array
        post_login_url:
          description: URL where the browser landed after successful login.
          format: uri
          type: string
        sign_in_options:
          description: >-
            Non-MFA choices presented during the auth flow, such as account
            selection or org pickers (present when flow_step=AWAITING_INPUT; may
            also be present with AWAITING_EXTERNAL_ACTION as fallback actions).
          items:
            $ref: '#/components/schemas/SignInOption'
          type: array
        timestamp:
          description: Time the state was reported.
          format: date-time
          type: string
        website_error:
          description: >-
            Visible error message from the website (e.g., 'Incorrect password').
            Present when the website displays an error during login.
          type: string
      required:
        - event
        - timestamp
        - flow_status
        - flow_step
      type: object
    SSEHeartbeatEvent:
      description: Heartbeat event sent periodically to keep SSE connection alive.
      properties:
        event:
          const: sse_heartbeat
          description: Event type identifier (always "sse_heartbeat").
          type: string
        timestamp:
          description: Time the heartbeat was sent.
          format: date-time
          type: string
      required:
        - event
        - timestamp
      type: object
    Error:
      properties:
        code:
          description: Application-specific error code (machine-readable)
          example: bad_request
          type: string
        details:
          description: Additional error details (for multiple errors)
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
        inner_error:
          $ref: '#/components/schemas/ErrorDetail'
        message:
          description: Human-readable error description for debugging
          example: 'Missing required field: app_name'
          type: string
      required:
        - code
        - message
      type: object
    ManagedAuthChoice:
      additionalProperties: false
      description: Canonical auth-flow choice awaiting user selection.
      properties:
        context:
          description: Context captured for a choice.
          nullable: true
          type: string
        description:
          description: Additional context for the choice.
          nullable: true
          type: string
        display_text:
          description: Display text captured for a choice.
          nullable: true
          type: string
        id:
          description: Stable choice identifier for canonical submit.
          example: google
          type: string
        label:
          description: Human-readable choice label.
          example: Google
          type: string
        masked_destination:
          description: Masked phone number or email address shown for an MFA choice.
          nullable: true
          type: string
        mfa_type:
          $ref: '#/components/schemas/ManagedAuthMFAMethod'
          description: >-
            Semantic MFA method. Choice id remains the stable identity of the
            exact option selected.
          nullable: true
        observed_selector:
          description: Selector for the visible choice, when available.
          example: button:has-text("Google")
          nullable: true
          type: string
        type:
          description: Choice type.
          enum:
            - mfa_method
            - sso_provider
            - sign_in_method
            - auth_method
            - identifier_method
            - account
            - other
          example: sso_provider
          type: string
      required:
        - id
        - type
        - label
      type: object
    DiscoveredField:
      additionalProperties: false
      description: A discovered form field
      properties:
        hint:
          description: >-
            Contextual help text near the field that tells the user what to
            enter (e.g., "Enter the phone ending in (***) ***-**92")
          example: Enter the phone ending in (***) ***-**92
          type: string
        label:
          description: Field label
          example: Email address
          type: string
        linked_mfa_type:
          $ref: '#/components/schemas/MFAType'
          description: >-
            If this field is associated with an MFA option, the type of that
            option (e.g., password field linked to "Enter password" option)
          nullable: true
        name:
          description: Field name
          example: email
          type: string
        placeholder:
          description: Field placeholder
          example: you@example.com
          type: string
        required:
          default: true
          description: Whether field is required
          example: true
          type: boolean
        selector:
          description: CSS selector for the field
          example: input#email
          type: string
        type:
          description: Field type
          enum:
            - text
            - email
            - password
            - tel
            - number
            - url
            - code
            - totp
          example: email
          type: string
      required:
        - name
        - type
        - label
        - selector
      type: object
    ManagedAuthField:
      additionalProperties: false
      description: Canonical field awaiting user input.
      properties:
        hint:
          description: Context shown near the field, including a masked code destination.
          type: string
        id:
          description: Stable field identifier for canonical submit.
          example: field_email
          type: string
        label:
          description: Human-readable label shown to the user.
          example: Email address
          type: string
        observed_selector:
          description: Selector for the visible field, when available.
          example: input[name="identifier"]
          nullable: true
          type: string
        ref:
          description: Credential reference name to store the submitted value under.
          example: email
          type: string
        replace_existing:
          default: false
          description: >-
            Whether the submitted value must replace an existing credential
            after explicit rejection.
          type: boolean
        required:
          default: true
          description: Whether this field is required.
          type: boolean
        type:
          description: Managed-auth field type.
          enum:
            - identifier
            - password
            - code
            - totp_code
            - totp_secret
            - text
          example: identifier
          type: string
      required:
        - id
        - ref
        - type
      type: object
    MFAOption:
      additionalProperties: false
      description: An MFA method option for verification
      properties:
        description:
          description: Additional instructions from the site
          example: We'll send a 6-digit code to your phone
          nullable: true
          type: string
        label:
          description: The visible option text
          example: Text me a code
          type: string
        target:
          description: The masked destination (phone/email) if shown
          example: '***-***-5678'
          nullable: true
          type: string
        type:
          $ref: '#/components/schemas/MFAType'
      required:
        - type
        - label
      type: object
    SSOButton:
      additionalProperties: false
      description: An SSO button for signing in with an external identity provider
      properties:
        label:
          description: Visible button text
          example: Continue with Google
          type: string
        provider:
          description: Identity provider name
          example: google
          type: string
        selector:
          description: XPath selector for the button
          example: xpath=//button[contains(text(), 'Continue with Google')]
          type: string
      required:
        - selector
        - provider
        - label
      type: object
    SignInOption:
      additionalProperties: false
      description: >-
        A non-MFA choice presented during the auth flow (e.g. account selection,
        org picker)
      properties:
        description:
          description: Additional context such as email address or org name
          example: user@company.com
          nullable: true
          type: string
        id:
          description: Unique identifier for this option (used to submit selection back)
          example: work-account
          type: string
        label:
          description: Display text for the option
          example: Work Account (user@company.com)
          type: string
      required:
        - id
        - label
      type: object
    ErrorDetail:
      properties:
        code:
          description: Lower-level error code providing more specific detail
          example: invalid_input
          type: string
        message:
          description: Further detail about the error
          example: Provided version string is not semver compliant
          type: string
      type: object
    ManagedAuthMFAMethod:
      description: Canonical MFA method, independent of a site's stable choice identifier.
      enum:
        - sms
        - call
        - email
        - totp
        - push
        - password
        - passkey
        - switch
        - other
      example: sms
      type: string
    MFAType:
      description: >-
        The MFA delivery method type. Includes 'password' for auth method
        selection pages and 'switch' for generic method-switcher links like "Use
        another method" that do not name a specific method.
      enum:
        - sms
        - call
        - email
        - totp
        - push
        - password
        - switch
      example: sms
      type: string
  responses:
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Unauthorized – missing or invalid authorization token
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Resource not found
    InternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Internal Server Error
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````