## List webhook events `webhook_events.list(**kwargs) -> PageNumberPage` **get** `/v1/webhook-events` Retrieves a paginated list of webhook events for the authenticated organization. Supports filtering by event name, resource type, resource ID, and date range. ### Parameters - `created_after: Time` - `created_before: Time` - `event_name: :"enrollment.accepted" | :"enrollment.terminated" | :"enrollment.elected" | 8 more` * `enrollment.accepted` - Enrollment Accepted * `enrollment.terminated` - Enrollment Terminated * `enrollment.elected` - Enrollment Elected * `enrollment.granted` - Enrollment Granted * `enrollment.waived` - Enrollment Waived * `enrollment.started` - Enrollment Started * `employee.eligibility_granted` - Employee Eligibility Granted * `employee.eligibility_terminated` - Employee Eligibility Terminated * `employee.deactivated` - Employee Deactivated * `payroll_deduction.created` - Payroll Deduction Created * `employer.eligibility_policy_created` - Employer Eligibility Policy Created - `:"enrollment.accepted"` - `:"enrollment.terminated"` - `:"enrollment.elected"` - `:"enrollment.granted"` - `:"enrollment.waived"` - `:"enrollment.started"` - `:"employee.eligibility_granted"` - `:"employee.eligibility_terminated"` - `:"employee.deactivated"` - `:"payroll_deduction.created"` - `:"employer.eligibility_policy_created"` - `limit: Integer` Items per page (default: 20, max: 100) - `page: Integer` Page number (default: 1) - `resource_id: String` - `resource_type: :enrollment | :employee | :employer | 3 more` * `enrollment` - Enrollment * `employee` - Employee * `employer` - Employer * `dependent` - Dependent * `plan_year` - Plan Year * `payroll_deduction` - Payroll Deduction - `:enrollment` - `:employee` - `:employer` - `:dependent` - `:plan_year` - `:payroll_deduction` ### Returns - `class WebhookEvent` - `id: String` Prefixed unique identifier for this webhook event (e.g., `wevt_...`). - `created_at: Time` When the event occurred, in UTC. - `event_name: String` The event type, formatted as `{resource}.{action}` (e.g., `enrollment.accepted`). - `organization_id: String` The organization this event belongs to. - `resource_id: String` Prefixed ID of the affected resource. Use this to fetch the current state from the API. - `resource_type: String` The type of resource affected (e.g., `enrollment`, `employee`). ### Example ```ruby require "vitable_connect" vitable_connect = VitableConnect::Client.new( api_key: "My API Key", environment: "environment_1" # defaults to "production" ) page = vitable_connect.webhook_events.list puts(page) ``` #### Response ```json { "data": [ { "id": "wevt_abc123def456", "organization_id": "org_xyz789", "event_name": "enrollment.accepted", "resource_type": "enrollment", "resource_id": "enrl_sample123", "created_at": "2024-06-15T14:30:00Z" }, { "id": "wevt_def456ghi789", "organization_id": "org_xyz789", "event_name": "employee.deactivated", "resource_type": "employee", "resource_id": "empl_sample456", "created_at": "2024-06-15T12:00:00Z" } ], "pagination": { "page": 1, "limit": 20, "total": 2, "total_pages": 1 } } ```