> 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

# BulkCancelEvent

# Package: triggers

# Namespace: EsbConfigResolver

# Method link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/bulk-cancel-event.md

## Permission Scopes:
Manage Your App: SCOPE.DC.MANAGE-YOUR-APP

## Introduction

Cancels any remaining actions for multiple events at once, given a trigger key and the events' external entity IDs.


Each external entity ID is processed independently, so some cancellations can succeed while others fail. Check `bulkActionMetadata` for the success and failure totals.

To cancel a single event, call [Cancel Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/cancel-event.md).

---

## REST API

### Schema

```
 Method: bulkCancelEvent
 Description: Cancels any remaining actions for multiple events at once, given a trigger key and the events' external entity GUIDs.   Each external entity GUID is processed independently, so some cancellations can succeed while others fail. Check `bulkActionMetadata` for the success and failure totals.  To cancel a single event, call [Cancel Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/cancel-event.md).
 URL: https://www.wixapis.com/automations/v1/events/bulk-cancel
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  triggerKey, externalEntityIds
 Method parameters: 
   param name: externalEntityIds | type: array<externalEntityIds> | description: Repeated list of external_entity_id, representing the related resources' GUIDs. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: triggerKey | type: triggerKey | description: Trigger key whose events you want to cancel. For example, `form_submitted` or `invoice_due`. | required: true | validation: minLength 1, maxLength 100
 Return type: BulkCancelEventResponse
  - name: triggerKey | type: string | description: Trigger key related to the canceled event.  | validation: minLength 1, maxLength 100
  - name: results | type: array<BulkCancelEventResult> | description: List of results for each item in the bulk cancel event request.  
     - name: itemMetadata | type: ItemMetadata | description: Metadata of the item, including its GUID and success or failure status.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: externalEntityId | type: string | description: GUID of the related resource in GUGUID format.  | validation: format GUID
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata for the overall bulk action, including success and failure counts.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  


```

### Examples

### BulkCancelEvent
```curl
~~~cURL
curl -X POST https://www.wixapis.com/automations/v1/events/bulk-cancel  \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "triggerKey": "appointment_scheduled",
    "externalEntityIds": [
      "16ef8c9c-413e-4d5f-b77d-8c67c3c8ae0c",
      "2c0a8f4b-9d6e-4a1f-bc23-7e5d1a2b3c4d"
    ]
  }'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.automations.activations.bulkCancelEvent(triggerKey, externalEntityIds)
 Description: Cancels any remaining actions for multiple events at once, given a trigger key and the events' external entity GUIDs.   Each external entity GUID is processed independently, so some cancellations can succeed while others fail. Check `bulkActionMetadata` for the success and failure totals.  To cancel a single event, call [Cancel Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/cancel-event.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  triggerKey, externalEntityIds
 Method parameters: 
   param name: triggerKey | type: string | description: Trigger key whose events you want to cancel. For example, `form_submitted` or `invoice_due`. | required: true | validation: minLength 1, maxLength 100
   param name: externalEntityIds | type: array<string> | description: Repeated list of external_entity_id, representing the related resources' GUIDs. | required: true | validation: minItems 1, maxItems 100, format GUID
 Return type: PROMISE<BulkCancelEventResponse>
  - name: triggerKey | type: string | description: Trigger key related to the canceled event.  | validation: minLength 1, maxLength 100
  - name: results | type: array<BulkCancelEventResult> | description: List of results for each item in the bulk cancel event request.  
     - name: itemMetadata | type: ItemMetadata | description: Metadata of the item, including its GUID and success or failure status.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: externalEntityId | type: string | description: GUID of the related resource in GUGUID format.  | validation: format GUID
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata for the overall bulk action, including success and failure counts.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  


```

### Examples

### bulkCancelEvent
```javascript
import { activations } from '@wix/automations';

async function bulkCancelEvent(triggerKey,externalEntityIds) {
  const response = await activations.bulkCancelEvent(triggerKey,externalEntityIds);
};
```

### bulkCancelEvent (with elevated permissions)
```javascript
import { activations } from '@wix/automations';
import { auth } from '@wix/essentials';

async function myBulkCancelEventMethod(triggerKey,externalEntityIds) {
  const elevatedBulkCancelEvent = auth.elevate(activations.bulkCancelEvent);
  const response = await elevatedBulkCancelEvent(triggerKey,externalEntityIds);
}
```

### bulkCancelEvent (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 { activations } from '@wix/automations';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function bulkCancelEvent(triggerKey,externalEntityIds) {
  const response = await myWixClient.activations.bulkCancelEvent(triggerKey,externalEntityIds);
};
```

---