> 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 # BulkDeleteServicesByFilter # Package: services # Namespace: ServicesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/bulk-delete-services-by-filter.md ## Permission Scopes: Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS ## Introduction Deletes multiple services by filter. See [Delete Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/delete-service.md) for more details about deleting a service. The call succeeds even if one or more individual services can't be deleted. Information about failures is returned in `bulkActionMetadata`. Refer to the [supported filters article](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md#services-filtering-and-sorting) for more details. To learn about working with filters in general, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). --- ## REST API ### Schema ``` Method: bulkDeleteServicesByFilter Description: Deletes multiple services by filter. See [Delete Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/delete-service.md) for more details about deleting a service. The call succeeds even if one or more individual services can't be deleted. Information about failures is returned in `bulkActionMetadata`. Refer to the [supported filters article](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md#services-filtering-and-sorting) for more details. To learn about working with filters in general, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). URL: https://www.wixapis.com/bookings/v2/bulk/services/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 Method parameters: param name: filter | type: filter | description: Filter to identify the services that need to be deleted. | required: true param name: participantNotification | type: ParticipantNotification - name: notifyParticipants | type: boolean | description: Whether to send a message about the changes to the customer. Default: `false` - name: message | type: string | description: Custom message to send to the participants about the changes to the booking. param name: preserveFutureSessionsWithParticipants | type: preserveFutureSessionsWithParticipants | description: Whether to preserve future sessions with participants. Default: `false`. Return type: BulkDeleteServicesByFilterResponse - name: jobId | type: string | description: GUID of the service deletion job. Pass this GUID to [Get Async Job](https://dev.wix.com/docs/rest/business-management/async-job/introduction.md) to retrieve job details and metadata. ``` ### Examples ### Delete all classes ```curl curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/delete-by-filter' \ -H 'Authorization: ' \ -d '{ "filter": { "type": "CLASS" }, "preserveFutureSessionsWithParticipants": false, "participantNotification": { "notifyParticipants": true } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.services.ServicesService.bulkDeleteServicesByFilter(filter, options) Description: Deletes multiple services by filter. See [Delete Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/delete-service.md) for more details about deleting a service. The call succeeds even if one or more individual services can't be deleted. Information about failures is returned in `bulkActionMetadata`. Refer to the [supported filters article](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md#services-filtering-and-sorting) for more details. To learn about working with filters in general, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: filter Method parameters: param name: filter | type: object | description: Filter to identify the services that need to be deleted. | required: true param name: options | type: BulkDeleteServicesByFilterOptions none - name: preserveFutureSessionsWithParticipants | type: boolean | description: Whether to preserve future sessions with participants. Default: `false`. - name: participantNotification | type: ParticipantNotification | description: Whether to notify participants about the change and an optional custom message. - name: notifyParticipants | type: boolean | description: Whether to send a message about the changes to the customer. Default: `false` - name: message | type: string | description: Custom message to send to the participants about the changes to the booking. Return type: PROMISE - name: jobId | type: string | description: GUID of the service deletion job. Pass this GUID to [Get Async Job](https://dev.wix.com/docs/rest/business-management/async-job/introduction.md) to retrieve job details and metadata. ``` ### Examples ### bulkDeleteServicesByFilter ```javascript import { services } from '@wix/bookings'; async function bulkDeleteServicesByFilter(filter,options) { const response = await services.bulkDeleteServicesByFilter(filter,options); }; ``` ### bulkDeleteServicesByFilter (with elevated permissions) ```javascript import { services } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myBulkDeleteServicesByFilterMethod(filter,options) { const elevatedBulkDeleteServicesByFilter = auth.elevate(services.bulkDeleteServicesByFilter); const response = await elevatedBulkDeleteServicesByFilter(filter,options); } ``` ### bulkDeleteServicesByFilter (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 { services } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { services }, // Include the auth strategy and host as relevant }); async function bulkDeleteServicesByFilter(filter,options) { const response = await myWixClient.services.bulkDeleteServicesByFilter(filter,options); }; ``` ---