> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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.

`name` is required. Create a one-time event by setting `date`, or a recurring one by setting
`recurringRule` with a `frequency` other than `UNKNOWN`. If both `date` and `recurringRule`
are sent, the event is created as recurring and `date` is ignored. Omitting `name`, omitting `date` on a one-time
event, or sending a `recurringRule` with an `UNKNOWN` frequency returns an error.

---

## REST API

### Schema

```
 Method: createEvent
 Description: Creates a calendar event.  `name` is required. Create a one-time event by setting `date`, or a recurring one by setting `recurringRule` with a `frequency` other than `UNKNOWN`. If both `date` and `recurringRule` are sent, the event is created as recurring and `date` is ignored. Omitting `name`, omitting `date` on a one-time event, or sending a `recurringRule` with an `UNKNOWN` frequency returns an error.
 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, the event is created as recurring and `date` is ignored.  
        - 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.  | read-only: true | 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.  | read-only: true | 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.  | read-only: true | 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.  `name` is required. Create a one-time event by setting `date`, or a recurring one by setting `recurringRule` with a `frequency` other than `UNKNOWN`. If both `date` and `recurringRule` are sent, the event is created as recurring and `date` is ignored. Omitting `name`, omitting `date` on a one-time event, or sending a `recurringRule` with an `UNKNOWN` frequency returns an error.
 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.  | read-only: true | 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.  | read-only: true | 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.  | read-only: true | 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-managed)
Self-managed 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);
};
```

---