> 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`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt
# BulkCancelEventsByFilter
# Package: eventManagement
# Namespace: EventManagement
# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/events-v3/bulk-cancel-events-by-filter.md
## Permission Scopes:
Manage Events: SCOPE.DC-EVENTS.MANAGE-EVENTS
## Introduction
Cancels multiple events that meet the specified criteria.
After cancellation, registration for an event is closed. To reuse the event, call Clone Event and Publish Event to publish it again.
If event cancellation notifications are enabled, canceling an event automatically triggers the sending of cancellation emails and/or push notifications to registered guests.
---
## REST API
### Schema
```
Method: bulkCancelEventsByFilter
Description: Cancels multiple events that meet the specified criteria.
After cancellation, registration for an event is closed. To reuse the event, call Clone Event and Publish Event to publish it again.
If event cancellation notifications are enabled, canceling an event automatically triggers the sending of cancellation emails and/or push notifications to registered guests.
URL: https://www.wixapis.com/events/v3/bulk/events/cancel-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. Can't be used together with `cursorPaging`.
- 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.
- name: offset | type: integer | description: Number of items to skip in the current sort order.
- name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` | required: true
- name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
- name: fieldName | type: string | description: Name of the field to sort by.
- name: order | type: SortOrder | description: Sort order. Use `ASC` for ascending order or `DESC` for descending order. Default: `ASC`.
- enum: ASC, DESC
Return type: BulkCancelEventsByFilterResponse
EMPTY-OBJECT {}
```
### Examples
### Bulk cancel events by category ID
```curl
curl -X POST 'https://www.wixapis.com/events/v3/bulk/events/cancel-by-filter' \
-H 'Content-Type: application/json' \
-H 'Authorization: ' \
-d '{
"filter": {
"categoryId": "eebe3ed6-ffef-46e4-a83a-e883d7ad8fdd"
}
}'
```
---
## JavaScript SDK
### Schema
```
Method: wixClientAdmin.eventManagement.EventManagement.bulkCancelEventsByFilter(options)
Description: Cancels multiple events that meet the specified criteria.
After cancellation, registration for an event is closed. To reuse the event, call Clone Event and Publish Event to publish it again.
If event cancellation notifications are enabled, canceling an event automatically triggers the sending of cancellation emails and/or push notifications to registered guests.
# 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: BulkCancelEventsByFilterOptions none
- name: filter | type: QueryV2 | description: Filter. See [Query Events](https://dev.wix.com/docs/rest/business-solutions/events/events-v3/query-events.md) for a list of supported filters.
- ONE-OF:
- name: paging | type: Paging | description: Paging options. Can't be used together with `cursorPaging`.
- 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.
- name: offset | type: integer | description: Number of items to skip in the current sort order.
- name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` | required: true
- name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
- name: fieldName | type: string | description: Name of the field to sort by.
- 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
EMPTY-OBJECT {}
```
### Examples
### bulkCancelEventsByFilter
```javascript
import { wixEventsV2 } from '@wix/events';
async function bulkCancelEventsByFilter(options) {
const response = await wixEventsV2.bulkCancelEventsByFilter(options);
};
```
### bulkCancelEventsByFilter (with elevated permissions)
```javascript
import { wixEventsV2 } from '@wix/events';
import { auth } from '@wix/essentials';
async function myBulkCancelEventsByFilterMethod(options) {
const elevatedBulkCancelEventsByFilter = auth.elevate(wixEventsV2.bulkCancelEventsByFilter);
const response = await elevatedBulkCancelEventsByFilter(options);
}
```
### bulkCancelEventsByFilter (self-hosted)
Self-hosted 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 bulkCancelEventsByFilter(options) {
const response = await myWixClient.wixEventsV2.bulkCancelEventsByFilter(options);
};
```
---