> 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

# UpdateEvent

# Package: marketingPlan

# Namespace: CalendarService

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

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

## Introduction

Updates a calendar event.

Update replaces the entire event (there's no partial update and no field mask), so re-supply
every field you want to keep, including `date` or `recurringRule`. Updating a one-time event
with a `recurringRule` (or vice versa) switches its type.

Events from a connected calendar are read-only: updating one returns a `FAILED_PRECONDITION`
error. Updating an event ID that doesn't exist also returns a `FAILED_PRECONDITION` error.

---

## REST API

### Schema

```
 Method: updateEvent
 Description: Updates a calendar event.  Update replaces the entire event (there's no partial update and no field mask), so re-supply every field you want to keep, including `date` or `recurringRule`. Updating a one-time event with a `recurringRule` (or vice versa) switches its type.  Events from a connected calendar are read-only: updating one returns a `FAILED_PRECONDITION` error. Updating an event GUID that doesn't exist also returns a `FAILED_PRECONDITION` error.
 URL: https://www.wixapis.com/promote/marketing-plan-service/v1/events/{event.id}
 Method: PUT
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  event, event.id, event.name
 Method parameters: 
   param name: event | 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. | required: true 
        - name: id | type: string | description: Unique event GUID. Assigned on creation. | required: true | validation: format GUID
        - name: name | type: string | description: Display name of the event (for example, "Summer Sale" or "Independence Day"). | required: true | 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: UpdateEventResponse
  - name: event | type: CalendarEvent | description: The updated 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

### Update an event
Update an existing calendar event. The event id is passed in the path and the full event in the body.

```curl
curl -X PUT \
'https://www.wixapis.com/promote/marketing-plan-service/v1/events/d7a341c4-196b-46e7-813c-2b0fc1847ec6' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "event": {
    "id": "d7a341c4-196b-46e7-813c-2b0fc1847ec6",
    "name": "Summer Sale Launch (Extended)",
    "description": "Extended summer promotion running across all social channels.",
    "date": "2026-07-05T09:00:00.000Z"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGrowthToolsMarketingPlan.calendarEvents.updateEvent(_id, event)
 Description: Updates a calendar event.  Update replaces the entire event (there's no partial update and no field mask), so re-supply every field you want to keep, including `date` or `recurringRule`. Updating a one-time event with a `recurringRule` (or vice versa) switches its type.  Events from a connected calendar are read-only: updating one returns a `FAILED_PRECONDITION` error. Updating an event GUID that doesn't exist also returns a `FAILED_PRECONDITION` error.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  event, _id, event.name
 Method parameters: 
   param name: _id | type: string | description: Unique event GUID. Assigned on creation. | required: true | validation: format GUID
   param name: event | 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. | required: true 
        - name: name | type: string | description: Display name of the event (for example, "Summer Sale" or "Independence Day"). | required: true | 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<UpdateEventResponse>
  - name: event | type: CalendarEvent | description: The updated 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: 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

### Update an event
```javascript
import { calendarEvents } from "@wix/promote-growth-tools-marketing-plan";

const eventId = "d7a341c4-196b-46e7-813c-2b0fc1847ec6";

const event = {
  name: "Summer Sale Launch (Extended)",
  description: "Extended summer promotion running across all social channels.",
  date: new Date("2026-07-05T09:00:00.000Z"),
};

async function updateEvent() {
  const response = await calendarEvents.updateEvent(eventId, event);
}

/* Promise resolves to:
 * {
 *   "_id": "d7a341c4-196b-46e7-813c-2b0fc1847ec6",
 *   "name": "Summer Sale Launch (Extended)",
 *   "description": "Extended summer promotion running across all social channels.",
 *   "date": "2026-07-05T09:00:00.000Z"
 * }
 */

```

### updateEvent (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 updateEvent(_id,event) {
  const response = await myWixClient.calendarEvents.updateEvent(_id,event);
};
```

---