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

# Create event stream

> Creates a new event streaming connection.



## OpenAPI

````yaml https://app.opal.dev/openapi.yaml post /event-streams
openapi: 3.1.0
info:
  contact:
    email: hello@opal.dev
    name: Opal Team
    url: https://www.opal.dev/
  description: >-
    The Opal API is a RESTful API that allows you to interact with the Opal
    Security platform programmatically.
  title: Opal API
  version: '1.0'
servers:
  - description: Production
    url: https://api.opal.dev/v1
security: []
tags:
  - name: access-rules
    description: Operations related to access rules
  - name: apps
    description: Operations related to apps
  - name: bundles
    description: Operations related to bundles
  - name: configuration-templates
    description: Operations related to configuration templates
  - name: delegations
    description: Operations related to request reviewer delegations
  - name: event-streams
    description: Operations related to event streaming connections
  - name: events
    description: Operations related to events
  - name: groups
    description: Operations related to groups
  - name: group-bindings
    description: Operations related to group bindings
  - name: idp-group-mappings
    description: Operations related to IDP group mappings
  - name: message-channels
    description: Operations related to message channels
  - name: non-human-identities
    description: Operations related to non-human identities
  - name: on-call-schedules
    description: Operations related to on-call schedules
  - name: opal-queries
    description: Operations related to OpalQuery
  - name: owners
    description: Operations related to owners
  - name: requests
    description: Operations related to requests
  - name: resources
    description: Operations related to resources
  - name: sessions
    description: Operations related to sessions
  - name: tags
    description: Operations related to tags
  - name: tokens
    description: Operations related to API tokens
  - name: uars
    description: Operations related to UARs
  - name: users
    description: Operations related to users
paths:
  /event-streams:
    post:
      tags:
        - event-streams
      summary: Create event stream
      description: Creates a new event streaming connection.
      operationId: createEventStream
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEventStreamInfo'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventStream'
          description: >-
            The event stream just created. Credentials are returned in clear
            text only on creation.
      security:
        - BearerAuth: []
components:
  schemas:
    CreateEventStreamInfo:
      description: Information needed to create an event stream.
      properties:
        name:
          description: The name for the event stream.
          type: string
        connection_type:
          $ref: '#/components/schemas/EventStreamConnectionTypeEnum'
        webhook_url:
          description: The webhook URL. Required when connection_type is WEBHOOK.
          type: string
        credentials:
          $ref: '#/components/schemas/WebhookCredentials'
      required:
        - name
        - connection_type
      type: object
    EventStream:
      description: >-
        An event streaming connection that publishes events to an external
        system.
      properties:
        event_stream_id:
          description: The ID of the event stream.
          format: uuid
          type: string
        connection:
          $ref: '#/components/schemas/EventStreamConnection'
      required:
        - event_stream_id
        - connection
      type: object
    EventStreamConnectionTypeEnum:
      description: The type of event stream connection.
      enum:
        - WEBHOOK
      type: string
    WebhookCredentials:
      description: Authentication credentials for a webhook connection.
      properties:
        auth_type:
          $ref: '#/components/schemas/WebhookAuthTypeEnum'
        api_key_credentials:
          description: API key credentials, present when auth_type is API_KEY.
          items:
            $ref: '#/components/schemas/WebhookApiKeyCredential'
          type: array
        hmac_credential_1:
          $ref: '#/components/schemas/WebhookHmacCredential'
          description: Primary HMAC credential, present when auth_type is HMAC.
          nullable: true
        hmac_credential_2:
          $ref: '#/components/schemas/WebhookHmacCredential'
          description: >-
            Secondary HMAC credential for rotation, present when auth_type is
            HMAC.
          nullable: true
      required:
        - auth_type
      type: object
    EventStreamConnection:
      description: The connection configuration for an event stream.
      properties:
        name:
          description: The name of the connection.
          type: string
        connection_type:
          $ref: '#/components/schemas/EventStreamConnectionTypeEnum'
        enabled:
          description: Whether the connection is enabled.
          type: boolean
        webhook_url:
          description: The webhook URL, present when connection_type is WEBHOOK.
          type: string
        credentials:
          $ref: '#/components/schemas/WebhookCredentials'
      required:
        - name
        - connection_type
        - enabled
      type: object
    WebhookAuthTypeEnum:
      description: The authentication type for webhook connections.
      enum:
        - NONE
        - API_KEY
        - HMAC
      type: string
    WebhookApiKeyCredential:
      description: An API key credential for webhook authentication.
      properties:
        id:
          description: The unique identifier for the credential.
          format: uuid
          type: string
        name:
          description: The name of the API key.
          type: string
        value:
          description: The value of the API key.
          type: string
        location:
          $ref: '#/components/schemas/WebhookApiKeyLocationEnum'
      required:
        - id
        - name
        - value
        - location
      type: object
    WebhookHmacCredential:
      description: An HMAC credential for webhook authentication.
      properties:
        id:
          description: The unique identifier for the credential.
          format: uuid
          type: string
        secret:
          description: The HMAC secret value.
          type: string
        created_at:
          description: When the credential was created.
          format: date-time
          type: string
      required:
        - id
        - secret
        - created_at
      type: object
    WebhookApiKeyLocationEnum:
      description: Where the API key is placed in webhook requests.
      enum:
        - HEADER
        - QUERY_PARAM
      type: string
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````