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

# Create Event

> Create a detection event for real-time stream monitoring

Create a detection event that defines what to look for in real-time streams. Events are reusable templates that can be attached to stream indexes as alerts.

<Note>
  * `event_prompt` describes the condition to detect in natural language
  * `label` is a short identifier for the event type
  * Events are reusable across multiple stream indexes and alerts
</Note>

<CardGroup cols={2}>
  <Card title="Create Alert" icon="bell" href="/api-reference/rtstream/events-alerts/create_alert">
    Attach event to a stream index
  </Card>

  <Card title="Event Detection Guide" icon="eye" href="/pages/act/live-action/event-detection-patterns">
    Learn about event detection
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /rtstream/event
openapi: 3.0.3
info:
  title: VideoDB Server API
  description: >
    VideoDB Server API for video, audio, and image processing with AI
    capabilities.

    This API provides comprehensive video management, search, indexing, and
    AI-powered features.
  version: 1.0.0
  contact:
    name: VideoDB Support
    url: https://videodb.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.videodb.io
    description: Production server
  - url: https://staging-api.videodb.io
    description: Staging server
security:
  - ApiKeyAuth: []
tags:
  - name: Authentication
    description: User authentication and API key management
  - name: Collections
    description: Collection management operations
  - name: Videos
    description: Video upload, processing, and management
  - name: Audio
    description: Audio management operations
  - name: Images
    description: Image management operations
  - name: Search
    description: Content search and indexing
  - name: AI Generation
    description: AI-powered content generation
  - name: Billing
    description: Billing and usage management
  - name: RTStream
    description: Real-time streaming operations
  - name: Utilities
    description: Utility endpoints
  - name: Meeting
    description: Meeting recording and management
  - name: Capture
    description: Capture session management for recording streams
  - name: Editor
    description: Timeline editor operations
  - name: Transcode
    description: Media transcoding operations
  - name: Assets
    description: Cross-collection asset listing
paths:
  /rtstream/event:
    post:
      tags:
        - RTStream
      summary: Create collection event
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - event_prompt
                - label
              properties:
                event_prompt:
                  type: string
                  example: Detect when a person enters the room
                label:
                  type: string
                  example: person-entry
      responses:
        '200':
          description: Event created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      event_id:
                        type: string
                        example: event-12345
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: API key for authentication (sk-xxx format)

````