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

# WebSocket event stream

> Upgrade to a WebSocket connection for real-time domain events.

This endpoint upgrades the HTTP connection to a WebSocket.
Once connected, the server streams EventMessage and ErrorMessage
frames as JSON.

This operation is documented for schema generation purposes;
the actual WebSocket upgrade is handled outside the OpenAPI router.



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml get /ws/events
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: Gitlab
  - name: Git
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Describe
paths:
  /ws/events:
    get:
      tags:
        - WebSocket
      summary: WebSocket event stream
      description: |-
        Upgrade to a WebSocket connection for real-time domain events.

        This endpoint upgrades the HTTP connection to a WebSocket.
        Once connected, the server streams EventMessage and ErrorMessage
        frames as JSON.

        This operation is documented for schema generation purposes;
        the actual WebSocket upgrade is handled outside the OpenAPI router.
      operationId: WebSocketEvents
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    anyOf:
                      - $ref: '#/components/schemas/WebSocket.EventMessage'
                      - $ref: '#/components/schemas/WebSocket.ErrorMessage'
                required:
                  - data
                type: object
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The request is invalid or malformed.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You are not authenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You do not have permission to access this resource.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Client error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
components:
  schemas:
    WebSocket.EventMessage:
      additionalProperties: false
      description: WebSocket message envelope for domain events.
      properties:
        data:
          allOf:
            - $ref: '#/components/schemas/WebSocket.Event'
          description: The domain event payload.
        type:
          description: Discriminator — always "event" for event messages.
          enum:
            - event
          type: string
      required:
        - type
        - data
      type: object
    WebSocket.ErrorMessage:
      additionalProperties: false
      description: WebSocket message envelope for errors.
      properties:
        data:
          allOf:
            - $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The structured error data.
        type:
          description: Discriminator — always "error" for error messages.
          enum:
            - error
          type: string
      required:
        - type
        - data
      type: object
    Errors.UserFacingErrorData:
      additionalProperties: false
      description: |-
        User-facing error presentation data.
        This is what the API returns to the frontend after formatting ErrorData
        using CEL templates from the error registry.

        Used for both:
        - Error fields on domain models (e.g., PipelineRun.error)
        - API error response bodies (HTTP 4xx/5xx responses)
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Errors.Action'
          description: Optional action to help resolve the error
        code:
          description: Full error code, e.g., "Ravion:Pipeline:NOT_FOUND"
          type: string
        description:
          description: Additional description with more details
          type: string
        details:
          description: Structured details rendered as user-facing sections.
          items:
            $ref: '#/components/schemas/Errors.UserFacingErrorDetailSection'
          type: array
        isInternal:
          description: >-
            Indicates whether this error is internal (only set when
            ShowInternal=true).

            This allows SUPERADMINs to identify internal errors while viewing
            full details.
          type: boolean
        message:
          description: Main error message (required)
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Error params/metadata. Stripped for internal errors unless
            superadmin.
          type: object
        requestId:
          description: Request ID for correlating errors with server logs.
          type: string
      required:
        - code
        - message
      type: object
    WebSocket.Event:
      additionalProperties: false
      description: A domain event delivered over the WebSocket connection.
      properties:
        actorId:
          description: The user who triggered the event, if applicable.
          type: string
        entityId:
          description: The ID of the affected entity.
          type: string
        entityType:
          description: >-
            The entity type this event pertains to, e.g. "Project",
            "PipelineRun".
          type: string
        id:
          description: Unique event ID.
          type: string
        organizationId:
          description: The organization this event belongs to.
          type: string
        payload:
          description: The entity data after the event.
        timestamp:
          description: ISO 8601 timestamp of when the event occurred.
          type: string
        type:
          description: >-
            Dot-separated event type string, e.g. "Project.created".

            Format: "{EntityType}.{action}" where action is one of: created,
            updated, deleted.
          type: string
      required:
        - id
        - type
        - entityType
        - entityId
        - organizationId
        - timestamp
        - payload
      type: object
    Errors.Action:
      additionalProperties: false
      description: Action to help user resolve the error
      properties:
        label:
          description: Button/link label text
          type: string
        url:
          description: URL to navigate to for resolution
          type: string
      required:
        - label
        - url
      type: object
    Errors.UserFacingErrorDetailSection:
      additionalProperties: false
      description: Structured user-facing error detail section.
      properties:
        items:
          description: List of detail values for this section.
          items:
            type: string
          type: array
        object:
          additionalProperties: {}
          description: Structured detail payload for object rendering.
          type: object
        render:
          description: Rendering hint for clients. Valid values are list or object.
          type: string
        title:
          description: Detail section title shown in the UI.
          type: string
      required:
        - title
        - render
      type: object
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````