> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# CreateEvent

# Package: marketingPlan

# Namespace: CalendarService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/marketing-plan/calendar-event-v1/create-event.md

## Permission Scopes:
Manage Marketing Plans: SCOPE.PROMOTE.MANAGE-MARKETING-PLAN

## Introduction

Creates a calendar event.

---

## REST API

### Schema

```
 Method: createEvent
 Description: Creates a calendar event.
 URL: https://www.wixapis.com/promote/marketing-plan-service/v1/events
 Method: POST
 Method parameters:
   param name: calendarEvent | type: CalendarEvent | description: A custom event that a site owner adds to their marketing content calendar, such as a sale, holiday, product launch, or business milestone. These events give the AI additional context when generating a marketing plan: plan activities can be scheduled around them. The events themselves do not directly create marketing activities.  An event can be one-time (set `date`) or recurring (set `recurringRule`). If both are sent, `recurringRule` takes precedence.  
        - name: name | type: string | description: Display name of the event (for example, "Summer Sale" or "Independence Day").  | validation: maxLength 3000
        - name: date | type: string | description: Date and time of the event. Set this field for a one-time event. For a recurring event, set `recurringRule` instead. If both are sent, `recurringRule` takes precedence and `date` is ignored. If neither is sent, the request fails with `INVALID_ARGUMENT`.  | validation: format date-time
        - name: recurringRule | type: RecurringRule | description: Recurrence rule for the event. Set this field for a recurring event (weekly, monthly, or yearly). If both `recurringRule` and `date` are sent, `recurringRule` takes precedence and `date` is ignored. `frequency` is required and must not be `UNKNOWN`; omitting it returns a `FAILED_PRECONDITION` error.  
           - name: frequency | type: Frequency | description: How often the event repeats.  
                 - enum:
                 -     WEEKLY: The event repeats every week.
                 -     MONTHLY: The event repeats every month.
                 -     YEARLY: The event repeats every year.
           - name: weekDay | type: integer | description: Day of the week the event falls on, where `0` is Monday and `6` is Sunday. Used with `WEEKLY` frequency.  | validation: minimum 0, maximum 6, format int32
           - name: monthDay | type: integer | description: Day of the month the event falls on. Used with `MONTHLY` frequency.  | validation: minimum 1, maximum 31, format int32
           - name: month | type: integer | description: Month of the year the event falls in, where `1` is January and `12` is December. Used with `YEARLY` frequency.  | validation: minimum 1, maximum 12, format int32
           - name: occurrencePosition | type: integer | description: Ordinal position of the occurrence within the period (for example, `2` means "the 2nd Monday of the month"). Used with `MONTHLY` frequency alongside `weekDay`.  | validation: minimum 1, maximum 5, format int32
           - name: startDate | type: string | description: Date from which the recurrence starts.  | validation: format date-time
        - name: description | type: string | description: Optional description providing additional context about the event.  | validation: maxLength 3000
 Return type: CreateEventResponse
  - name: event | type: CalendarEvent | description: The created event.  
     - name: id | type: string | description: Unique event GUID. Assigned on creation.  | validation: format GUID
     - name: name | type: string | description: Display name of the event (for example, "Summer Sale" or "Independence Day").  | validation: maxLength 3000
     - name: date | type: string | description: Date and time of the event. Set this field for a one-time event. For a recurring event, set `recurringRule` instead. If both are sent, `recurringRule` takes precedence and `date` is ignored. If neither is sent, the request fails with `INVALID_ARGUMENT`.  | validation: format date-time
     - name: calendarId | type: string | description: GUID of the marketing calendar this event belongs to.  | validation: format GUID
     - name: recurringRule | type: RecurringRule | description: Recurrence rule for the event. Set this field for a recurring event (weekly, monthly, or yearly). If both `recurringRule` and `date` are sent, `recurringRule` takes precedence and `date` is ignored. `frequency` is required and must not be `UNKNOWN`; omitting it returns a `FAILED_PRECONDITION` error.  
        - name: frequency | type: Frequency | description: How often the event repeats.  
             - enum:
             -     WEEKLY: The event repeats every week.
             -     MONTHLY: The event repeats every month.
             -     YEARLY: The event repeats every year.
        - name: weekDay | type: integer | description: Day of the week the event falls on, where `0` is Monday and `6` is Sunday. Used with `WEEKLY` frequency.  | validation: minimum 0, maximum 6, format int32
        - name: monthDay | type: integer | description: Day of the month the event falls on. Used with `MONTHLY` frequency.  | validation: minimum 1, maximum 31, format int32
        - name: month | type: integer | description: Month of the year the event falls in, where `1` is January and `12` is December. Used with `YEARLY` frequency.  | validation: minimum 1, maximum 12, format int32
        - name: occurrencePosition | type: integer | description: Ordinal position of the occurrence within the period (for example, `2` means "the 2nd Monday of the month"). Used with `MONTHLY` frequency alongside `weekDay`.  | validation: minimum 1, maximum 5, format int32
        - name: startDate | type: string | description: Date from which the recurrence starts.  | validation: format date-time
     - name: recurringOccurrences | type: array<RecurringEventOccurrence> | description: Computed individual occurrences of a recurring event. Read-only; populated only in `QueryEvents` responses, and only for occurrences within the requested date range.  | validation: minItems 0, maxItems 100
        - name: date | type: string | description: Date and time of this occurrence.  | validation: format date-time
     - name: description | type: string | description: Optional description providing additional context about the event.  | validation: maxLength 3000


```

### Examples

### Create a one-time event
Create a single-occurrence marketing calendar event by setting its date.

```curl
curl -X POST \
'https://www.wixapis.com/promote/marketing-plan-service/v1/events' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "calendarEvent": {
    "name": "Summer Sale Launch",
    "description": "Kick off our summer promotion across all social channels.",
    "date": "2026-07-01T09:00:00.000Z"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGrowthToolsMarketingPlan.calendarEvents.createEvent(options)
 Description: Creates a calendar event.
 Method parameters:
   param name: options | type: CreateEventOptions  none  
        - name: calendarEvent | type: CalendarEvent | description: Event to create. Send the event in this `calendarEvent` field; the response returns the created event in the `event` field.  
           - name: name | type: string | description: Display name of the event (for example, "Summer Sale" or "Independence Day").  | validation: maxLength 3000
           - name: date | type: Date | description: Date and time of the event. Set this field for a one-time event. For a recurring event, set `recurringRule` instead. If both are sent, `recurringRule` takes precedence and `date` is ignored. If neither is sent, the request fails with `INVALID_ARGUMENT`.  
           - name: recurringRule | type: RecurringRule | description: Recurrence rule for the event. Set this field for a recurring event (weekly, monthly, or yearly). If both `recurringRule` and `date` are sent, `recurringRule` takes precedence and `date` is ignored. `frequency` is required and must not be `UNKNOWN`; omitting it returns a `FAILED_PRECONDITION` error.  
              - name: frequency | type: Frequency | description: How often the event repeats.  
                     - enum:
                     -     WEEKLY: The event repeats every week.
                     -     MONTHLY: The event repeats every month.
                     -     YEARLY: The event repeats every year.
              - name: weekDay | type: integer | description: Day of the week the event falls on, where `0` is Monday and `6` is Sunday. Used with `WEEKLY` frequency.  | validation: minimum 0, maximum 6, format int32
              - name: monthDay | type: integer | description: Day of the month the event falls on. Used with `MONTHLY` frequency.  | validation: minimum 1, maximum 31, format int32
              - name: month | type: integer | description: Month of the year the event falls in, where `1` is January and `12` is December. Used with `YEARLY` frequency.  | validation: minimum 1, maximum 12, format int32
              - name: occurrencePosition | type: integer | description: Ordinal position of the occurrence within the period (for example, `2` means "the 2nd Monday of the month"). Used with `MONTHLY` frequency alongside `weekDay`.  | validation: minimum 1, maximum 5, format int32
              - name: startDate | type: Date | description: Date from which the recurrence starts.  
           - name: description | type: string | description: Optional description providing additional context about the event.  | validation: maxLength 3000
 Return type: PROMISE<CalendarEvent>
  - name: _id | type: string | description: Unique event GUID. Assigned on creation.  | validation: format GUID
  - name: name | type: string | description: Display name of the event (for example, "Summer Sale" or "Independence Day").  | validation: maxLength 3000
  - name: date | type: Date | description: Date and time of the event. Set this field for a one-time event. For a recurring event, set `recurringRule` instead. If both are sent, `recurringRule` takes precedence and `date` is ignored. If neither is sent, the request fails with `INVALID_ARGUMENT`.  
  - name: calendarId | type: string | description: GUID of the marketing calendar this event belongs to.  | validation: format GUID
  - name: recurringRule | type: RecurringRule | description: Recurrence rule for the event. Set this field for a recurring event (weekly, monthly, or yearly). If both `recurringRule` and `date` are sent, `recurringRule` takes precedence and `date` is ignored. `frequency` is required and must not be `UNKNOWN`; omitting it returns a `FAILED_PRECONDITION` error.  
     - name: frequency | type: Frequency | description: How often the event repeats.  
         - enum:
         -     WEEKLY: The event repeats every week.
         -     MONTHLY: The event repeats every month.
         -     YEARLY: The event repeats every year.
     - name: weekDay | type: integer | description: Day of the week the event falls on, where `0` is Monday and `6` is Sunday. Used with `WEEKLY` frequency.  | validation: minimum 0, maximum 6, format int32
     - name: monthDay | type: integer | description: Day of the month the event falls on. Used with `MONTHLY` frequency.  | validation: minimum 1, maximum 31, format int32
     - name: month | type: integer | description: Month of the year the event falls in, where `1` is January and `12` is December. Used with `YEARLY` frequency.  | validation: minimum 1, maximum 12, format int32
     - name: occurrencePosition | type: integer | description: Ordinal position of the occurrence within the period (for example, `2` means "the 2nd Monday of the month"). Used with `MONTHLY` frequency alongside `weekDay`.  | validation: minimum 1, maximum 5, format int32
     - name: startDate | type: Date | description: Date from which the recurrence starts.  
  - name: recurringOccurrences | type: array<RecurringEventOccurrence> | description: Computed individual occurrences of a recurring event. Read-only; populated only in `QueryEvents` responses, and only for occurrences within the requested date range.  | validation: minItems 0, maxItems 100
     - name: date | type: Date | description: Date and time of this occurrence.  
  - name: description | type: string | description: Optional description providing additional context about the event.  | validation: maxLength 3000


```

### Examples

### Create a one-time event
```javascript
import { calendarEvents } from "@wix/promote-growth-tools-marketing-plan";

const calendarEvent = {
  name: "Summer Sale Launch",
  description: "Kick off our summer promotion across all social channels.",
  date: new Date("2026-07-01T09:00:00.000Z"),
};

async function createEvent() {
  const response = await calendarEvents.createEvent({ calendarEvent });
}

```

### createEvent (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { calendarEvents } from '@wix/promote-growth-tools-marketing-plan';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { calendarEvents },
  // Include the auth strategy and host as relevant
});


async function createEvent(options) {
  const response = await myWixClient.calendarEvents.createEvent(options);
};
```

---