createEvent( )
Creates an event.
Description
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.
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function createEvent(event: V3Event, options: CreateEventOptions): Promise<V3Event>
createEvent Parameters
NAME
TYPE
DESCRIPTION
Event data.
Optional fields.
Returns
Created event.
Return Type:
NAME
TYPE
DESCRIPTION
Date and time when the event was created in yyyy-mm-ddThh:mm:sssZ
format.
Event ID.
Date and time when the event was updated in yyyy-mm-ddThh:mm:sssZ
format.
Event schedule details.
URLs that allow you to add an event to the Google calendar, or to download an ICS calendar file.
Assigned contacts label key.
Event date and time settings.
Detailed description of an event. You can enter the description using rich text format (add various types of markups, such as underlines, italics, bolding, color codes, bullet lists, and links by using HTML formatting tags).
Visual settings for event.
Event page URL components.
Event registration form.
Guest list configuration.
Instance ID of the site where the event is hosted.
Event location.
Main event image.
Online conferencing details.
RSVP or ticketing registration details.
SEO settings.
Short description that appears under the event title.
Unique identifier of the event page. The naming is the same as the event title written in kebab case. For example, if your event title is "Leather Crafting 101", then the slug is "leather-crafting-101".
Event status:
UPCOMING
: Event is published and scheduled to start.STARTED
: Event has started.ENDED
: Event has ended.CANCELED
: Event is canceled.DRAFT
: Event is not published.
Summary of RSVP or ticket sales.
Event title.
ID of the user who created the event.
Was this helpful?
createEvent example
1import { wixEventsV2 } from 'wix-events.v2';23 async function createEvent(event, options) {4 try {5 const result = await wixEventsV2.createEvent(event, options);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13