> 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

# UpdateMessages

# Package: eventManagement

# Namespace: FormBuilder

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/form/update-messages?apiView=SDK.md

## Permission Scopes:
Manage Events: SCOPE.DC-EVENTS.MANAGE-EVENTS

## Introduction

Updates a set of defined form messages that are displayed to a site visitor before, during, and after the registration flow.
Includes the configuration of form titles, response labels, "thank you" messages, and call-to-action texts.

---

## REST API

### Schema

```
 Method: updateMessages
 Description: Updates a set of defined form messages that are displayed to a site visitor before, during, and after the registration flow. Includes the configuration of form titles, response labels, "thank you" messages, and call-to-action texts.
 URL: https://www.wixapis.com/events/v1/events/{eventId}/form/messages
 Method: PATCH
 Method parameters:
   param name: fields | type: fields | description: Set of field paths, specifying which parts of this resource to update. When fields are empty, request is interpreted as full update. Behavior follows [google.protobuf.FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask) semantics.  
   param name: messages | type: FormMessages | description: Defines form messages shown in UI before, during, and after registration flow. It enables configuration of form titles, response labels, "thank you" messages, and call-to-action texts.  
        - name: rsvp | type: RsvpFormMessages | description: [RSVP form](https://dev.wix.com/docs/rest/business-solutions/events/rsvp-v2/introduction.md) messages.  
           - name: rsvpYesOption | type: string | description: Label text indicating RSVP's `status` is `"YES"`.  
           - name: rsvpNoOption | type: string | description: Label text indicating RSVP's `status` is `"NO"`.  
           - name: positiveMessages | type: Positive | description: Messages displayed when an RSVP's `status` is set to `"YES"`.  
              - name: title | type: string | description: Main form title for positive response.  
              - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after registration.  
                 - name: title | type: string | description: Confirmation message title.  
                 - name: message | type: string | description: Confirmation message text.  
                 - name: addToCalendarActionLabel | type: string | description: "Add to calendar" call-to-action label text.  
                 - name: shareActionLabel | type: string | description: "Share event" call-to-action label text.  
           - name: waitlistMessages | type: Positive | description: Messages displayed when an RSVP's `status` is set to `"WAITLIST"`, for when the event is full and a waitlist is available).  
           - name: negativeMessages | type: Negative | description: Messages displayed when an RSVP's `status` is set to `"NO"`.  
              - name: title | type: string | description: Main form title for negative response.  
              - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after registration.  
                 - name: title | type: string | description: Confirmation message title.  
                 - name: shareActionLabel | type: string | description: "Share event" call-to-action label text.  
           - name: submitActionLabel | type: string | description: "Submit form" call-to-action label text.  
        - name: checkout | type: CheckoutFormMessages | description: Checkout form messages.  
           - name: title | type: string | description: Main form title for response.  
           - name: submitActionLabel | type: string | description: Submit form call-to-action label text.  
           - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after checkout.  
              - name: title | type: string | description: Confirmation message title.  
              - name: message | type: string | description: Confirmation message text.  
              - name: downloadTicketsLabel | type: string | description: "Download tickets" call-to-action label text.  
              - name: addToCalendarLabel | type: string | description: "Add to calendar" call-to-action label text.  
              - name: shareEventLabel | type: string | description: "Share event" call-to-action label text.  
        - name: registrationClosed | type: RegistrationClosedMessages | description: Messages shown when event registration is closed.  
           - name: message | type: string | description: Message shown when event registration is closed.  
           - name: exploreEventsActionLabel | type: string | description: "Explore other events" call-to-action label text.  
        - name: ticketsUnavailable | type: TicketsUnavailableMessages | description: Messages shown when event tickets are unavailable.  
           - name: message | type: string | description: Message shown when event tickets are unavailable.  
           - name: exploreEventsActionLabel | type: string | description: "Explore other events" call-to-action label text.  
 Return type: UpdateMessagesResponse
  - name: form | type: Form | description: Modified event form.  
     - name: controls | type: array<InputControl> | description: Nested fields as an ordered list.  
        - name: type | type: InputControlType | description: Field control type.  
             - enum:
             -     INPUT: Single text value field.
             -     TEXTAREA: Single text value field with multiple lines.
             -     DROPDOWN: Single-choice field with predefined values.
             -     RADIO: Single-choice field with predefined values.
             -     CHECKBOX: Multiple-choice field with predefined values.
             -     NAME: Fields for entering first and last names.
             -     GUEST_CONTROL: Fields for additional guests and their respective names.
             -     ADDRESS_SHORT: Single-line address field.
             -     ADDRESS_FULL: Full address field with multiple lines.
             -     DATE: Fields for entering year, month, and day.
        - name: system | type: boolean | description: Whether the control is mandatory (such as `name` & `email`). When `true`, only the label can be changed.  
        - name: inputs | type: array<Input> | description: Child inputs.  
           - name: name | type: string | description: Field name.  
           - name: label | type: string | description: Main field label.  
           - name: additionalLabels | type: object | description: Additional labels for multi-valued fields such as address.  | validation: format map
           - name: options | type: array<string> | description: Predefined choice options for fields, such as dropdown.  
           - name: mandatory | type: boolean | description: Whether field is mandatory.  
           - name: maxLength | type: integer | description: Maximum number of accepted characters (relevant for text fields).  
           - name: type | type: ValueType | description: Type which determines field format. Used to validate submitted response.  
                 - enum: TEXT, NUMBER, TEXT_ARRAY, DATE_TIME, ADDRESS
           - name: maxSize | type: integer | description: The maximum number of accepted values for array input.  **Note:** Only applicable for `TEXT_ARRAY` input fields.  | validation: format int32
           - name: defaultOptionSelection | type: OptionSelection | description: Default option initially selected when an input has multiple choices.  Defaults to first (0th) option, if not configured. Currently only applicable for `type.dropdown`.  
              - ONE-OF: 
                 - name: optionIndex | type: integer | description: 0-based index from predefined `controls.inputs.options` which is initial selection.  | validation: minimum 0, maximum 199
                 - name: placeholderText | type: string | description: Placeholder hint describing expected choices, such as "Please select". Considered an empty choice.  | validation: maxLength 200
           - name: labels | type: array<Label> | description: Additional labels for multi-valued fields, such as address.  | read-only: true 
              - name: name | type: string | description: Field name.  
              - name: label | type: string | description: Field label.  
        - name: orderIndex | type: integer | description: Field controls are sorted by this value in ascending order.  
        - name: id | type: string | description: Unique control GUID.  
        - name: deleted | type: boolean | description: Whether the input control is deleted.  | read-only: true 
     - name: messages | type: FormMessages | description: Set of defined form messages displayed in the UI before, during, and after a registration flow. Includes the configuration of form titles, response labels, "thank you" messages, and call-to-action texts.  
        - name: rsvp | type: RsvpFormMessages | description: [RSVP form](https://dev.wix.com/docs/rest/business-solutions/events/rsvp-v2/introduction.md) messages.  
           - name: rsvpYesOption | type: string | description: Label text indicating RSVP's `status` is `"YES"`.  
           - name: rsvpNoOption | type: string | description: Label text indicating RSVP's `status` is `"NO"`.  
           - name: positiveMessages | type: Positive | description: Messages displayed when an RSVP's `status` is set to `"YES"`.  
              - name: title | type: string | description: Main form title for positive response.  
              - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after registration.  
                 - name: title | type: string | description: Confirmation message title.  
                 - name: message | type: string | description: Confirmation message text.  
                 - name: addToCalendarActionLabel | type: string | description: "Add to calendar" call-to-action label text.  
                 - name: shareActionLabel | type: string | description: "Share event" call-to-action label text.  
           - name: waitlistMessages | type: Positive | description: Messages displayed when an RSVP's `status` is set to `"WAITLIST"`, for when the event is full and a waitlist is available).  
           - name: negativeMessages | type: Negative | description: Messages displayed when an RSVP's `status` is set to `"NO"`.  
              - name: title | type: string | description: Main form title for negative response.  
              - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after registration.  
                 - name: title | type: string | description: Confirmation message title.  
                 - name: shareActionLabel | type: string | description: "Share event" call-to-action label text.  
           - name: submitActionLabel | type: string | description: "Submit form" call-to-action label text.  
        - name: checkout | type: CheckoutFormMessages | description: Checkout form messages.  
           - name: title | type: string | description: Main form title for response.  
           - name: submitActionLabel | type: string | description: Submit form call-to-action label text.  
           - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after checkout.  
              - name: title | type: string | description: Confirmation message title.  
              - name: message | type: string | description: Confirmation message text.  
              - name: downloadTicketsLabel | type: string | description: "Download tickets" call-to-action label text.  
              - name: addToCalendarLabel | type: string | description: "Add to calendar" call-to-action label text.  
              - name: shareEventLabel | type: string | description: "Share event" call-to-action label text.  
        - name: registrationClosed | type: RegistrationClosedMessages | description: Messages shown when event registration is closed.  
           - name: message | type: string | description: Message shown when event registration is closed.  
           - name: exploreEventsActionLabel | type: string | description: "Explore other events" call-to-action label text.  
        - name: ticketsUnavailable | type: TicketsUnavailableMessages | description: Messages shown when event tickets are unavailable.  
           - name: message | type: string | description: Message shown when event tickets are unavailable.  
           - name: exploreEventsActionLabel | type: string | description: "Explore other events" call-to-action label text.  


```

### Examples

### UpdateMessages
```curl
~~~cURL
curl -X PATCH 'https://www.wixapis.com/events/v1/events/ad18d12e-a6a9-4c17-abfa-6ff119479be2/form/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH TOKEN>' \
-d '{
  "messages": {
    "rsvp": {
      "rsvpYesOption": "I will attend",
      "positiveMessages": {
        "confirmation": {
          "title": "Thank you!"
        }
      }
    },
    "checkout": {
      "submitActionLabel": "Proceed"
    },
    "registrationClosed": {
      "message": "Check our news page for updates."
    }
  },
  "fields": {
    "paths": [
      "messages.rsvp.rsvpYesOption",
      "messages.rsvp.positiveMessages.confirmation.title",
      "messages.checkout.submitActionLabel",
      "messages.registrationClosed.message"
    ]
  }
}'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.forms.updateMessages(eventId, options)
 Description: Updates a set of defined form messages that are displayed to a site visitor before, during, and after the registration flow. Includes the configuration of form titles, response labels, "thank you" messages, and call-to-action texts.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  eventId
 Method parameters: 
   param name: eventId | type: string | description: Event GUID to which the form belongs. | required: true | validation: format GUID
   param name: options | type: UpdateMessagesOptions  none  
        - name: fields | type: array<string> | description: Set of field paths, specifying which parts of this resource to update. When fields are empty, request is interpreted as full update. Behavior follows [google.protobuf.FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask) semantics.  
        - name: messages | type: FormMessages | description: Set of configured form messages to update.  
           - name: rsvp | type: RsvpFormMessages | description: [RSVP form](https://dev.wix.com/docs/rest/business-solutions/events/rsvp-v2/introduction.md) messages.  
              - name: rsvpYesOption | type: string | description: Label text indicating RSVP's `status` is `"YES"`.  
              - name: rsvpNoOption | type: string | description: Label text indicating RSVP's `status` is `"NO"`.  
              - name: positiveMessages | type: Positive | description: Messages displayed when an RSVP's `status` is set to `"YES"`.  
                 - name: title | type: string | description: Main form title for positive response.  
                 - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after registration.  
                    - name: title | type: string | description: Confirmation message title.  
                    - name: message | type: string | description: Confirmation message text.  
                    - name: addToCalendarActionLabel | type: string | description: "Add to calendar" call-to-action label text.  
                    - name: shareActionLabel | type: string | description: "Share event" call-to-action label text.  
              - name: waitlistMessages | type: Positive | description: Messages displayed when an RSVP's `status` is set to `"WAITLIST"`, for when the event is full and a waitlist is available).  
              - name: negativeMessages | type: Negative | description: Messages displayed when an RSVP's `status` is set to `"NO"`.  
                 - name: title | type: string | description: Main form title for negative response.  
                 - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after registration.  
                    - name: title | type: string | description: Confirmation message title.  
                    - name: shareActionLabel | type: string | description: "Share event" call-to-action label text.  
              - name: submitActionLabel | type: string | description: "Submit form" call-to-action label text.  
           - name: checkout | type: CheckoutFormMessages | description: Checkout form messages.  
              - name: title | type: string | description: Main form title for response.  
              - name: submitActionLabel | type: string | description: Submit form call-to-action label text.  
              - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after checkout.  
                 - name: title | type: string | description: Confirmation message title.  
                 - name: message | type: string | description: Confirmation message text.  
                 - name: downloadTicketsLabel | type: string | description: "Download tickets" call-to-action label text.  
                 - name: addToCalendarLabel | type: string | description: "Add to calendar" call-to-action label text.  
                 - name: shareEventLabel | type: string | description: "Share event" call-to-action label text.  
           - name: registrationClosed | type: RegistrationClosedMessages | description: Messages shown when event registration is closed.  
              - name: message | type: string | description: Message shown when event registration is closed.  
              - name: exploreEventsActionLabel | type: string | description: "Explore other events" call-to-action label text.  
           - name: ticketsUnavailable | type: TicketsUnavailableMessages | description: Messages shown when event tickets are unavailable.  
              - name: message | type: string | description: Message shown when event tickets are unavailable.  
              - name: exploreEventsActionLabel | type: string | description: "Explore other events" call-to-action label text.  
 Return type: PROMISE<UpdateMessagesResponse>
  - name: form | type: Form | description: Modified event form.  
     - name: controls | type: array<InputControl> | description: Nested fields as an ordered list.  
        - name: type | type: InputControlType | description: Field control type.  
             - enum:
             -     INPUT: Single text value field.
             -     TEXTAREA: Single text value field with multiple lines.
             -     DROPDOWN: Single-choice field with predefined values.
             -     RADIO: Single-choice field with predefined values.
             -     CHECKBOX: Multiple-choice field with predefined values.
             -     NAME: Fields for entering first and last names.
             -     GUEST_CONTROL: Fields for additional guests and their respective names.
             -     ADDRESS_SHORT: Single-line address field.
             -     ADDRESS_FULL: Full address field with multiple lines.
             -     DATE: Fields for entering year, month, and day.
        - name: system | type: boolean | description: Whether the control is mandatory (such as `name` & `email`). When `true`, only the label can be changed.  
        - name: inputs | type: array<Input> | description: Child inputs.  
           - name: name | type: string | description: Field name.  
           - name: label | type: string | description: Main field label.  
           - name: additionalLabels | type: object | description: Additional labels for multi-valued fields such as address.  | validation: format map
           - name: options | type: array<string> | description: Predefined choice options for fields, such as dropdown.  
           - name: mandatory | type: boolean | description: Whether field is mandatory.  
           - name: maxLength | type: integer | description: Maximum number of accepted characters (relevant for text fields).  
           - name: type | type: ValueType | description: Type which determines field format. Used to validate submitted response.  
                 - enum: TEXT, NUMBER, TEXT_ARRAY, DATE_TIME, ADDRESS
           - name: maxSize | type: integer | description: The maximum number of accepted values for array input.  **Note:** Only applicable for `TEXT_ARRAY` input fields.  | validation: format int32
           - name: defaultOptionSelection | type: OptionSelection | description: Default option initially selected when an input has multiple choices.  Defaults to first (0th) option, if not configured. Currently only applicable for `type.dropdown`.  
              - ONE-OF: 
                 - name: optionIndex | type: integer | description: 0-based index from predefined `controls.inputs.options` which is initial selection.  | validation: minimum 0, maximum 199
                 - name: placeholderText | type: string | description: Placeholder hint describing expected choices, such as "Please select". Considered an empty choice.  | validation: maxLength 200
           - name: labels | type: array<Label> | description: Additional labels for multi-valued fields, such as address.  | read-only: true 
              - name: name | type: string | description: Field name.  
              - name: label | type: string | description: Field label.  
        - name: orderIndex | type: integer | description: Field controls are sorted by this value in ascending order.  
        - name: _id | type: string | description: Unique control GUID.  
        - name: deleted | type: boolean | description: Whether the input control is deleted.  | read-only: true 
     - name: messages | type: FormMessages | description: Set of defined form messages displayed in the UI before, during, and after a registration flow. Includes the configuration of form titles, response labels, "thank you" messages, and call-to-action texts.  
        - name: rsvp | type: RsvpFormMessages | description: [RSVP form](https://dev.wix.com/docs/rest/business-solutions/events/rsvp-v2/introduction.md) messages.  
           - name: rsvpYesOption | type: string | description: Label text indicating RSVP's `status` is `"YES"`.  
           - name: rsvpNoOption | type: string | description: Label text indicating RSVP's `status` is `"NO"`.  
           - name: positiveMessages | type: Positive | description: Messages displayed when an RSVP's `status` is set to `"YES"`.  
              - name: title | type: string | description: Main form title for positive response.  
              - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after registration.  
                 - name: title | type: string | description: Confirmation message title.  
                 - name: message | type: string | description: Confirmation message text.  
                 - name: addToCalendarActionLabel | type: string | description: "Add to calendar" call-to-action label text.  
                 - name: shareActionLabel | type: string | description: "Share event" call-to-action label text.  
           - name: waitlistMessages | type: Positive | description: Messages displayed when an RSVP's `status` is set to `"WAITLIST"`, for when the event is full and a waitlist is available).  
           - name: negativeMessages | type: Negative | description: Messages displayed when an RSVP's `status` is set to `"NO"`.  
              - name: title | type: string | description: Main form title for negative response.  
              - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after registration.  
                 - name: title | type: string | description: Confirmation message title.  
                 - name: shareActionLabel | type: string | description: "Share event" call-to-action label text.  
           - name: submitActionLabel | type: string | description: "Submit form" call-to-action label text.  
        - name: checkout | type: CheckoutFormMessages | description: Checkout form messages.  
           - name: title | type: string | description: Main form title for response.  
           - name: submitActionLabel | type: string | description: Submit form call-to-action label text.  
           - name: confirmation | type: ResponseConfirmation | description: Confirmation messages shown after checkout.  
              - name: title | type: string | description: Confirmation message title.  
              - name: message | type: string | description: Confirmation message text.  
              - name: downloadTicketsLabel | type: string | description: "Download tickets" call-to-action label text.  
              - name: addToCalendarLabel | type: string | description: "Add to calendar" call-to-action label text.  
              - name: shareEventLabel | type: string | description: "Share event" call-to-action label text.  
        - name: registrationClosed | type: RegistrationClosedMessages | description: Messages shown when event registration is closed.  
           - name: message | type: string | description: Message shown when event registration is closed.  
           - name: exploreEventsActionLabel | type: string | description: "Explore other events" call-to-action label text.  
        - name: ticketsUnavailable | type: TicketsUnavailableMessages | description: Messages shown when event tickets are unavailable.  
           - name: message | type: string | description: Message shown when event tickets are unavailable.  
           - name: exploreEventsActionLabel | type: string | description: "Explore other events" call-to-action label text.  


```

### Examples

### updateMessages
```javascript
import { forms } from '@wix/events';

async function updateMessages(eventId,options) {
  const response = await forms.updateMessages(eventId,options);
};
```

### updateMessages (with elevated permissions)
```javascript
import { forms } from '@wix/events';
import { auth } from '@wix/essentials';

async function myUpdateMessagesMethod(eventId,options) {
  const elevatedUpdateMessages = auth.elevate(forms.updateMessages);
  const response = await elevatedUpdateMessages(eventId,options);
}
```

### updateMessages (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 { forms } from '@wix/events';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function updateMessages(eventId,options) {
  const response = await myWixClient.forms.updateMessages(eventId,options);
};
```

---