> 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

# GetIntakeForm

# Package: contentCollector

# Namespace: IntakeForms

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

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

## Introduction

Retrieves an intake form by ID.

Returns only intake forms in the caller's account. A valid ID belonging to
another account reads as not found.

By default, `context` and `sourceMaterials` aren't returned. To retrieve them,
include `CONTEXT` or `SOURCE_MATERIALS` in `fields`.

---

## REST API

### Schema

```
 Method: getIntakeForm
 Description: Retrieves an intake form by GUID.  Returns only intake forms in the caller's account. A valid GUID belonging to another account reads as not found.  By default, `context` and `sourceMaterials` aren't returned. To retrieve them, include `CONTEXT` or `SOURCE_MATERIALS` in `fields`.
 URL: https://www.wixapis.com/partners/content-collector/v1/intake-forms/{intakeFormId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  intakeFormId
 Method parameters: 
   query param name: fields | type: array<fields> | description: Fields to include in the response.  | validation: maxItems 5
                 - enum: CONTEXT, SOURCE_MATERIALS
   param name: intakeFormId | type:   none | required: true 
 Return type: GetIntakeFormResponse
  - name: intakeForm | type: IntakeForm | description: The requested IntakeForm.  
     - 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


```

### Examples

### Get Intake Form
Retrieves an intake form by ID, including its AI-generated context

```curl
curl -X GET \
  'https://www.wixapis.com/intake-forms/v1/intake-forms/8046df3c-7575-4098-a5ab-c91ad8f33c47?fields=CONTEXT' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.contentCollectorIntakeForms.contentCollectorIntakeForms.getIntakeForm(intakeFormId, options)
 Description: Retrieves an intake form by GUID.  Returns only intake forms in the caller's account. A valid GUID belonging to another account reads as not found.  By default, `context` and `sourceMaterials` aren't returned. To retrieve them, include `CONTEXT` or `SOURCE_MATERIALS` in `fields`.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  intakeFormId
 Method parameters: 
   param name: intakeFormId | type: string | description: GUID of the IntakeForm to retrieve. | required: true | validation: format GUID
   param name: options | type: GetIntakeFormOptions  none  
        - name: fields | type: array<RequestedFields> | description: Fields to include in the response.  | validation: maxItems 5
             - enum: CONTEXT, SOURCE_MATERIALS
 Return type: PROMISE<IntakeForm>
  - 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.  


```

### Examples

### Get an intake form
Retrieves an intake form by ID, including its AI-generated context

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

const intakeFormId = "8046df3c-7575-4098-a5ab-c91ad8f33c47";

const options = {
  fields: [contentCollectorIntakeForms.RequestedFields.CONTEXT],
};

async function getIntakeForm() {
  const response = await contentCollectorIntakeForms.getIntakeForm(
    intakeFormId,
    options
  );
}

/* Promise resolves to:
 * {
 *   "_id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
 *   "revision": "3",
 *   "_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"
 *   },
 *   "context": "Bloom Bakery is a family-run business focused on artisan sourdough...",
 *   "clientEmails": ["jane@bloombakery.com"],
 *   "userId": "f1a2b3c4-d5e6-4789-9abc-1234567890ab",
 *   "accountId": "a9b8c7d6-e5f4-4321-8765-0fedcba98765",
 *   "publishDate": "2024-03-19T09:14:02.118Z",
 *   "submission": {
 *     "submittedDate": "2024-03-20T11:05:44.000Z",
 *     "lastEditDate": "2024-03-20T11:05:44.000Z"
 *   }
 * }
 */

```

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

---