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

# Add webhook event

> Add an event to a webhook.



## OpenAPI

````yaml post /v2/session/apps/{appID}/webhooks/{webhookID}/events
openapi: 3.1.1
info:
  title: Prelude Session Management API
  version: 0.0.1
  summary: The Prelude API for Session Management
  description: The Prelude API for Session Management.
  contact:
    email: support@prelude.so
    url: https://prelude.so
servers:
  - url: https://api.prelude.dev
    description: Production server
security:
  - Authorization: []
tags:
  - name: Mode
    description: Manage the mode (dev/prod) of your application.
  - name: Users
    description: Manage the users of your application.
  - name: Webhooks
    description: Manage the webhooks of your application.
  - name: Domains
    description: Manage the domains of your application.
  - name: Config - Scopes
    description: Manage the scope configuration of your application.
  - name: Config - Claims
    description: Manage the claims mapping configuration of your application.
  - name: Config - Step-up
    description: Manage the step-up authentication configuration of your application.
  - name: Config - Migration
    description: Manage the user migration configuration of your application.
  - name: Config - Login OTP
    description: Manage the OTP login configuration of your application.
  - name: Config - Login OAuth
    description: Manage the OAuth login configuration of your application.
  - name: Config - Login Password
    description: Manage the password login configuration of your application.
paths:
  /v2/session/apps/{appID}/webhooks/{webhookID}/events:
    parameters:
      - $ref: '#/components/parameters/appIDParam'
      - $ref: '#/components/parameters/webhookIDParam'
    post:
      tags:
        - Webhooks
      summary: Add webhook event
      description: Add an event to a webhook.
      operationId: addWebhookEvent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostWebhookEventRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostWebhookEventResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidWebhookEventError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionDisabledError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AppNotFoundError'
                  - $ref: '#/components/schemas/WebhookNotFoundError'
components:
  parameters:
    appIDParam:
      in: path
      name: appID
      required: true
      description: The id of the app the request refers to.
      schema:
        $ref: '#/components/schemas/AppID'
    webhookIDParam:
      in: path
      name: webhookID
      required: true
      description: The id of the webhook the request refers to.
      schema:
        $ref: '#/components/schemas/WebhookID'
  schemas:
    PostWebhookEventRequest:
      type: object
      properties:
        event:
          $ref: '#/components/schemas/WebhookEventTypesEnum'
      required:
        - event
    PostWebhookEventResponse:
      type: object
      properties:
        webhook:
          $ref: '#/components/schemas/WebhookResponse'
      required:
        - webhook
    InvalidWebhookEventError:
      type: object
      properties:
        code:
          type: string
          enum:
            - invalid_webhook_event
          examples:
            - invalid_webhook_event
        status:
          type: string
          enum:
            - bad_request
          examples:
            - bad_request
        message:
          type: string
          examples:
            - The webhook event type is invalid.
      required:
        - code
        - status
        - message
    SessionDisabledError:
      type: object
      properties:
        code:
          type: string
          enum:
            - session_disabled
          examples:
            - session_disabled
        status:
          type: string
          enum:
            - forbidden
          examples:
            - forbidden
        message:
          type: string
          examples:
            - Session management is disabled for this application.
      required:
        - code
        - status
        - message
    AppNotFoundError:
      type: object
      properties:
        code:
          type: string
          enum:
            - app_not_found
          examples:
            - app_not_found
        status:
          type: string
          enum:
            - not_found
          examples:
            - not_found
        message:
          type: string
          examples:
            - The application was not found.
      required:
        - code
        - status
        - message
    WebhookNotFoundError:
      type: object
      properties:
        code:
          type: string
          enum:
            - webhook_not_found
          examples:
            - webhook_not_found
        status:
          type: string
          enum:
            - not_found
          examples:
            - not_found
        message:
          type: string
          examples:
            - The webhook was not found.
      required:
        - code
        - status
        - message
    AppID:
      type: string
      description: An application's unique identifier.
      examples:
        - 54e9ujn
        - fvua38g
    WebhookID:
      type: string
      description: An application's webhook unique identifier. It is prefixed with 'web_'
      examples:
        - web_01jqebhswje1ka1z7ahr9rfsgt
    WebhookEventTypesEnum:
      type: string
      enum:
        - user.created
        - user.deleted
        - user.profile.updated
        - user.identifier.created
        - user.identifier.deleted
        - user.session.created
        - user.session.revoked
    WebhookResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/WebhookID'
        url:
          type: string
          format: uri
          examples:
            - https://example.com/webhook
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEventTypesEnum'
        active:
          type: boolean
          examples:
            - true
        last_http_code:
          type: integer
          examples:
            - 200
            - 500
            - 502
            - 403
            - 401
            - 400
        last_http_code_date:
          type: string
          format: date-time
          examples:
            - '2025-03-15T14:45:00Z'
        created_at:
          type: string
          format: date-time
          examples:
            - '2025-03-15T10:30:00Z'
        updated_at:
          type: string
          format: date-time
          examples:
            - '2025-03-15T12:00:00Z'
      required:
        - id
        - url
        - events
        - active
        - last_http_code
        - last_http_code_date
        - created_at
        - updated_at
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````