> ## 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 invocation events via SSE

> Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
status updates for an invocation. The stream terminates automatically
once the invocation reaches a terminal state.




## OpenAPI

````yaml https://api.onkernel.com/spec.json get /invocations/{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:
  /invocations/{id}/events:
    get:
      tags:
        - Invocations
      summary: Stream invocation events via SSE
      description: >
        Establishes a Server-Sent Events (SSE) stream that delivers real-time
        logs and

        status updates for an invocation. The stream terminates automatically

        once the invocation reaches a terminal state.
      operationId: getInvocationsEventsById
      parameters:
        - description: The invocation ID to follow.
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: >-
            Show logs since the given time (RFC timestamps or durations like
            5m).
          in: query
          name: since
          required: false
          schema:
            example: '2025-06-20T12:00:00Z'
            type: string
      responses:
        '200':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/InvocationEvent'
          description: SSE stream of invocation state updates and logs.
          headers:
            X-SSE-Content-Type:
              description: Media type of SSE data events (always application/json).
              schema:
                const: application/json
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    InvocationEvent:
      description: Union type representing any invocation event.
      discriminator:
        mapping:
          error:
            $ref: '#/components/schemas/ErrorEvent'
          invocation_state:
            $ref: '#/components/schemas/InvocationStateEvent'
          log:
            $ref: '#/components/schemas/LogEvent'
          sse_heartbeat:
            $ref: '#/components/schemas/SSEHeartbeatEvent'
        propertyName: event
      oneOf:
        - $ref: '#/components/schemas/LogEvent'
        - $ref: '#/components/schemas/InvocationStateEvent'
        - $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
    InvocationStateEvent:
      description: An event representing the current state of an invocation.
      properties:
        event:
          const: invocation_state
          description: Event type identifier (always "invocation_state").
          type: string
        invocation:
          $ref: '#/components/schemas/Invocation'
        timestamp:
          description: Time the state was reported.
          format: date-time
          type: string
      required:
        - event
        - invocation
        - timestamp
      type: object
    LogEvent:
      description: A log entry from the application.
      properties:
        event:
          const: log
          description: Event type identifier (always "log").
          type: string
        message:
          description: Log message text.
          type: string
        timestamp:
          description: Time the log entry was produced.
          format: date-time
          type: string
      required:
        - event
        - message
        - timestamp
      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
    Invocation:
      properties:
        action_name:
          description: Name of the action invoked
          example: analyze
          type: string
        app_name:
          description: Name of the application
          example: my-app
          type: string
        finished_at:
          description: >-
            RFC 3339 Nanoseconds timestamp when the invocation finished (null if
            still running)
          example: 2024-05-19T15:30:05.000000000Z07:00
          format: date-time
          nullable: true
          type: string
        id:
          description: ID of the invocation
          example: rr33xuugxj9h0bkf1rdt2bet
          type: string
        output:
          description: >-
            Output produced by the action, rendered as a JSON string. This could
            be: string, number, boolean, array, object, or null.
          example: '{"result":"success","data":"processed input"}'
          type: string
        payload:
          description: >-
            Payload provided to the invocation. This is a string that can be
            parsed as JSON.
          example: '{"data":"example input"}'
          type: string
        started_at:
          description: RFC 3339 Nanoseconds timestamp when the invocation started
          example: 2024-05-19T15:30:00.000000000Z07:00
          format: date-time
          type: string
        status:
          description: Status of the invocation
          enum:
            - queued
            - running
            - succeeded
            - failed
          example: succeeded
          type: string
        status_reason:
          description: Status reason
          example: Invocation completed successfully
          type: string
        version:
          description: Version label for the application
          example: 1.0.0
          type: string
      required:
        - id
        - app_name
        - version
        - action_name
        - started_at
        - status
      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
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Bad Request – invalid input
    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

````