> 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 # 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](#report-event). 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](#reporting-and-canceling-events) for more information. > 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](#report-event). 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](#reporting-and-canceling-events) for more information. > 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 param name: triggerKey | type: triggerKey | description: Trigger key whose event you want to cancel. For example, `form_submitted` or `invoice_due`. | required: true Return type: CancelEventResponse EMPTY-OBJECT {} ``` ### Examples ### CancelEvent ```curl ~~~cURL curl POST https://www.wixapis.com/automations/v1/events/cancel \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' \ -d '{ "triggerKey": "my_trigger", "externalEntityId": "16ef8c9c-413e-4d5f-b77d-8c67c3c8ae0c" }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.triggers.EsbConfigResolver.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](#report-event). 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](#reporting-and-canceling-events) for more information. > 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: 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 param name: triggerKey | type: string | description: Trigger key whose event you want to cancel. For example, `form_submitted` or `invoice_due`. | required: true Return type: PROMISE 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-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 { 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); }; ``` ---