> 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

# UpdateControl

# Package: eventManagement

# Namespace: FormBuilder

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/form/update-control.md

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

## Introduction

Updates an existing input control in the form. The applied changes trigger form publishing.

---

## REST API

### Schema

```
 Method: updateControl
 Description: Updates an existing input control in the form. The applied changes trigger form publishing.
 URL: https://www.wixapis.com/events/v1/events/{eventId}/form/controls/{id}
 Method: PUT
 Method parameters:
    - ONE-OF: 
     - name: phone | type: PhoneControl | description: Phone number input control.  
        - name: label | type: string | description: Phone input label.  | validation: maxLength 100
        - name: mandatory | type: boolean | description: Whether the phone input is required.  
     - name: address | type: AddressControl | description: Single-line or full address input control.  
        - name: labels | type: Labels | description: Address control labels for each input.  
           - name: addressLine | type: string | description: Single-line address input label.  | validation: maxLength 100
           - name: country | type: string | description: Country input label.  | validation: maxLength 100
           - name: subdivision | type: string | description: Subdivision input label.  | validation: maxLength 100
           - name: city | type: string | description: City input label.  | validation: maxLength 100
           - name: postalCode | type: string | description: Postal code input label.  | validation: maxLength 100
           - name: streetAddress | type: string | description: Street address input label.  | validation: maxLength 100
        - name: full | type: boolean | description: Whether an address is multi-line (consisting of multiple fields such as country, city, postal code). When `false`, address is single-line.  
        - name: mandatory | type: boolean | description: Whether the address input is required.  
     - name: date | type: DateControl | description: Day, month, year date input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 100
        - name: mandatory | type: boolean | description: Whether the date input is required.  
     - name: additionalGuests | type: AdditionalGuestsControl | description: Additional guests input control.  
        - name: labels | type: Labels | description: Additional guests control labels for each input.  
           - name: single | type: string | description: Input label for a single guest.  | validation: maxLength 200
           - name: multiple | type: string | description: Input label for multiple guests.  | validation: maxLength 200
        - name: namesMandatory | type: boolean | description: Whether the individual guest names are required.  
        - name: maxGuests | type: integer | description: Maximum number of additional guests.  | validation: minimum 1, maximum 10
     - name: dropdown | type: DropdownControl | description: Single-choice dropdown style input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 200
        - name: options | type: array<string> | description: Predefined options guests can choose from.  | validation: minItems 2, maxItems 200, maxLength 200
        - name: mandatory | type: boolean | description: Whether a choice is required.  
        - name: defaultOptionSelection | type: OptionSelection | description: Default option initially selected when an input has multiple choices.  Defaults to first (0th) option, if not configured.  
           - 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: checkbox | type: CheckboxControl | description: Multiple-choice checkbox style input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 200
        - name: mandatory | type: boolean | description: Whether at least one checkbox is required.  
        - name: options | type: array<string> | description: Predefined options guests can choose from.  | validation: minItems 1, maxItems 200, maxLength 200
     - name: text | type: TextControl | description: Free-form text input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 200
        - name: mandatory | type: boolean | description: Whether a text input is required.  
        - name: maxLength | type: integer | description: Maximum number of characters allowed.  | validation: minimum 0, maximum 1000
        - name: multiLine | type: boolean | description: Whether the input control should allow multiple lines in text.  
        - name: comment | type: boolean | description: Whether the input control should be displayed as a comment.  
     - name: name | type: NameControl | description: Main guest name input control.  
        - name: labels | type: Labels | description: Name control labels of each input.  
           - name: firstName | type: string | description: First name input label.  | validation: maxLength 100
           - name: lastName | type: string | description: Last name input label .  | validation: maxLength 100
     - name: email | type: EmailControl | description: Main guest email input control.  
        - name: label | type: string | description: Email input label.  | validation: maxLength 100
     - name: radioButton | type: RadioButtonControl | description: Single-choice radio style input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 200
        - name: options | type: array<string> | description: Predefined options guests can choose from.  | validation: minItems 2, maxItems 200, maxLength 200
   param name: orderIndex | type: orderIndex | description: Index used to sort input controls in ascending order.  
 Return type: UpdateControlResponse
  - 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.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_EVENT_CONFIGURATION | Description: The control configuration is invalid for this event.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CONTROL_NOT_FOUND | Description: Couldn't find the control.


```

### Examples

### UpdateControl
```curl
~~~cURL
curl -X PUT 'https://www.wixapis.com/events/v1/events/ad18d12e-a6a9-4c17-abfa-6ff119479be2/form/controls/phone-1a4acde6c958ff66' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH TOKEN>' \
-d '{
  "eventId": "ad18d12e-a6a9-4c17-abfa-6ff119479be2",
  "orderIndex": 3,
  "phone": {
    "mandatory": false,
    "label": "Work phone (line)"
  }
}'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.forms.updateControl(identifiers, options)
 Description: Updates an existing input control in the form. The applied changes trigger form publishing.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  identifiers.eventId, identifiers._id, identifiers, options
 Method parameters: 
   param name: identifiers | type: UpdateControlIdentifiers  none | required: true 
        - name: eventId | type: string | description: Event GUID to which the form belongs. | required: true | validation: format GUID
        - name: _id | type: string | description: Unique input control GUID. | required: true 
   param name: options | type: UpdateControlOptions  none | required: true 
    - ONE-OF: - required: true
     - name: phone | type: PhoneControl | description: Phone number input control.  
        - name: label | type: string | description: Phone input label.  | validation: maxLength 100
        - name: mandatory | type: boolean | description: Whether the phone input is required.  
     - name: address | type: AddressControl | description: Single-line or full address input control.  
        - name: labels | type: Labels | description: Address control labels for each input.  
           - name: addressLine | type: string | description: Single-line address input label.  | validation: maxLength 100
           - name: country | type: string | description: Country input label.  | validation: maxLength 100
           - name: subdivision | type: string | description: Subdivision input label.  | validation: maxLength 100
           - name: city | type: string | description: City input label.  | validation: maxLength 100
           - name: postalCode | type: string | description: Postal code input label.  | validation: maxLength 100
           - name: streetAddress | type: string | description: Street address input label.  | validation: maxLength 100
        - name: full | type: boolean | description: Whether an address is multi-line (consisting of multiple fields such as country, city, postal code). When `false`, address is single-line.  
        - name: mandatory | type: boolean | description: Whether the address input is required.  
     - name: date | type: DateControl | description: Day, month, year date input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 100
        - name: mandatory | type: boolean | description: Whether the date input is required.  
     - name: additionalGuests | type: AdditionalGuestsControl | description: Additional guests input control.  
        - name: labels | type: Labels | description: Additional guests control labels for each input.  
           - name: single | type: string | description: Input label for a single guest.  | validation: maxLength 200
           - name: multiple | type: string | description: Input label for multiple guests.  | validation: maxLength 200
        - name: namesMandatory | type: boolean | description: Whether the individual guest names are required.  
        - name: maxGuests | type: integer | description: Maximum number of additional guests.  | validation: minimum 1, maximum 10
     - name: dropdown | type: DropdownControl | description: Single-choice dropdown style input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 200
        - name: options | type: array<string> | description: Predefined options guests can choose from.  | validation: minItems 2, maxItems 200, maxLength 200
        - name: mandatory | type: boolean | description: Whether a choice is required.  
        - name: defaultOptionSelection | type: OptionSelection | description: Default option initially selected when an input has multiple choices.  Defaults to first (0th) option, if not configured.  
           - 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: checkbox | type: CheckboxControl | description: Multiple-choice checkbox style input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 200
        - name: mandatory | type: boolean | description: Whether at least one checkbox is required.  
        - name: options | type: array<string> | description: Predefined options guests can choose from.  | validation: minItems 1, maxItems 200, maxLength 200
     - name: text | type: TextControl | description: Free-form text input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 200
        - name: mandatory | type: boolean | description: Whether a text input is required.  
        - name: maxLength | type: integer | description: Maximum number of characters allowed.  | validation: minimum 0, maximum 1000
        - name: multiLine | type: boolean | description: Whether the input control should allow multiple lines in text.  
        - name: comment | type: boolean | description: Whether the input control should be displayed as a comment.  
     - name: name | type: NameControl | description: Main guest name input control.  
        - name: labels | type: Labels | description: Name control labels of each input.  
           - name: firstName | type: string | description: First name input label.  | validation: maxLength 100
           - name: lastName | type: string | description: Last name input label .  | validation: maxLength 100
     - name: email | type: EmailControl | description: Main guest email input control.  
        - name: label | type: string | description: Email input label.  | validation: maxLength 100
     - name: radioButton | type: RadioButtonControl | description: Single-choice radio style input control.  
        - name: label | type: string | description: Input control label.  | validation: maxLength 200
        - name: options | type: array<string> | description: Predefined options guests can choose from.  | validation: minItems 2, maxItems 200, maxLength 200
        - name: orderIndex | type: integer | description: Index used to sort input controls in ascending order.  
 Return type: PROMISE<UpdateControlResponse>
  - 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.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_EVENT_CONFIGURATION | Description: The control configuration is invalid for this event.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CONTROL_NOT_FOUND | Description: Couldn't find the control.


```

### Examples

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

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

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

async function myUpdateControlMethod(identifiers,options) {
  const elevatedUpdateControl = auth.elevate(forms.updateControl);
  const response = await elevatedUpdateControl(identifiers,options);
}
```

### updateControl (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 updateControl(identifiers,options) {
  const response = await myWixClient.forms.updateControl(identifiers,options);
};
```

---