> 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

# BulkUpdateIntakeForms

# Package: contentCollector

# Namespace: IntakeForms

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

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

## Introduction

Updates multiple intake forms in a single request.

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

Set `returnEntity` to `true` to include the updated intake forms in the
response.

To update a single intake form, call [Update Intake Form](https://dev.wix.com/docs/api-reference/account-level/partners/content-collector/intake-form-v1/update-intake-form.md).

---

## REST API

### Schema

```
 Method: bulkUpdateIntakeForms
 Description: Updates multiple intake forms in a single request.  Each time an intake form is updated, its `revision` increments by 1. The current `revision` must be passed for each intake form. This ensures you're working with the latest intake form and prevents unintended overwrites.  Set `returnEntity` to `true` to include the updated intake forms in the response.  To update a single intake form, call [Update Intake Form](https://dev.wix.com/docs/api-reference/account-level/partners/content-collector/intake-form-v1/update-intake-form.md).
 URL: https://www.wixapis.com/partners/content-collector/v1/intake-forms/v1/bulk/intake-forms/update
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  intakeForms, intakeForms.intakeForm.id, intakeForms.intakeForm.revision
 Method parameters: 
   param name: fields | type: array<fields> | description: Fields to include in the response.  | validation: maxItems 5
                 - enum: CONTEXT, SOURCE_MATERIALS
   param name: intakeForms | type: array<intakeForms> | description: List of IntakeForms to be updated. | required: true | validation: minItems 1, maxItems 100
              - name: intakeForm | type: IntakeForm | description: IntakeForm to be updated, may be partial  
                 - name: id | type: string | description: Intake form GUID. | required: 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 | validation: format int64
                 - name: context | type: string | description: AI-generated background context for the intake form, stored as free-form text. Used as input when generating the questionnaire; stored and returned as-is and not otherwise interpreted by this service. Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647
                 - name: clientName | type: string | description: Client name.  | validation: maxLength 42
                 - name: project | type: Project | description: Project information.  
                    - name: name | type: string | description: Project name.  | validation: maxLength 255
                    - name: industry | type: Industry | description: Industry vertical.  
                             - enum: RESTAURANT, TECHNOLOGY, TRAVEL_AND_TOURISM, WELLNESS, FITNESS, CONSULTING, FOOD_AND_BEVERAGE, EDUCATION, HEALTHCARE, REAL_ESTATE, OTHER
                 - name: sourceMaterials | type: SourceMaterials | description: Source materials used as input for AI generation.  
                    - name: projectMaterials | type: string | description: User-provided project description used as input for AI generation.  | validation: maxLength 2147483647
                    - name: filesMarkdown | type: string | description: Markdown rendering of the files uploaded by the user, used as input for AI generation.  | validation: maxLength 2147483647
                    - name: existingQuestionnaire | type: string | description: Existing questionnaire provided by the user, used as input for AI generation.  | validation: maxLength 2147483647
                 - name: teamMemberIds | type: array<string> | description: IDs of the team members to notify about the 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 form is shared with. Adding the first email shares the form and stamps `publishDate`; removing all emails clears `publishDate` (see `publishDate`). A client can retrieve the form through `GetClientIntakeForm` only if their email is listed here.  | validation: maxItems 20, format EMAIL
                 - name: customFields | type: object | description: Free-form custom data stored verbatim with the intake form. Accepts any JSON structure, isn't interpreted or validated by the service, and is returned as-is. Use it to attach your own structured data to an intake form.  
   param name: returnEntity | type: returnEntity | description: set to `true` if you wish to receive back the updated IntakeForms in the response  
 Return type: BulkUpdateIntakeFormsResponse
  - name: results | type: array<BulkIntakeFormResult> | description: Results  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata regarding the specific single update operation  
        - name: id | type: string | description: Item GUID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.  | validation: format GUID
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  | validation: minimum 0
        - name: success | type: boolean | description: Whether the requested action for this item was successful. When `false`, the `error` field is returned.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: item | type: IntakeForm | description: Only exists if `returnEntity` was set to true in the request  
        - name: id | type: string | description: Intake form GUID.  | 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.  | validation: format int64
        - name: createdDate | type: string | description: Date and time the IntakeForm was created.  | validation: format date-time
        - name: updatedDate | type: string | description: Date and time the IntakeForm was last updated.  | validation: format date-time
        - name: context | type: string | description: AI-generated background context for the intake form, stored as free-form text. Used as input when generating the questionnaire; stored and returned as-is and not otherwise interpreted by this service. Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647
        - name: clientName | type: string | description: Client name.  | validation: maxLength 42
        - name: project | type: Project | description: Project information.  
           - name: name | type: string | description: Project name.  | validation: maxLength 255
           - name: industry | type: Industry | description: Industry vertical.  
                 - enum: RESTAURANT, TECHNOLOGY, TRAVEL_AND_TOURISM, WELLNESS, FITNESS, CONSULTING, FOOD_AND_BEVERAGE, EDUCATION, HEALTHCARE, REAL_ESTATE, OTHER
        - name: userId | type: string | description: Owner user GUID.  | validation: format GUID
        - name: sourceMaterials | type: SourceMaterials | description: Source materials used as input for AI generation.  
           - name: projectMaterials | type: string | description: User-provided project description used as input for AI generation.  | validation: maxLength 2147483647
           - name: filesMarkdown | type: string | description: Markdown rendering of the files uploaded by the user, used as input for AI generation.  | validation: maxLength 2147483647
           - name: existingQuestionnaire | type: string | description: Existing questionnaire provided by the user, used as input for AI generation.  | validation: maxLength 2147483647
        - name: submission | type: Submission | description: Submission state of the form. Populated asynchronously from Wix Forms submission events once the client submits, so these fields may be empty until a submission has been received and processed.  
           - name: submittedDate | type: string | description: Date and time the client submitted the form.  | validation: format date-time
           - name: lastEditDate | type: string | description: Date and time the client last edited the form.  | validation: format date-time
        - name: accountId | type: string | description: Account GUID.  | validation: format GUID
        - name: teamMemberIds | type: array<string> | description: IDs of the team members to notify about the 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 form is shared with. Adding the first email shares the form and stamps `publishDate`; removing all emails clears `publishDate` (see `publishDate`). A client can retrieve the form through `GetClientIntakeForm` only if their email is listed here.  | validation: maxItems 20, format EMAIL
        - name: customFields | type: object | description: Free-form custom data stored verbatim with the intake form. Accepts any JSON structure, isn't interpreted or validated by the service, 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 form was first shared with clients (the first time client emails were added). Cleared if all client emails are removed; re-stamped if client emails are added again.  | validation: format date-time
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata regarding the bulk update operation  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  | validation: minimum 0
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  | validation: minimum 0
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  | validation: minimum 0


```

### Examples

### Bulk Update Intake Forms
Updates multiple intake forms in a single request

```curl
curl -X POST \
  'https://www.wixapis.com/intake-forms/v1/bulk/intake-forms/update' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "intakeForms": [
      { "intakeForm": { "id": "8046df3c-7575-4098-a5ab-c91ad8f33c47", "revision": "1", "clientEmails": ["jane@bloombakery.com"] } }
    ],
    "returnEntity": false
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.contentCollectorIntakeForms.contentCollectorIntakeForms.bulkUpdateIntakeForms(intakeForms, options)
 Description: Updates multiple intake forms in a single request.  Each time an intake form is updated, its `revision` increments by 1. The current `revision` must be passed for each intake form. This ensures you're working with the latest intake form and prevents unintended overwrites.  Set `returnEntity` to `true` to include the updated intake forms in the response.  To update a single intake form, call [Update Intake Form](https://dev.wix.com/docs/api-reference/account-level/partners/content-collector/intake-form-v1/update-intake-form.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  intakeForms, intakeForms.intakeForm._id, intakeForms.intakeForm.revision
 Method parameters: 
   param name: intakeForms | type: array<array> | description: List of IntakeForms to be updated. | required: true | validation: minItems 1, maxItems 100
              - name: intakeForm | type: IntakeForm | description: IntakeForm to be updated, may be partial  
                 - name: _id | type: string | description: Intake form GUID. | required: 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 | validation: format int64
                 - name: context | type: string | description: AI-generated background context for the intake form, stored as free-form text. Used as input when generating the questionnaire; stored and returned as-is and not otherwise interpreted by this service. Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647
                 - name: clientName | type: string | description: Client name.  | validation: maxLength 42
                 - name: project | type: Project | description: Project information.  
                    - name: name | type: string | description: Project name.  | validation: maxLength 255
                    - name: industry | type: Industry | description: Industry vertical.  
                             - enum: RESTAURANT, TECHNOLOGY, TRAVEL_AND_TOURISM, WELLNESS, FITNESS, CONSULTING, FOOD_AND_BEVERAGE, EDUCATION, HEALTHCARE, REAL_ESTATE, OTHER
                 - name: sourceMaterials | type: SourceMaterials | description: Source materials used as input for AI generation.  
                    - name: projectMaterials | type: string | description: User-provided project description used as input for AI generation.  | validation: maxLength 2147483647
                    - name: filesMarkdown | type: string | description: Markdown rendering of the files uploaded by the user, used as input for AI generation.  | validation: maxLength 2147483647
                    - name: existingQuestionnaire | type: string | description: Existing questionnaire provided by the user, used as input for AI generation.  | validation: maxLength 2147483647
                 - name: teamMemberIds | type: array<string> | description: IDs of the team members to notify about the 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 form is shared with. Adding the first email shares the form and stamps `publishDate`; removing all emails clears `publishDate` (see `publishDate`). A client can retrieve the form through `GetClientIntakeForm` only if their email is listed here.  | validation: maxItems 20, format EMAIL
                 - name: customFields | type: object | description: Free-form custom data stored verbatim with the intake form. Accepts any JSON structure, isn't interpreted or validated by the service, and is returned as-is. Use it to attach your own structured data to an intake form.  
   param name: options | type: BulkUpdateIntakeFormsOptions  none  
        - name: returnEntity | type: boolean | description: set to `true` if you wish to receive back the updated IntakeForms in the response  
        - name: fields | type: array<RequestedFields> | description: Fields to include in the response.  | validation: maxItems 5
             - enum: CONTEXT, SOURCE_MATERIALS
 Return type: PROMISE<BulkUpdateIntakeFormsResponse>
  - name: results | type: array<BulkIntakeFormResult> | description: Results  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata regarding the specific single update operation  
        - name: _id | type: string | description: Item GUID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.  | validation: format GUID
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  | validation: minimum 0
        - name: success | type: boolean | description: Whether the requested action for this item was successful. When `false`, the `error` field is returned.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: item | type: IntakeForm | description: Only exists if `returnEntity` was set to true in the request  
        - name: _id | type: string | description: Intake form GUID.  | 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.  | validation: format int64
        - name: _createdDate | type: Date | description: Date and time the IntakeForm was created.  
        - name: _updatedDate | type: Date | description: Date and time the IntakeForm was last updated.  
        - name: context | type: string | description: AI-generated background context for the intake form, stored as free-form text. Used as input when generating the questionnaire; stored and returned as-is and not otherwise interpreted by this service. Returned only when `CONTEXT` is included in the request's `fields`.  | validation: maxLength 2147483647
        - name: clientName | type: string | description: Client name.  | validation: maxLength 42
        - name: project | type: Project | description: Project information.  
           - name: name | type: string | description: Project name.  | validation: maxLength 255
           - name: industry | type: Industry | description: Industry vertical.  
                 - enum: RESTAURANT, TECHNOLOGY, TRAVEL_AND_TOURISM, WELLNESS, FITNESS, CONSULTING, FOOD_AND_BEVERAGE, EDUCATION, HEALTHCARE, REAL_ESTATE, OTHER
        - name: userId | type: string | description: Owner user GUID.  | validation: format GUID
        - name: sourceMaterials | type: SourceMaterials | description: Source materials used as input for AI generation.  
           - name: projectMaterials | type: string | description: User-provided project description used as input for AI generation.  | validation: maxLength 2147483647
           - name: filesMarkdown | type: string | description: Markdown rendering of the files uploaded by the user, used as input for AI generation.  | validation: maxLength 2147483647
           - name: existingQuestionnaire | type: string | description: Existing questionnaire provided by the user, used as input for AI generation.  | validation: maxLength 2147483647
        - name: submission | type: Submission | description: Submission state of the form. Populated asynchronously from Wix Forms submission events once the client submits, so these fields may be empty until a submission has been received and processed.  
           - name: submittedDate | type: Date | description: Date and time the client submitted the form.  
           - name: lastEditDate | type: Date | description: Date and time the client last edited the form.  
        - name: accountId | type: string | description: Account GUID.  | validation: format GUID
        - name: teamMemberIds | type: array<string> | description: IDs of the team members to notify about the 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 form is shared with. Adding the first email shares the form and stamps `publishDate`; removing all emails clears `publishDate` (see `publishDate`). A client can retrieve the form through `GetClientIntakeForm` only if their email is listed here.  | validation: maxItems 20, format EMAIL
        - name: customFields | type: object | description: Free-form custom data stored verbatim with the intake form. Accepts any JSON structure, isn't interpreted or validated by the service, 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 form was first shared with clients (the first time client emails were added). Cleared if all client emails are removed; re-stamped if client emails are added again.  
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata regarding the bulk update operation  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  | validation: minimum 0
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  | validation: minimum 0
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  | validation: minimum 0


```

### Examples

### Bulk update intake forms
Updates multiple intake forms in a single request

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

const intakeForms = [
  {
    intakeForm: {
      _id: "8046df3c-7575-4098-a5ab-c91ad8f33c47",
      revision: "1",
      clientEmails: ["jane@bloombakery.com"],
    },
  },
];

const options = {
  returnEntity: false,
};

async function bulkUpdateIntakeForms() {
  const response = await contentCollectorIntakeForms.bulkUpdateIntakeForms(
    intakeForms,
    options
  );
}

/* Promise resolves to:
 * {
 *   "results": [
 *     {
 *       "itemMetadata": {
 *         "id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
 *         "originalIndex": 0,
 *         "success": true
 *       }
 *     }
 *   ],
 *   "bulkActionMetadata": {
 *     "totalSuccesses": 1,
 *     "totalFailures": 0,
 *     "undetailedFailures": 0
 *   }
 * }
 */

```

### bulkUpdateIntakeForms (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 { 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 bulkUpdateIntakeForms(intakeForms,options) {
  const response = await myWixClient.contentCollectorIntakeForms.bulkUpdateIntakeForms(intakeForms,options);
};
```

---