# Wix-events-backend: createEvent() FORBIDDEN

**URL:** <https://forum.wixstudio.com/t/wix-events-backend-createevent-forbidden/424>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [May 4, 2023, 3:12pm UTC](https://forum.wixstudio.com/t/wix-events-backend-createevent-forbidden/424 "2023-05-04T15:12:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cfath](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@cfath](https://forum.wixstudio.com/u/cfath)\
**Post date:** [May 4, 2023, 3:12pm UTC](https://forum.wixstudio.com/t/wix-events-backend-createevent-forbidden/424/1 "2023-05-04T15:12:56Z")

</div>

Dear People with a lot more experience than me:  
I’m facing an weird issue:

I try to code a backend site, where wixEvents can be created by the user.  
I used the documentation below, corrected the imbedded mistakes as other users described them (country codes, time formats, etc) but facing this odd behavior:

Running the code (in Preview - so that permission issues should not be a problem) returns an error message with following indications:

message: ‘’  
details: applicationError:  
description: Forbidden  
code: FORBIDDEN  
data: {}

I am afraid it is an internal bug. Is there any workaround, or does my path simply end there…?

Thanks a lot

import { wixEvents } **from** “wix-events-backend” ;

**const** eventInfo = {  
title : “Testevent” ,  
location : {  
name : “Testname” ,  
address : {  
formatted : “Hauptstrasse 12, Seeg, 87637, DE” ,  
city : “Seeg” ,  
subdivision : “Test” ,  
country : “DE” ,  
postalCode : “87637” ,  
streetAddress : {  
number : “12” ,  
name : “Hauptstrasse” ,  
apt : “10”  
}  
},  
type : ‘VENUE’ ,  
},  
scheduling : {  
timeZoneId : “Europe/London” ,  
startDate : **new** Date ( “2024-09-25T12:00:00Z” ),  
endDate : **new** Date ( “2024-09-26T12:00:00Z” )  
},  
registration : {  
initialType : ‘RSVP’  
}  
};

**const** options = {  
language : “en”  
};

export function myCreateEventFunction () {  
console . log ( “BACKEND: myCreateEventFunction()…” );

**return** wixEvents . createEvent ( eventInfo , options )  
. then (( result ) =\> {  
**return** result ;  
})  
. **catch** (( error ) =\> {  
console . error ( error );  
});  
}

---

<div class="post-metadata">

**Author:** ![kristinasa](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kristinasa/32/29383_2.png) [@kristinasa](https://forum.wixstudio.com/u/kristinasa)\
**Post date:** [May 11, 2023, 1:56pm UTC](https://forum.wixstudio.com/t/wix-events-backend-createevent-forbidden/424/2 "2023-05-11T13:56:53Z")

</div>

Hey,

Thanks for reaching out!

In order to use this successfully you need elevated permissions ( [docs](https://www.wix.com/velo/reference/wix-auth/elevate) ):

```javascript
import { wixEvents } from "wix-events-backend";
import * as wixAuth from "wix-auth";

const elevatedCreateEventFunction = wixAuth.elevate(wixEvents.createEvent);

const eventInfo = {
  title: "Healthy Living Series: Exercise and You",
  location: {
    name: "Community Hall",
    address: {
      formatted: "100 Gansevoort St, New York, NY 10014, USA",
      city: "New York City",
      subdivision: "New York",
      country: "US",
      postalCode: "10014",
      streetAddress: {
        number: "100",
        name: "Gansevoort Street",
        apt: "10"
      }
    },
    type: 'VENUE',
  },
  scheduling: {
    startDate: new Date("2023-09-14T13:30:00.000Z"),
    endDate: new Date("2023-09-14T15:30:00.000Z"),
    timeZoneId: "America/New_York"
  },
  registration: {
    initialType: 'RSVP'
  }
};

const options = {
  language: "en"
};

export function myCreateEventFunction() {
  return elevatedCreateEventFunction(eventInfo, options)
    .then((result) => {
      return result;
    })
    .catch((error) => {
      console.error(error);
    });
}

```

Hope it helps!

Regards,  
Kristina

---

<div class="post-metadata">

**Author:** ![yvrwfen](https://avatars.discourse-cdn.com/v4/letter/y/b5a626/32.png) [@yvrwfen](https://forum.wixstudio.com/u/yvrwfen)\
**Post date:** [June 2, 2023, 5:53pm UTC](https://forum.wixstudio.com/t/wix-events-backend-createevent-forbidden/424/4 "2023-06-02T17:53:50Z")

</div>

Play the games!

Safety and security are paramount when it comes to online gambling and sports betting. Rest assured that [Sona9 App Download for Android (APK) and iOS in India 2023](https://sona9.in/app/) India prioritizes the protection of your personal and financial information. With robust encryption and stringent privacy measures, you can enjoy your gaming experience with peace of mind.
