createEvent( )


Creates an event.

The event includes a default registration form in the selected language, which consists of input fields for first name, last name, and email. See Registration Form for more information.

You can create the event as a draft by setting the draft value to true. Otherwise, the event is published right away.

The event is automatically set up to send daily summary reports of new guests to your business email.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Events - all permissions
Manage Events
Learn more about app permissions.
Method Declaration
Copy
function createEvent(
  event: V3Event,
  options: CreateEventOptions,
): Promise<V3Event>;
Method Parameters
eventV3EventRequired

Event data.


optionsCreateEventOptions

Optional fields.

Returns
Return Type:Promise<V3Event>
JavaScript
import { wixEventsV2 } from "wix-events.v2"; async function createEvent(event, options) { try { const result = await wixEventsV2.createEvent(event, options); return result; } catch (error) { console.error(error); // Handle the error } }
Errors
400Invalid Argument

There are 2 errors with this status code.

428Failed Precondition

There are 2 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?