Search.../

cancelEvent( )

Cancels an event.

Description

After cancellation, registration for an event is closed. To reuse the event, clone and 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.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function cancelEvent(eventId: string, options: CancelEventOptions): Promise<CancelEventResponse>

cancelEvent Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID.

options
Optional
CancelEventOptions

Optional fields.

Returns

Return Type:

Promise<
CancelEventResponse
>
NAME
TYPE
DESCRIPTION
event
V3Event

Canceled event.

Was this helpful?

cancelEvent example

Copy Code
1import { wixEventsV2 } from 'wix-events.v2';
2
3 async function cancelEvent(eventId, options) {
4 try {
5 const result = await wixEventsV2.cancelEvent(eventId, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13