Search.../

updateEvent( )

Updates a Wix event.

Description

The updateEvent() function returns a Promise that resolves to the newly-updated Wix event after the Wix event is successfully updated.

Updating a Wix event does not impact existing guests or generated tickets, orders, and invoices.

Updating the title of a Wix event automatically updates the event's slug and eventUrl.path.

Only those with "Manage Events" permissions can update Wix events.

Note: This function requires elevated permissions to run.

This function is not universal and runs only on the backend.

Syntax

function updateEvent(eventId: string, eventInfo: WixEventUpdateInfo, options: WixEventInfoOptions): Promise<WixEvent>

updateEvent Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID.

eventInfo
WixEventUpdateInfo

Info used to update the Wix event.

options
WixEventInfoOptions

Options to use when updating the Wix event.

Returns

Fulfilled - The updated Wix event. Rejected - Error message.

Return Type:

Promise<WixEvent>
NAME
TYPE
DESCRIPTION
_id
string

Wix event ID.

location
Location

Wix event location details.

scheduling
Scheduling

Wix event scheduling details.

title
string

Wix event title.

description
string

Wix event description.

about
string

Rich-text (HTML) content for the "About Event" section.

mainImage
string

The location of an image that represents the Wix event. This image is printed on the ticket (PDF format). The image file must be an image file from the Media Manager.

The URL format is: wix:image://v1/<uri>/<filename>#originWidth=<width>&originHeight=<height>[&watermark=<watermark_manifest_string>]

slug
string

URL-friendly version of the Wix event title. Unique across all Wix events in the same site.

language
string

ISO 639-1 language code of the Wix event. Use to translate content on forms, and so on.

_createdDate
Date

Date the Wix event was created.

_updatedDate
Date

Date the Wix event was updated.

status
string

Wix event status. Defaults to "SCHEDULED". One of:

  • "SCHEDULED". The upcoming Wix event is scheduled but has not yet started.
  • "STARTED". The Wix event has started and is in progress.
  • "ENDED". The Wix event has ended.
  • "CANCELED". The Wix event has been canceled.
registration
Registration

Registration details for the Wix event.

calendarLinks
CalendarLinks

"Add to calendar" URLs.

eventUrl
SiteUrl

Event page URL components.

form
Form

Registration form for the site guest to fill out with their contact details, and other information, as relevant.

summary
Summaries

Summaries of Wix event sales.

guestList
GuestListSettings

Guest list settings for the Wix event.

createdBy
string

ID of the creator of the Wix event. If the creator is not logged in when creating the event, the createdBy property is empty.

videoConferencing
OnlineConferencing

Online conferencing details for the Wix event.

assignedContactsLabel
string

The "Filter by:" drop-down option for filtering contacts by this event
in the Dashboard's Contact List page. This read-only property is automatically populated to comprise a "custom" prefix, the title of the event, and other suffixes added for uniqueness. Note that even if the title of an event is updated, the assignedContactsLabel does not change.

Related Content:

Was this helpful?

Update a Wix event

This example demonstrates how to update a TBD event once the date is known. In addition to updating the date, we set the scheduling.tbd field to false.

Copy Code
1
2import { Permissions, webMethod } from 'wix-web-module';
3import { wixEvents } from "wix-events-backend";
4import { elevate } from 'wix-auth';
5
6/* Sample eventId value: '3d3d5c04-ece0-45a8-85f0-11a58edaa192'
7
8Sample eventInfo value:
9{
10 scheduling: {
11 tbd: false,
12 startDate: new Date("2024-09-14T19:00:00.000Z"),
13 endDate: new Date ("2024-09-14T23:00:00.000Z"),
14 timeZoneId: "Europe/Dublin",
15 hideEndDate: false,
16 showTimeZone: false
17 }
18}
19
20*/
21
22export const myUpdateEventFunction = webMethod(Permissions.Anyone, async (eventId, eventInfo, options) => {
23 try {
24 const elevatedUpdateEvent = elevate(wixEvents.updateEvent);
25 const updatedEvent = await elevatedUpdateEvent(eventId, eventInfo, options);
26 console.log('Success! Updated event:', updatedEvent);
27 return updatedEvent;
28 } catch (error) {
29 console.error(error);
30 // Handle the error
31 }
32});
33
34/* Promise resolves to:
35 {
36 "about": "Join us for Nature's Symphony: A Musical Journey Through Wildlife at the iconic Royal Albert Hall.",
37 "assignedContactsLabel": "custom.natures-symphony-a-musical-journey-through-wildlif",
38 "calendarLinks": {
39 "google": "http://calendar.google.com/calendar/render?action=TEMPLATE&text=Nature%27s+Symphony%3A+A+Musical+Journey+Through+Wildlife&dates=20231129T190000Z%2F20231129T230000Z&location=Kensington+Gore%2C+London+SW7%2C+UK&details=Thank+you+for+registering+to+our+event%21+Your+tickets+are+attached+to+this+email.+Don%27t+forget+to+bring+them.%0A%0AWe%27re+looking+forward+to+seeing+you+there.%0A%0AHere+are+the+details%3A%0A%0ANature%27s+Symphony%3A+A+Musical+Journey+Through+Wildlife%0A29+November+2023%2C+19%3A00%E2%80%9323%3A00%0ARoyal+Albert+Hall%2C+Kensington+Gore%2C+London+SW7%2C+UK",
40 "ics": "https://www.wixevents.com/media/v2/calendar?token=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiaW5zdGFuY2VJZFwiOlwiMWY2ZGM5MDYtODAzZC00NjUwLTgzZjUtNzJlYTFkODgxMDBiXCIsXCJldmVudElkXCI6e1widmFsdWVcIjpcImMyNDFlNmUyLWM5NTEtNDQwZC04YjYyLTUyYTZlYzM4MjE0MFwifSxcIm9jTGlua1wiOm51bGx9IiwiaWF0IjoxNjk5NDUwMDE2fQ.2wZA5WH2TOR4f8M1QICFOu8oD4gX70jBaCRMCFQRbqI"
41 },
42 "categories": [],
43 "createdBy": "8a8b9b73-4da8-47a5-8268-4396e68a0605",
44 "_createdDate": "2023-07-13T12:52:00.911Z",
45 "description": "Immerse yourself in the enchanting harmony of nature's symphony as it intertwines with the power of music!",
46 "eventUrl": {
47 "baseUrl": "https://mysite.com/events",
48 "path": "/event-details-registration/natures-symphony-a-musical-journey-through-wildlife"
49 },
50 "form": {
51 "inputGroups": [
52 {
53 "_id": "name",
54 "inputs": [
55 {
56 "additionalLabels": [],
57 "label": "First name",
58 "maxLength": 50,
59 "name": "firstName",
60 "options": [],
61 "required": true,
62 "type": "TEXT"
63 },
64 {
65 "additionalLabels": [],
66 "label": "Last name",
67 "maxLength": 50,
68 "name": "lastName",
69 "options": [],
70 "required": true,
71 "type": "TEXT"
72 }
73 ],
74 "orderIndex": 0,
75 "system": true,
76 "type": "NAME"
77 },
78 {
79 "_id": "email",
80 "inputs": [
81 {
82 "additionalLabels": [],
83 "label": "Email",
84 "maxLength": 255,
85 "name": "email",
86 "options": [],
87 "required": true,
88 "type": "TEXT"
89 }
90 ],
91 "orderIndex": 1,
92 "system": true,
93 "type": "INPUT"
94 }
95 ],
96 "messages": {
97 "checkout": {
98 "checkoutLabel": "Continue",
99 "title": "Add your details"
100 },
101 "registrationClosed": {
102 "exploreEventsLabel": "See other events",
103 "message": "Registration is closed"
104 },
105 "rsvp": {
106 "noMessages": {
107 "confirmationTitle": "Sorry You Can't Make It",
108 "shareLabel": "Share",
109 "title": "Add your details"
110 },
111 "rsvpNo": "Not Going",
112 "rsvpYes": "I'm Going",
113 "submitRsvpLabel": "SUBMIT",
114 "waitingMessages": {
115 "addToCalendarLabel": "Add to Calendar",
116 "confirmationMessage": "We'll update you if additional spots become available.",
117 "confirmationTitle": "Thanks! You've been added to the waitlist.",
118 "shareLabel": "Share",
119 "title": "Looks like this event is full. Join the waitlist."
120 },
121 "yesMessages": {
122 "addToCalendarLabel": "Add to Calendar",
123 "confirmationMessage": "An email with all the event info was sent to you.",
124 "confirmationTitle": "Thank you!",
125 "shareLabel": "Share",
126 "title": "Add your details"
127 }
128 }
129 }
130 },
131 "guestList": {
132 "public": true
133 },
134 "_id": "c241e6e2-c951-440d-8b62-52a6ec382140",
135 "language": "en",
136 "location": {
137 "address": {
138 "formatted": "Kensington Gore, London SW7, UK",
139 "location": {
140 "latitude": 51.5009132,
141 "longitude": -0.1766086
142 },
143 "city": "London",
144 "country": "GB",
145 "postalCode": "SW7 2BL",
146 "streetAddress": {
147 "name": "Kensington Gore",
148 "number": "SW7",
149 "apt": ""
150 }
151 },
152 "name": "Royal Albert Hall",
153 "tbd": false,
154 "type": "VENUE"
155 },
156 "registration": {
157 "initialType": "TICKETS",
158 "restrictedTo": "VISITOR",
159 "rsvp": {
160 "responseOptions": "YES_ONLY",
161 "waitlist": false
162 },
163 "status": "OPEN_TICKETS",
164 "tickets": {
165 "currency": "EUR",
166 "formAssignedPerTicket": false,
167 "highestTicketPrice": {
168 "currency": "EUR",
169 "value": "20.00"
170 },
171 "highestTicketPriceFormatted": "€20",
172 "lowestTicketPrice": {
173 "currency": "EUR",
174 "value": "20.00"
175 },
176 "lowestTicketPriceFormatted": "€20",
177 "tax": {}
178 },
179 "type": "TICKETS"
180 },
181 "scheduling": {
182 "endDate": "2023-11-29T23:00:00.137Z",
183 "formatted": "29 November 2023, 19:00–23:00",
184 "hideEndDate": false,
185 "showTimeZone": false,
186 "startDate": "2023-11-29T19:00:00.000Z",
187 "startDateFormatted": "29 November 2023",
188 "startTimeFormatted": "19:00",
189 "tbd": false,
190 "timeZoneId": "Europe/Dublin"
191 },
192 "slug": "natures-symphony-a-musical-journey-through-wildlife",
193 "status": "SCHEDULED",
194 "summary": {
195 "rsvp": {
196 "noCount": 0,
197 "totalRsvps": 0,
198 "waitlistCount": 0,
199 "yesCount": 0
200 },
201 "tickets": {
202 "currencyLocked": false,
203 "revenue": {},
204 "totalOrders": 0,
205 "totalSales": {},
206 "totalTickets": 0
207 }
208 },
209 "title": "Nature's Symphony: A Musical Journey Through Wildlife",
210 "_updatedDate": "2023-11-09T15:00:54.345Z",
211 "videoConferencing": {
212 "session": {
213 "guestLink": "https://www.wixevents.com/oc?join=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiYWN0aW9uXCI6XCJqb2luXCIsXCJpbnN0YW5jZUlkXCI6XCIxZjZkYzkwNi04MDNkLTQ2NTAtODNmNS03MmVhMWQ4ODEwMGJcIixcImV2ZW50SWRcIjpcImMyNDFlNmUyLWM5NTEtNDQwZC04YjYyLTUyYTZlYzM4MjE0MFwifSIsImlhdCI6MTY5OTQ1MDAxNn0.AfJHpzU54hY8M1oVB0KGe47GUSzOzkWBVpKTTWEXk5Y",
214 "hostLink": "https://www.wixevents.com/oc?start=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiYWN0aW9uXCI6XCJzdGFydFwiLFwiaW5zdGFuY2VJZFwiOlwiMWY2ZGM5MDYtODAzZC00NjUwLTgzZjUtNzJlYTFkODgxMDBiXCIsXCJldmVudElkXCI6XCJjMjQxZTZlMi1jOTUxLTQ0MGQtOGI2Mi01MmE2ZWMzODIxNDBcIn0iLCJpYXQiOjE2OTk0NTAwMTZ9.VmvnxZHBL6cCyE0ZYRdAa6cCud8aNchTTrLJX0b-Mhs"
215 }
216 }
217}
218*/