> 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

# UpdateIntakeForm

# Package: contentCollector

# Namespace: IntakeForms

# Method link: https://dev.wix.com/docs/api-reference/account-level/studio-workspace/content-collector/intake-form-v1/update-intake-form.md

## Permission Scopes:
SCOPE.PARTNERS.CONTENT-COLLECTOR: SCOPE.PARTNERS.CONTENT-COLLECTOR

## Introduction

Updates an intake form.

Each time the intake form is updated, `revision` increments by 1. The current
`revision` must be passed when updating the intake form. This ensures you're
working with the latest intake form and prevents unintended overwrites.

Only the fields included in `fieldMask.paths` are updated. You can't change
`language` after the intake form is created.

To share the form with a client, add their email address to `clientEmails`.
Adding the first email sets `publishDate`, and removing all emails clears it.
`publishDate` is set asynchronously, shortly after the update.

To update multiple intake forms in a single request, call [Bulk Update Intake Forms](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/content-collector/intake-form-v1/bulk-update-intake-forms.md).

---

## REST API

### Schema

```
 Method: updateIntakeForm
 Description: Updates an intake form.  Each time the intake form is updated, `revision` increments by 1. The current `revision` must be passed when updating the intake form. This ensures you're working with the latest intake form and prevents unintended overwrites.  Only the fields included in `fieldMask.paths` are updated. You can't change `language` after the intake form is created.  To share the form with a client, add their email address to `clientEmails`. Adding the first email sets `publishDate`, and removing all emails clears it. `publishDate` is set asynchronously, shortly after the update.  To update multiple intake forms in a single request, call [Bulk Update Intake Forms](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/content-collector/intake-form-v1/bulk-update-intake-forms.md).
 URL: https://www.wixapis.com/partners/content-collector/v1/intake-forms/{intakeForm.id}
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  intakeForm, intakeForm.id, intakeForm.revision
 Method parameters: 
   param name: fields | type: array<fields> | description: Additional fields to return. By default, `context`, `sourceMaterials`, and `introData` aren't returned.  | validation: maxItems 5
                 - enum:
                 -     CONTEXT: Returns `context`.
                 -     SOURCE_MATERIALS: Returns `sourceMaterials`.
                 -     INTRO_DATA: Returns `introData`.
   param name: intakeForm | type: IntakeForm | description: An intake form gathers project information from a partner's client. It wraps a questionnaire with project context, the source materials used to tailor that questionnaire, the clients the form is shared with, and the client's submission state.  The questionnaire is generated with AI the first time the form is opened, and the resulting `context` is stored on the intake form. This API stores the generated content but doesn't perform the generation itself. | required: true 
        - name: id | type: string | description: Intake form GUID. | required: true | read-only: true | validation: format GUID
        - name: revision | type: string | description: Revision number, which increments by 1 each time the intake form is updated. To prevent conflicting changes, the current revision must be passed when updating the intake form.  Ignored when creating an intake form. | required: true | read-only: true | validation: format int64
        - name: context | type: string | description: AI-generated background context for the intake form, in free-form text. Used to tailor the questionnaire. Stored and returned as is.  Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647
        - name: clientName | type: string | description: Name of the client the intake form is for.  | validation: maxLength 42
        - name: project | type: Project | description: Client project the intake form collects content for.  
           - name: name | type: string | description: Project name.  | validation: maxLength 255
           - name: industry | type: Industry | description: Industry the project belongs to.  
                 - enum: BEAUTY_AND_WELLNESS, CREATIVE, EDUCATION, FIELD_AND_CONSTRUCTION, FITNESS, HEALTH, FOOD_AND_BEVERAGE, NON_PROFIT_AND_COMMUNITIES, REAL_ESTATE, SCIENCE_AND_TECHNOLOGY, TRAVEL_AND_TOURISM, CONSULTING_AND_MARKETING, LEGAL_AND_FINANCE, FASHION_AND_APPAREL, ENTERTAINMENT, RESTAURANT, TECHNOLOGY, WELLNESS, CONSULTING, HEALTHCARE, OTHER
        - name: sourceMaterials | type: SourceMaterials | description: Partner-provided materials used to generate the questionnaire.  Returned only when `SOURCE_MATERIALS` is included in the request's `fields`.  
           - name: projectMaterials | type: string | description: Project description provided by the partner.  | validation: maxLength 2147483647
           - name: filesMarkdown | type: string | description: Content of the files the partner uploaded, converted to Markdown.  | validation: maxLength 2147483647
           - name: existingQuestionnaire | type: string | description: Existing questionnaire provided by the partner.  | validation: maxLength 2147483647
        - name: teamMemberIds | type: array<string> | description: IDs of the team members to notify about the intake form. Listed team members are notified through Wix Automations when the client submits the form or adds a note to it.  | validation: maxItems 50, format GUID
        - name: clientEmails | type: array<string> | description: Email addresses of the clients the intake form is shared with. A client must sign in with one of these email addresses to open the form.  Adding the first email address shares the form and sets `publishDate`. Removing all email addresses clears `publishDate`.  | validation: maxItems 20, format EMAIL
        - name: customFields | type: object | description: Custom data to store with the intake form. Accepts any JSON structure, isn't validated, and is returned as is. Use it to attach your own structured data to an intake form.  
        - name: introData | type: IntroData | description: Title and message shown to the client on the intro screen, before they sign in.  Returned only when `INTRO_DATA` is included in the request's `fields`.  
           - name: title | type: string | description: Welcome headline shown at the top of the intro screen.  When not set, the client sees the default headline. An empty string shows no headline.  | validation: maxLength 120
           - name: message | type: string | description: Welcome message shown on the intro screen, in rich-text HTML.  | validation: maxLength 2147483647
        - name: language | type: string | description: Language of the form's content and client experience, as a 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. For example, `en`, `de`, or `ja`.  Can be set only when the intake form is created.  Default: `en`  | validation: format LANGUAGE, immutable
 Return type: UpdateIntakeFormResponse
  - name: intakeForm | type: IntakeForm | description: Updated intake form.  
     - name: id | type: string | description: Intake form GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the intake form is updated. To prevent conflicting changes, the current revision must be passed when updating the intake form.  Ignored when creating an intake form.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the intake form was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the intake form was last updated.  | read-only: true | validation: format date-time
     - name: context | type: string | description: AI-generated background context for the intake form, in free-form text. Used to tailor the questionnaire. Stored and returned as is.  Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647
     - name: clientName | type: string | description: Name of the client the intake form is for.  | validation: maxLength 42
     - name: project | type: Project | description: Client project the intake form collects content for.  
        - name: name | type: string | description: Project name.  | validation: maxLength 255
        - name: industry | type: Industry | description: Industry the project belongs to.  
             - enum: BEAUTY_AND_WELLNESS, CREATIVE, EDUCATION, FIELD_AND_CONSTRUCTION, FITNESS, HEALTH, FOOD_AND_BEVERAGE, NON_PROFIT_AND_COMMUNITIES, REAL_ESTATE, SCIENCE_AND_TECHNOLOGY, TRAVEL_AND_TOURISM, CONSULTING_AND_MARKETING, LEGAL_AND_FINANCE, FASHION_AND_APPAREL, ENTERTAINMENT, RESTAURANT, TECHNOLOGY, WELLNESS, CONSULTING, HEALTHCARE, OTHER
     - name: userId | type: string | description: GUID of the user who owns the intake form. Set automatically from the caller's identity when the intake form is created.  | read-only: true | validation: format GUID
     - name: sourceMaterials | type: SourceMaterials | description: Partner-provided materials used to generate the questionnaire.  Returned only when `SOURCE_MATERIALS` is included in the request's `fields`.  
        - name: projectMaterials | type: string | description: Project description provided by the partner.  | validation: maxLength 2147483647
        - name: filesMarkdown | type: string | description: Content of the files the partner uploaded, converted to Markdown.  | validation: maxLength 2147483647
        - name: existingQuestionnaire | type: string | description: Existing questionnaire provided by the partner.  | validation: maxLength 2147483647
     - name: clientFormInteraction | type: ClientFormInteraction | description: The client's interaction with the form: when they last edited it and when they submitted it. The form is considered submitted only when `clientFormInteraction.submissionDate` is set.  Updated asynchronously after the client edits or submits the form, so it may be empty for a short time afterward.  | read-only: true 
        - name: submissionDate | type: string | description: Date and time the client submitted the form. The form is considered submitted only when this field is set.  | read-only: true | validation: format date-time
        - name: lastEditDate | type: string | description: Date and time the client last edited the form.  | read-only: true | validation: format date-time
     - name: accountId | type: string | description: GUID of the partner account that owns the intake form. Set automatically from the caller's identity when the intake form is created.  | read-only: true | validation: format GUID
     - name: teamMemberIds | type: array<string> | description: IDs of the team members to notify about the intake form. Listed team members are notified through Wix Automations when the client submits the form or adds a note to it.  | validation: maxItems 50, format GUID
     - name: clientEmails | type: array<string> | description: Email addresses of the clients the intake form is shared with. A client must sign in with one of these email addresses to open the form.  Adding the first email address shares the form and sets `publishDate`. Removing all email addresses clears `publishDate`.  | validation: maxItems 20, format EMAIL
     - name: customFields | type: object | description: Custom data to store with the intake form. Accepts any JSON structure, isn't validated, and is returned as is. Use it to attach your own structured data to an intake form.  
     - name: publishDate | type: string | description: Date and time the intake form was shared with clients, meaning when the first email address was added to `clientEmails`.  Cleared when all email addresses are removed from `clientEmails`, and set again when email addresses are added back. Set asynchronously, shortly after the change.  | read-only: true | validation: format date-time
     - name: introData | type: IntroData | description: Title and message shown to the client on the intro screen, before they sign in.  Returned only when `INTRO_DATA` is included in the request's `fields`.  
        - name: title | type: string | description: Welcome headline shown at the top of the intro screen.  When not set, the client sees the default headline. An empty string shows no headline.  | validation: maxLength 120
        - name: message | type: string | description: Welcome message shown on the intro screen, in rich-text HTML.  | validation: maxLength 2147483647
     - name: language | type: string | description: Language of the form's content and client experience, as a 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. For example, `en`, `de`, or `ja`.  Can be set only when the intake form is created.  Default: `en`  | validation: format LANGUAGE, immutable


```

### Examples

### Update Intake Form
Shares the form with a client by adding a client email

```curl
curl -X PATCH \
'https://www.wixapis.com/partners/content-collector/v1/intake-forms/8046df3c-7575-4098-a5ab-c91ad8f33c47' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "intakeForm": {
    "id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
    "revision": "1",
    "clientEmails": ["jane@bloombakery.com"]
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.contentCollectorIntakeForms.contentCollectorIntakeForms.updateIntakeForm(_id, intakeForm, options)
 Description: Updates an intake form.  Each time the intake form is updated, `revision` increments by 1. The current `revision` must be passed when updating the intake form. This ensures you're working with the latest intake form and prevents unintended overwrites.  Only the fields included in `fieldMask.paths` are updated. You can't change `language` after the intake form is created.  To share the form with a client, add their email address to `clientEmails`. Adding the first email sets `publishDate`, and removing all emails clears it. `publishDate` is set asynchronously, shortly after the update.  To update multiple intake forms in a single request, call [Bulk Update Intake Forms](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/content-collector/intake-form-v1/bulk-update-intake-forms.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  intakeForm, _id, intakeForm.revision
 Method parameters: 
   param name: _id | type: string | description: Intake form GUID. | required: true | validation: format GUID
   param name: intakeForm | type: UpdateIntakeForm | description: An intake form gathers project information from a partner's client. It wraps a questionnaire with project context, the source materials used to tailor that questionnaire, the clients the form is shared with, and the client's submission state.  The questionnaire is generated with AI the first time the form is opened, and the resulting `context` is stored on the intake form. This API stores the generated content but doesn't perform the generation itself. | required: true 
        - name: revision | type: string | description: Revision number, which increments by 1 each time the intake form is updated. To prevent conflicting changes, the current revision must be passed when updating the intake form.  Ignored when creating an intake form. | required: true | read-only: true | validation: format int64
        - name: context | type: string | description: AI-generated background context for the intake form, in free-form text. Used to tailor the questionnaire. Stored and returned as is.  Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647
        - name: clientName | type: string | description: Name of the client the intake form is for.  | validation: maxLength 42
        - name: project | type: Project | description: Client project the intake form collects content for.  
           - name: name | type: string | description: Project name.  | validation: maxLength 255
           - name: industry | type: Industry | description: Industry the project belongs to.  
                 - enum: BEAUTY_AND_WELLNESS, CREATIVE, EDUCATION, FIELD_AND_CONSTRUCTION, FITNESS, HEALTH, FOOD_AND_BEVERAGE, NON_PROFIT_AND_COMMUNITIES, REAL_ESTATE, SCIENCE_AND_TECHNOLOGY, TRAVEL_AND_TOURISM, CONSULTING_AND_MARKETING, LEGAL_AND_FINANCE, FASHION_AND_APPAREL, ENTERTAINMENT, RESTAURANT, TECHNOLOGY, WELLNESS, CONSULTING, HEALTHCARE, OTHER
        - name: sourceMaterials | type: SourceMaterials | description: Partner-provided materials used to generate the questionnaire.  Returned only when `SOURCE_MATERIALS` is included in the request's `fields`.  
           - name: projectMaterials | type: string | description: Project description provided by the partner.  | validation: maxLength 2147483647
           - name: filesMarkdown | type: string | description: Content of the files the partner uploaded, converted to Markdown.  | validation: maxLength 2147483647
           - name: existingQuestionnaire | type: string | description: Existing questionnaire provided by the partner.  | validation: maxLength 2147483647
        - name: teamMemberIds | type: array<string> | description: IDs of the team members to notify about the intake form. Listed team members are notified through Wix Automations when the client submits the form or adds a note to it.  | validation: maxItems 50, format GUID
        - name: clientEmails | type: array<string> | description: Email addresses of the clients the intake form is shared with. A client must sign in with one of these email addresses to open the form.  Adding the first email address shares the form and sets `publishDate`. Removing all email addresses clears `publishDate`.  | validation: maxItems 20, format EMAIL
        - name: customFields | type: object | description: Custom data to store with the intake form. Accepts any JSON structure, isn't validated, and is returned as is. Use it to attach your own structured data to an intake form.  
        - name: introData | type: IntroData | description: Title and message shown to the client on the intro screen, before they sign in.  Returned only when `INTRO_DATA` is included in the request's `fields`.  
           - name: title | type: string | description: Welcome headline shown at the top of the intro screen.  When not set, the client sees the default headline. An empty string shows no headline.  | validation: maxLength 120
           - name: message | type: string | description: Welcome message shown on the intro screen, in rich-text HTML.  | validation: maxLength 2147483647
        - name: language | type: string | description: Language of the form's content and client experience, as a 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. For example, `en`, `de`, or `ja`.  Can be set only when the intake form is created.  Default: `en`  | validation: format LANGUAGE, immutable
   param name: options | type: UpdateIntakeFormOptions  none  
        - name: fields | type: array<RequestedFields> | description: Additional fields to return. By default, `context`, `sourceMaterials`, and `introData` aren't returned.  | validation: maxItems 5
             - enum:
             -     CONTEXT: Returns `context`.
             -     SOURCE_MATERIALS: Returns `sourceMaterials`.
             -     INTRO_DATA: Returns `introData`.
 Return type: PROMISE<IntakeForm>
  - name: _id | type: string | description: Intake form GUID.  | read-only: true | validation: format GUID
  - name: revision | type: string | description: Revision number, which increments by 1 each time the intake form is updated. To prevent conflicting changes, the current revision must be passed when updating the intake form.  Ignored when creating an intake form.  | read-only: true | validation: format int64
  - name: _createdDate | type: Date | description: Date and time the intake form was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the intake form was last updated.  | read-only: true 
  - name: context | type: string | description: AI-generated background context for the intake form, in free-form text. Used to tailor the questionnaire. Stored and returned as is.  Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647
  - name: clientName | type: string | description: Name of the client the intake form is for.  | validation: maxLength 42
  - name: project | type: Project | description: Client project the intake form collects content for.  
     - name: name | type: string | description: Project name.  | validation: maxLength 255
     - name: industry | type: Industry | description: Industry the project belongs to.  
         - enum: BEAUTY_AND_WELLNESS, CREATIVE, EDUCATION, FIELD_AND_CONSTRUCTION, FITNESS, HEALTH, FOOD_AND_BEVERAGE, NON_PROFIT_AND_COMMUNITIES, REAL_ESTATE, SCIENCE_AND_TECHNOLOGY, TRAVEL_AND_TOURISM, CONSULTING_AND_MARKETING, LEGAL_AND_FINANCE, FASHION_AND_APPAREL, ENTERTAINMENT, RESTAURANT, TECHNOLOGY, WELLNESS, CONSULTING, HEALTHCARE, OTHER
  - name: userId | type: string | description: GUID of the user who owns the intake form. Set automatically from the caller's identity when the intake form is created.  | read-only: true | validation: format GUID
  - name: sourceMaterials | type: SourceMaterials | description: Partner-provided materials used to generate the questionnaire.  Returned only when `SOURCE_MATERIALS` is included in the request's `fields`.  
     - name: projectMaterials | type: string | description: Project description provided by the partner.  | validation: maxLength 2147483647
     - name: filesMarkdown | type: string | description: Content of the files the partner uploaded, converted to Markdown.  | validation: maxLength 2147483647
     - name: existingQuestionnaire | type: string | description: Existing questionnaire provided by the partner.  | validation: maxLength 2147483647
  - name: clientFormInteraction | type: ClientFormInteraction | description: The client's interaction with the form: when they last edited it and when they submitted it. The form is considered submitted only when `clientFormInteraction.submissionDate` is set.  Updated asynchronously after the client edits or submits the form, so it may be empty for a short time afterward.  | read-only: true 
     - name: submissionDate | type: Date | description: Date and time the client submitted the form. The form is considered submitted only when this field is set.  | read-only: true 
     - name: lastEditDate | type: Date | description: Date and time the client last edited the form.  | read-only: true 
  - name: accountId | type: string | description: GUID of the partner account that owns the intake form. Set automatically from the caller's identity when the intake form is created.  | read-only: true | validation: format GUID
  - name: teamMemberIds | type: array<string> | description: IDs of the team members to notify about the intake form. Listed team members are notified through Wix Automations when the client submits the form or adds a note to it.  | validation: maxItems 50, format GUID
  - name: clientEmails | type: array<string> | description: Email addresses of the clients the intake form is shared with. A client must sign in with one of these email addresses to open the form.  Adding the first email address shares the form and sets `publishDate`. Removing all email addresses clears `publishDate`.  | validation: maxItems 20, format EMAIL
  - name: customFields | type: object | description: Custom data to store with the intake form. Accepts any JSON structure, isn't validated, and is returned as is. Use it to attach your own structured data to an intake form.  
  - name: publishDate | type: Date | description: Date and time the intake form was shared with clients, meaning when the first email address was added to `clientEmails`.  Cleared when all email addresses are removed from `clientEmails`, and set again when email addresses are added back. Set asynchronously, shortly after the change.  | read-only: true 
  - name: introData | type: IntroData | description: Title and message shown to the client on the intro screen, before they sign in.  Returned only when `INTRO_DATA` is included in the request's `fields`.  
     - name: title | type: string | description: Welcome headline shown at the top of the intro screen.  When not set, the client sees the default headline. An empty string shows no headline.  | validation: maxLength 120
     - name: message | type: string | description: Welcome message shown on the intro screen, in rich-text HTML.  | validation: maxLength 2147483647
  - name: language | type: string | description: Language of the form's content and client experience, as a 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. For example, `en`, `de`, or `ja`.  Can be set only when the intake form is created.  Default: `en`  | validation: format LANGUAGE, immutable


```

### Examples

### Update an intake form
Shares the form with a client by adding a client email

```javascript
import { contentCollectorIntakeForms } from "@wix/content-collector-intake-forms";

async function updateIntakeForm() {
  const response = await contentCollectorIntakeForms.updateIntakeForm(
    "8046df3c-7575-4098-a5ab-c91ad8f33c47",
    {
      revision: "1",
      clientEmails: ["jane@bloombakery.com"],
    }
  );
}

/* Promise resolves to:
 * {
 *   "_id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
 *   "revision": "2",
 *   "_createdDate": "2024-03-18T17:22:10.299Z",
 *   "_updatedDate": "2024-03-19T09:14:02.118Z",
 *   "clientName": "Jane Cohen",
 *   "project": {
 *     "name": "Bloom Bakery Website",
 *     "industry": "FOOD_AND_BEVERAGE"
 *   },
 *   "clientEmails": ["jane@bloombakery.com"],
 *   "userId": "3f9c2e71-8a4b-4d6e-b5c0-7e1d9a2f4c86",
 *   "accountId": "c42e8b19-6d3a-4f75-9e0b-5a81d7c3f2e4"
 * }
 */

```

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

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


async function updateIntakeForm(_id,intakeForm,options) {
  const response = await myWixClient.contentCollectorIntakeForms.updateIntakeForm(_id,intakeForm,options);
};
```

---