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

# Create Webhook Subscription

> Creates a webhook subscription for the authenticated user.



## OpenAPI

````yaml POST /api/webhooks/subscriptions
openapi: 3.1.0
info:
  title: Lettuce Stream API
  description: OpenAPI subset used by the API reference endpoint examples.
  version: 1.0.0
servers:
  - url: https://www.lettucestream.com
security: []
paths:
  /api/webhooks/subscriptions:
    post:
      summary: Create webhook subscription
      description: Creates a webhook subscription for the authenticated user.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookSubscriptionRequest'
      responses:
        '200':
          description: Webhook subscription and optional secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateWebhookSubscriptionRequest:
      type: object
      required:
        - url
        - events
      properties:
        url:
          type: string
        events:
          type: array
          items:
            type: string
        description:
          type: string
        secret:
          type: string
    WebhookSubscriptionResponse:
      type: object
      required:
        - subscription
      properties:
        subscription:
          $ref: '#/components/schemas/WebhookSubscription'
        secret:
          type: string
    WebhookSubscription:
      type: object
      required:
        - id
        - url
        - events
        - description
        - enabled
      properties:
        id:
          type: string
        url:
          type: string
        events:
          type: array
          items:
            type: string
        description:
          type: string
        enabled:
          type: boolean
        createdAt:
          type: string
        updatedAt:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````