> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# BulkDeleteEventsByFilter

# Package: eventManagement

# Namespace: EventManagement

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/events-v3/bulk-delete-events-by-filter.md

## Permission Scopes:
Manage Events: SCOPE.DC-EVENTS.MANAGE-EVENTS

## Introduction

Deletes multiple events that meet the specified criteria. <br> <br>
You can retrieve the deleted events through a GDPR access request.

---

## REST API

### Schema

```
 Method: bulkDeleteEventsByFilter
 Description: Deletes multiple events that meet the specified criteria. <br> <br> You can retrieve the deleted events through a GDPR access request.
 URL: https://www.wixapis.com/events/v3/bulk/events/delete-by-filter
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  filter.filter
 Method parameters: 
   param name: filter | type: QueryV2    
     - name: paging | type: Paging | description: Paging options. Only offset paging is supported; `cursorPaging` isn't available.  
        - name: limit | type: integer | description: Number of items to return. See [Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging#getting-started_sorting-and-paging_paging) for more information.  | validation: minimum 0, maximum 1000, format int32
        - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` | required: true 
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 20
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 100
           - name: order | type: SortOrder | description: Sort order. Use `ASC` for ascending order or `DESC` for descending order.  Default: `ASC`.  
                 - enum: ASC, DESC
 Return type: BulkDeleteEventsByFilterResponse
  EMPTY-OBJECT {}


```

### Examples

### Bulk delete events by status
```curl
curl -X POST 'https://www.wixapis.com/events/v3/bulk/events/delete-by-filter' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH TOKEN>' \
-d '{
  "filter": {
    "filter": {
      "status": "CANCELED"
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.wixEventsV2.bulkDeleteEventsByFilter(options)
 Description: Deletes multiple events that meet the specified criteria. <br> <br> You can retrieve the deleted events through a GDPR access request.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  options.filter.filter
 Method parameters: 
   param name: options | type: BulkDeleteEventsByFilterOptions  none  
        - name: filter | type: QueryV2 | description: Query options. See [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md) for more details.  
           - ONE-OF: 
              - name: paging | type: Paging | description: Paging options. Only offset paging is supported; `cursorPaging` isn't available.  
                 - name: limit | type: integer | description: Number of items to return. See [Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging#getting-started_sorting-and-paging_paging) for more information.  | validation: minimum 0, maximum 1000, format int32
                 - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
           - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` | required: true 
           - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 20
              - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 100
              - name: order | type: SortOrder | description: Sort order. Use `ASC` for ascending order or `DESC` for descending order.  Default: `ASC`.  
                     - enum: ASC, DESC
 Return type: PROMISE<BulkDeleteEventsByFilterResponse>
  EMPTY-OBJECT {}


```

### Examples

### bulkDeleteEventsByFilter
```javascript
import { wixEventsV2 } from '@wix/events';

async function bulkDeleteEventsByFilter(options) {
  const response = await wixEventsV2.bulkDeleteEventsByFilter(options);
};
```

### bulkDeleteEventsByFilter (with elevated permissions)
```javascript
import { wixEventsV2 } from '@wix/events';
import { auth } from '@wix/essentials';

async function myBulkDeleteEventsByFilterMethod(options) {
  const elevatedBulkDeleteEventsByFilter = auth.elevate(wixEventsV2.bulkDeleteEventsByFilter);
  const response = await elevatedBulkDeleteEventsByFilter(options);
}
```

### bulkDeleteEventsByFilter (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { wixEventsV2 } from '@wix/events';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { wixEventsV2 },
  // Include the auth strategy and host as relevant
});


async function bulkDeleteEventsByFilter(options) {
  const response = await myWixClient.wixEventsV2.bulkDeleteEventsByFilter(options);
};
```

---