Search.../

copyEvent( )

Copies a Wix event.

Description

The copyEvent() function returns a Promise that resolves to the newly-copied Wix event after it has successfully been copied.

This function copies a Wix event, including its registration form, notifications, and ticket settings. The newly-copied event is scheduled two weeks from the date of the original event.

When copying Wix events:

  • If your site has multilingual enabled, and your event has additional, translated elements (such as registration messages), the translated elements are also copied to the new event.
  • When an event with same title already exists, the title of the newly-copied event has a numeric suffix in parentheses appended to it. For example: Copying an event titled "My Event" creates "My Event (1)".
  • Very long event titles are cropped: For example: "Daily stand-up ev... (2)".
    The maximum number of characters allowed is 120, which includes the suffix identifying the copy of the event.

The onEventCreated( ) event handler runs when a Wix event is copied. The received CreatedEvent object contains information about the new Wix event that was copied.

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

Note: This function requires elevated permissions to run.

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

Syntax

function copyEvent(eventId: string): Promise<WixEvent>

copyEvent Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID.

Returns

Fulfilled - The copied 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?

Copy a Wix event

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { wixEvents } from "wix-events-backend";
3import { elevate } from 'wix-auth';
4
5/* Sample eventId value: '3d3d5c04-ece0-45a8-85f0-11a58edaa192'; */
6
7export const myCopyEventFunction = webMethod(Permissions.Anyone, async (eventId) => {
8 try {
9 const elevatedCopyEvent = elevate(wixEvents.copyEvent);
10 const copiedEvent = await elevatedCopyEvent(eventId);
11 console.log('Success! Copied event:', copiedEvent);
12 return copiedEvent;
13 } catch (error) {
14 console.error(error);
15 // Handle the error
16 }
17});
18
19/* Promise resolves to:
20{
21 "about": "Learn to design and handmake your own custom, leather sandals from scratch.",
22 "assignedContactsLabel": "custom.artisanal-leather-shoemaking-for-beginners-a-cou-4",
23 "calendarLinks": {
24 "google": "http://calendar.google.com/calendar/render?action=TEMPLATE&text=Artisanal+Leather+Shoemaking+for+Beginners%2C+A+course+by+Marta+Grau+%282%29&dates=&location=Washington%2C+USA&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%0AArtisanal+Leather+Shoemaking+for+Beginners%2C+A+course+by+Marta+Grau+%282%29%0ATime+is+TBD%0AOnline%2C+Washington%2C+USA",
25 "ics": "https://www.wixevents.com/media/v2/calendar?token=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiaW5zdGFuY2VJZFwiOlwiMWY2ZGM5MDYtODAzZC00NjUwLTgzZjUtNzJlYTFkODgxMDBiXCIsXCJldmVudElkXCI6e1widmFsdWVcIjpcIjRlNWU0YWRiLTk3NzgtNDE3MS1hOWJiLTQ0ZTI3ODM0YWM4OVwifSxcIm9jTGlua1wiOm51bGx9IiwiaWF0IjoxNjk5NDQ4MTg4fQ.VeW4d5EuToAZ0A53h8kHEmmjUQdulyU-EOuAu4oZ0FE"
26 },
27 "categories": [],
28 "createdBy": "",
29 "_createdDate": "2023-11-08T12:56:28.545Z",
30 "description": "",
31 "eventUrl": {
32 "baseUrl": "https://mysite.com/events",
33 "path": "/event-details-registration/artisanal-leather-shoemaking-for-beginners-a-course-by-marta-grau-2"
34 },
35 "form": {
36 "inputGroups": [
37 {
38 "_id": "name",
39 "inputs": [
40 {
41 "additionalLabels": [],
42 "label": "First name",
43 "maxLength": 50,
44 "name": "firstName",
45 "options": [],
46 "required": true,
47 "type": "TEXT"
48 },
49 {
50 "additionalLabels": [],
51 "label": "Last name",
52 "maxLength": 50,
53 "name": "lastName",
54 "options": [],
55 "required": true,
56 "type": "TEXT"
57 }
58 ],
59 "orderIndex": 0,
60 "system": true,
61 "type": "NAME"
62 },
63 {
64 "_id": "email",
65 "inputs": [
66 {
67 "additionalLabels": [],
68 "label": "Email",
69 "maxLength": 255,
70 "name": "email",
71 "options": [],
72 "required": true,
73 "type": "TEXT"
74 }
75 ],
76 "orderIndex": 1,
77 "system": true,
78 "type": "INPUT"
79 }
80 ],
81 "messages": {
82 "checkout": {
83 "checkoutLabel": "Continue",
84 "title": "Add your details"
85 },
86 "registrationClosed": {
87 "exploreEventsLabel": "See other events",
88 "message": "Registration is closed"
89 },
90 "rsvp": {
91 "noMessages": {
92 "confirmationTitle": "Sorry You Can't Make It",
93 "shareLabel": "Share",
94 "title": "Add your details"
95 },
96 "rsvpNo": "Not Going",
97 "rsvpYes": "I'm Going",
98 "submitRsvpLabel": "SUBMIT",
99 "waitingMessages": {
100 "addToCalendarLabel": "Add to Calendar",
101 "confirmationMessage": "We'll update you if additional spots become available.",
102 "confirmationTitle": "Thanks! You've been added to the waitlist.",
103 "shareLabel": "Share",
104 "title": "Looks Like This Event Is Full. Join the waiting list"
105 },
106 "yesMessages": {
107 "addToCalendarLabel": "Add to Calendar",
108 "confirmationMessage": "An email with all the event info was sent to you.",
109 "confirmationTitle": "Thank you!",
110 "shareLabel": "Share",
111 "title": "Add your details"
112 }
113 }
114 }
115 },
116 "guestList": {
117 "public": true
118 },
119 "_id": "4e5e4adb-9778-4171-a9bb-44e27834ac89",
120 "language": "en",
121 "location": {
122 "address": {
123 "formatted": "Washington, USA",
124 "location": {
125 "latitude": 47.7510741,
126 "longitude": -120.7401386
127 },
128 "subdivision": "WA",
129 "country": "US",
130 "streetAddress": {
131 "name": "",
132 "number": "",
133 "apt": ""
134 }
135 },
136 "name": "Online",
137 "tbd": false,
138 "type": "VENUE"
139 },
140 "mainImage": "wix:image://v1/8a8b9b_c91a236e494c4e66b771b1acf59021ff~mv2.webp/file#originWidth=1280&originHeight=720",
141 "registration": {
142 "initialType": "TICKETS",
143 "restrictedTo": "VISITOR",
144 "rsvp": {
145 "responseOptions": "YES_ONLY",
146 "waitlist": false
147 },
148 "status": "CLOSED",
149 "tickets": {
150 "currency": "EUR",
151 "formAssignedPerTicket": false,
152 "highestTicketPrice": {},
153 "lowestTicketPrice": {
154 "currency": "EUR",
155 "value": "0.00"
156 },
157 "lowestTicketPriceFormatted": "€0",
158 "tax": {}
159 },
160 "type": "TICKETS"
161 },
162 "scheduling": {
163 "formatted": "Time is TBD",
164 "hideEndDate": false,
165 "showTimeZone": false,
166 "startDateFormatted": "",
167 "startTimeFormatted": "",
168 "tbd": true,
169 "tbdMessage": "Time is TBD"
170 },
171 "slug": "artisanal-leather-shoemaking-for-beginners-a-course-by-marta-grau-2",
172 "status": "SCHEDULED",
173 "summary": {
174 "rsvp": {
175 "noCount": 0,
176 "totalRsvps": 0,
177 "waitlistCount": 0,
178 "yesCount": 0
179 },
180 "tickets": {
181 "currencyLocked": false,
182 "revenue": {},
183 "totalOrders": 0,
184 "totalSales": {},
185 "totalTickets": 0
186 }
187 },
188 "title": "Artisanal Leather Shoemaking for Beginners, A course by Marta Grau (2)",
189 "_updatedDate": "2023-11-08T12:56:28.000Z",
190 "videoConferencing": {
191 "session": {
192 "guestLink": "https://www.wixevents.com/oc?join=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiYWN0aW9uXCI6XCJqb2luXCIsXCJpbnN0YW5jZUlkXCI6XCIxZjZkYzkwNi04MDNkLTQ2NTAtODNmNS03MmVhMWQ4ODEwMGJcIixcImV2ZW50SWRcIjpcIjRlNWU0YWRiLTk3NzgtNDE3MS1hOWJiLTQ0ZTI3ODM0YWM4OVwifSIsImlhdCI6MTY5OTQ0ODE4OH0.l4M7dk9tCmOtfLpwJC7AfHlVfzMbqsDNqr5ne-Y_ry8",
193 "hostLink": "https://www.wixevents.com/oc?start=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiYWN0aW9uXCI6XCJzdGFydFwiLFwiaW5zdGFuY2VJZFwiOlwiMWY2ZGM5MDYtODAzZC00NjUwLTgzZjUtNzJlYTFkODgxMDBiXCIsXCJldmVudElkXCI6XCI0ZTVlNGFkYi05Nzc4LTQxNzEtYTliYi00NGUyNzgzNGFjODlcIn0iLCJpYXQiOjE2OTk0NDgxODh9.bFuTU4SXSL8BuDV7uA3dLw2dfZa9y4KKWpmPxhNo81M"
194 }
195 }
196}
197*/