> 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

# CancelEvent

# Package: triggers

# Namespace: EsbConfigResolver

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

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

## Introduction

Cancels any remaining actions for a trigger and external entity.


Events are not cancelable by default.
To make an event cancelable,
you must first pass an `externalEntityId`
and the applicable `triggerKey` to [Report Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/report-event.md).
When you call Cancel Event with the same `externalEntityId` and `triggerKey`,
the event is canceled,
as are all other events that share the `externalEntityId` and `triggerKey`.
See
[Reporting and Canceling Events](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/reporting-and-canceling-events.md)
for more information.

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

> You cannot try out this endpoint because
> it can be called only by the app that created the specified `triggerKey`.
> So please ignore the **Try It Out** button.

---

## REST API

### Schema

```
 Method: cancelEvent
 Description: Cancels any remaining actions for a trigger and external entity.   Events are not cancelable by default. To make an event cancelable, you must first pass an `externalEntityId` and the applicable `triggerKey` to [Report Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/report-event.md). When you call Cancel Event with the same `externalEntityId` and `triggerKey`, the event is canceled, as are all other events that share the `externalEntityId` and `triggerKey`. See [Reporting and Canceling Events](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/reporting-and-canceling-events.md) for more information.  To cancel events for multiple external entities in a single call, call [Bulk Cancel Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/bulk-cancel-event.md).  > You cannot try out this endpoint because > it can be called only by the app that created the specified `triggerKey`. > So please ignore the **Try It Out** button.
 URL: https://www.wixapis.com/automations/v1/events/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, externalEntityId
 Method parameters: 
   param name: externalEntityId | type: externalEntityId | description: GUID of the related resource in GUGUID format. For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.  Typically, this GUID is defined in your system, but you can also use any Wix resource GUID, such as contact GUID, member GUID, or invoice GUID. See [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events.md#choose-the-right-externalentityid) for more information. | required: true | validation: format GUID
   param name: triggerKey | type: triggerKey | description: Trigger key whose event you want to cancel. For example, `form_submitted` or `invoice_due`. | required: true | validation: minLength 1, maxLength 100
 Return type: CancelEventResponse
  EMPTY-OBJECT {}


```

### Examples

### CancelEvent
```curl
~~~cURL
curl -X POST https://www.wixapis.com/automations/v1/events/cancel \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "triggerKey": "my_trigger",
    "externalEntityId": "16ef8c9c-413e-4d5f-b77d-8c67c3c8ae0c"
  }'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.automations.activations.cancelEvent(triggerKey, externalEntityId)
 Description: Cancels any remaining actions for a trigger and external entity.   Events are not cancelable by default. To make an event cancelable, you must first pass an `externalEntityId` and the applicable `triggerKey` to [Report Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/report-event.md). When you call Cancel Event with the same `externalEntityId` and `triggerKey`, the event is canceled, as are all other events that share the `externalEntityId` and `triggerKey`. See [Reporting and Canceling Events](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/reporting-and-canceling-events.md) for more information.  To cancel events for multiple external entities in a single call, call [Bulk Cancel Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/bulk-cancel-event.md).  > You cannot try out this endpoint because > it can be called only by the app that created the specified `triggerKey`. > So please ignore the **Try It Out** button.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  triggerKey, externalEntityId
 Method parameters: 
   param name: triggerKey | type: string | description: Trigger key whose event you want to cancel. For example, `form_submitted` or `invoice_due`. | required: true | validation: minLength 1, maxLength 100
   param name: externalEntityId | type: string | description: GUID of the related resource in GUGUID format. For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.  Typically, this GUID is defined in your system, but you can also use any Wix resource GUID, such as contact GUID, member GUID, or invoice GUID. See [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events.md#choose-the-right-externalentityid) for more information. | required: true | validation: format GUID
 Return type: PROMISE<CancelEventResponse>
  EMPTY-OBJECT {}


```

### Examples

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

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

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

async function myCancelEventMethod(triggerKey,externalEntityId) {
  const elevatedCancelEvent = auth.elevate(activations.cancelEvent);
  const response = await elevatedCancelEvent(triggerKey,externalEntityId);
}
```

### cancelEvent (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 cancelEvent(triggerKey,externalEntityId) {
  const response = await myWixClient.activations.cancelEvent(triggerKey,externalEntityId);
};
```

---