> ## 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 Capture Session

> Create a new capture session for real-time media ingestion

Create a new capture session within a collection. Capture sessions enable real-time media ingestion from client applications.

<Note>
  * `end_user_id` is required to identify the end user
  * Use `ws_connection_id` to link to an existing WebSocket connection for real-time updates
  * Use `metadata` to attach custom key-value data to the session
</Note>

<CardGroup cols={2}>
  <Card title="Start Session" icon="play" href="/api-reference/capture/start_session">
    Start the capture session
  </Card>

  <Card title="Capture SDK Guide" icon="book" href="/pages/ingest/capture-sdks/overview">
    Learn about capture SDKs
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /collection/{collection_id}/capture/session
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:
  /collection/{collection_id}/capture/session:
    post:
      tags:
        - Capture
      summary: Create capture session
      parameters:
        - name: collection_id
          in: path
          required: true
          schema:
            type: string
            example: default
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - end_user_id
              properties:
                end_user_id:
                  type: string
                  example: user-123
                callback_url:
                  type: string
                  example: https://webhook.example.com/callback
                ws_connection_id:
                  type: string
                  example: conn-123
                metadata:
                  type: object
      responses:
        '200':
          description: Capture session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/CaptureSession'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CaptureSession:
      type: object
      properties:
        session_id:
          type: string
          example: capture-12345
        end_user_id:
          type: string
          example: user-123
        status:
          type: string
          enum:
            - created
            - starting
            - active
            - stopped
            - failed
          example: created
        collection_id:
          type: string
          example: default
        ws_connection_id:
          type: string
          example: conn-123
        metadata:
          type: object
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Error message
        error_code:
          type: string
          example: ERROR_CODE
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: API key for authentication (sk-xxx format)

````