> 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

# SearchIntakeForms

# Package: contentCollector

# Namespace: IntakeForms

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

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

## Introduction

Searches intake forms using a free-text expression matched against the
client name and project name.

Results are scoped to the caller's account. Intake forms belonging to other
accounts are never returned.

Use Search Intake Forms for free-text lookup (for example, the client a user
asked about) along with filtering, sorting, and aggregations. For precise
structured filtering and sorting without free-text matching, call
[Query Intake Forms](https://dev.wix.com/docs/api-reference/account-level/partners/content-collector/intake-form-v1/query-intake-forms.md) instead.

---

## REST API

### Schema

```
 Method: searchIntakeForms
 Description: Searches intake forms using a free-text expression matched against the client name and project name.  Results are scoped to the caller's account. Intake forms belonging to other accounts are never returned.  Use Search Intake Forms for free-text lookup (for example, the client a user asked about) along with filtering, sorting, and aggregations. For precise structured filtering and sorting without free-text matching, call [Query Intake Forms](https://dev.wix.com/docs/api-reference/account-level/partners/content-collector/intake-form-v1/query-intake-forms.md) instead.
 URL: https://www.wixapis.com/partners/content-collector/v1/intake-forms/search
 Method: POST
 Method parameters:
   param name: fields | type: array<fields> | description: Fields to include in the response.  | validation: maxItems 5
                 - enum: CONTEXT, SOURCE_MATERIALS
   param name: search | type: CursorSearch    
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: List of sort objects.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 10
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
        - name: aggregations | type: array<Aggregation> | description: Aggregations are a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition.  | validation: maxItems 10
           - ONE-OF: 
              - name: value | type: ValueAggregation | description: Value aggregation.  
                 - ONE-OF: 
                    - name: includeOptions | type: IncludeMissingValuesOptions | description: Options for including missing values.  
                       - name: addToBucket | type: string | description: Specify custom bucket name. Defaults are [string -> "N/A"], [int -> "0"], [bool -> "false"] ...  | validation: maxLength 20
                 - name: sortType | type: SortType | description: Whether to sort by number of matches or value of the field.  
                         - enum:
                         -     COUNT: Sort by number of matches.
                         -     VALUE: Sort by value of the field alphabetically.
                 - name: sortDirection | type: SortDirection | description: Whether to sort in ascending or descending order.  
                         - enum:
                         -     DESC: Sort in descending order.
                         -     ASC: Sort in ascending order.
                 - name: limit | type: integer | description: How many aggregations to return. Can be between 1 and 250. 10 is the default.  | validation: format int32
                 - name: missingValues | type: MissingValues | description: Whether to include or exclude missing values from the aggregation results. Default: `EXCLUDE`.  
                         - enum:
                         -     EXCLUDE: Exclude missing values from the aggregation results.
                         -     INCLUDE: Include missing values in the aggregation results.
              - name: range | type: RangeAggregation | description: Range aggregation.  
                 - name: buckets | type: array<RangeBucket> | description: List of range buckets, where during aggregation each entity will be placed in the first bucket its value falls into, based on the provided range bounds.  | validation: maxItems 50
                    - name: from | type: number | description: Inclusive lower bound of the range. Required if `to` is not provided.  | validation: format double
                    - name: to | type: number | description: Exclusive upper bound of the range. Required if `from` is not provided.  | validation: format double
              - name: scalar | type: ScalarAggregation | description: Scalar aggregation.  
                 - name: type | type: ScalarType | description: Define the operator for the scalar aggregation.  
                         - enum:
                         -     COUNT_DISTINCT: Count of distinct values.
                         -     MIN: Minimum value.
                         -     MAX: Maximum value.
              - name: dateHistogram | type: DateHistogramAggregation | description: Date histogram aggregation.  
                 - name: interval | type: Interval | description: Interval for date histogram aggregation.  
                         - enum:
                         -     YEAR: Yearly interval
                         -     MONTH: Monthly interval
                         -     WEEK: Weekly interval
                         -     DAY: Daily interval
                         -     HOUR: Hourly interval
                         -     MINUTE: Minute interval
                         -     SECOND: Second interval
              - name: nested | type: NestedAggregation | description: Nested aggregation.  
                 - name: nestedAggregations | type: array<NestedAggregationItem> | description: Flattened list of aggregations, where each next aggregation is nested within previous one.  | validation: minItems 2, maxItems 3
                    - ONE-OF: 
                       - name: value | type: ValueAggregation | description: Value aggregation.  
                       - name: range | type: RangeAggregation | description: Range aggregation.  
                       - name: scalar | type: ScalarAggregation | description: Scalar aggregation.  
                       - name: dateHistogram | type: DateHistogramAggregation | description: Date histogram aggregation.  
                    - name: name | type: string | description: User-defined name of aggregation, should be unique, will appear in aggregation results.  | validation: maxLength 100
                    - name: type | type: NestedAggregationType | description: Type of aggregation, client must provide matching aggregation field below.  
                             - enum:
                             -     VALUE: An aggregation where result buckets are dynamically built - one per unique value.
                             -     RANGE: An aggregation, where user can define set of ranges - each representing a bucket.
                             -     SCALAR: A single-value metric aggregation. For example, min, max, sum, avg.
                             -     DATE_HISTOGRAM: An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.).
                    - name: fieldPath | type: string | description: Field to aggregate by, use dot notation to specify json path.  | validation: maxLength 200
           - name: name | type: string | description: User-defined name of aggregation, should be unique, will appear in aggregation results.  | validation: maxLength 100
           - name: type | type: AggregationType | description: Type of aggregation, client must provide matching aggregation field below.  
                 - enum:
                 -     VALUE: An aggregation where result buckets are dynamically built - one per unique value.
                 -     RANGE: An aggregation, where user can define set of ranges - each representing a bucket.
                 -     SCALAR: A single-value metric aggregation. For example, min, max, sum, avg.
                 -     DATE_HISTOGRAM: An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.)
                 -     NESTED: Multi-level aggregation, where each next aggregation is nested within previous one.
           - name: fieldPath | type: string | description: Field to aggregate by, use dot notation to specify json path.  | validation: maxLength 200
        - name: search | type: SearchDetails | description: Free text to match in searchable fields.  
           - name: mode | type: Mode | description: Defines how separate search terms in `expression` are combined.  
                 - enum:
                 -     OR: Any of the search terms must be present.
                 -     AND: All search terms must be present.
           - name: expression | type: string | description: Search term or expression.  | validation: maxLength 100
           - name: fields | type: array<string> | description: Fields to search in. If empty - will search in all searchable fields. Use dot notation to specify json path.  | validation: maxItems 20, maxLength 200
           - name: fuzzy | type: boolean | description: Whether to use auto fuzzy search (allowing typos by a managed proximity algorithm).  
        - name: timeZone | type: string | description: UTC offset or IANA time zone. Valid values are ISO 8601 UTC offsets, such as +02:00 or -06:00, and IANA time zone GUIDs, such as Europe/Rome.  Affects all filters and aggregations returned values. You may override this behavior in a specific filter by providing timestamps including time zone. For example, `"2023-12-20T10:52:34.795Z"`.  | validation: maxLength 50
 Searchable fields:
   - field: teamMemberIds | operators: $hasAll, $hasSome | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: createdDate | operators: $eq, $ne, $exists, $in, $any, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: id | operators: $eq, $ne, $exists, $in, $any, $begins, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: accountId | operators: $eq, $ne, $exists, $in, $any, $begins, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: project.industry | operators: $eq, $ne, $exists, $in, $any | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: project.name | operators: $eq, $ne, $exists, $in, $any, $begins, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: true | searchable: true
   - field: publishDate | operators: $eq, $ne, $exists, $in, $any, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: submission.submittedDate | operators: $eq, $ne, $exists, $in, $any, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: userId | operators: $eq, $ne, $exists, $in, $any, $begins, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: clientName | operators: none | sort: none | aggregatable: false | searchable: true
 Return type: SearchIntakeFormsResponse
  - name: intakeForms | type: array<IntakeForm> | description: List of matching IntakeForms.  
     - 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: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  
  - name: aggregationData | type: AggregationData | description: Aggregation data.  
     - name: results | type: array<AggregationResults> | description: key = aggregation name (as derived from search request).  | validation: maxItems 10000
        - ONE-OF: 
           - name: values | type: ValueResults | description: Value aggregation results.  
              - name: results | type: array<ValueAggregationResult> | description: List of value aggregations.  | validation: maxItems 250
                 - name: value | type: string | description: Value of the field.  | validation: maxLength 100
                 - name: count | type: integer | description: Count of entities with this value.  
           - name: ranges | type: RangeResults | description: Range aggregation results.  
              - name: results | type: array<RangeAggregationResult> | description: List of ranges returned in same order as requested.  | validation: maxItems 50
                 - name: from | type: number | description: Inclusive lower bound of the range.  | validation: format double
                 - name: to | type: number | description: Exclusive upper bound of the range.  | validation: format double
                 - name: count | type: integer | description: Count of entities in this range.  
           - name: scalar | type: ScalarResult | description: Scalar aggregation results.  
              - name: type | type: ScalarType | description: Type of scalar aggregation.  
                     - enum:
                     -     COUNT_DISTINCT: Count of distinct values.
                     -     MIN: Minimum value.
                     -     MAX: Maximum value.
              - name: value | type: number | description: Value of the scalar aggregation.  
           - name: groupedByValue | type: GroupByValueResults | description: Group by value aggregation results.  
              - name: results | type: array<NestedValueAggregationResult> | description: List of value aggregations.  | validation: maxItems 1000
                 - name: value | type: string | description: Value of the field.  | validation: maxLength 1000
                 - name: nestedResults | type: NestedAggregationResults | description: Nested aggregations.  
                    - ONE-OF: 
                       - name: values | type: ValueResults | description: Value aggregation results.  
                       - name: ranges | type: RangeResults | description: Range aggregation results.  
                       - name: scalar | type: ScalarResult | description: Scalar aggregation results.  
                    - name: name | type: string | description: User-defined name of aggregation, matches the one provided in request.  | validation: maxLength 100
                    - name: type | type: AggregationType | description: Type of aggregation that matches result.  
                             - enum:
                             -     VALUE: An aggregation where result buckets are dynamically built - one per unique value.
                             -     RANGE: An aggregation, where user can define set of ranges - each representing a bucket.
                             -     SCALAR: A single-value metric aggregation. For example, min, max, sum, avg.
                             -     DATE_HISTOGRAM: An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.)
                             -     NESTED: Multi-level aggregation, where each next aggregation is nested within previous one.
                    - name: fieldPath | type: string | description: Field to aggregate by, matches the one provided in request.  | validation: maxLength 200
           - name: dateHistogram | type: DateHistogramResults | description: Date histogram aggregation results.  
              - name: results | type: array<DateHistogramResult> | description: List of date histogram aggregations.  | validation: maxItems 200
                 - name: value | type: string | description: Date in ISO 8601 format.  | validation: maxLength 100
                 - name: count | type: integer | description: Count of documents in the bucket.  
           - name: nested | type: NestedResults | description: Nested aggregation results.  
              - name: results | type: array<Results> | description: List of nested aggregations.  | validation: maxItems 1000
                 - name: results | type: Map<string,NestedResultValue> | description: List of nested aggregations.  | validation: format map
                    - ONE-OF: 
                       - name: value | type: ValueResult | description: Value aggregation result.  
                          - name: value | type: string | description: Value of the field.  | validation: maxLength 1000
                          - name: count | type: integer | description: Count of entities with this value.  | validation: format int32
                       - name: range | type: RangeResult | description: Range aggregation result.  
                          - name: from | type: number | description: Inclusive lower bound of the range.  | validation: format double
                          - name: to | type: number | description: Exclusive upper bound of the range.  | validation: format double
                          - name: count | type: integer | description: Count of entities in this range.  | validation: format int32
                       - name: scalar | type: ScalarResult | description: Scalar aggregation result.  
                          - name: value | type: number | description: Value of the scalar aggregation.  
                       - name: dateHistogram | type: ValueResult | description: Date histogram aggregation result.  
        - name: name | type: string | description: User-defined name of aggregation as derived from search request.  | validation: maxLength 100
        - name: type | type: AggregationType | description: Type of aggregation that must match provided kind as derived from search request.  
        - name: fieldPath | type: string | description: Field to aggregate by as derived from search request.  | validation: maxLength 200


```

### Examples

### Search Intake Forms
Searches intake forms by a free-text expression across client and project name

```curl
curl -X POST \
  'https://www.wixapis.com/intake-forms/v1/intake-forms/search' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "search": {
      "search": {
        "expression": "bloom bakery"
      },
      "cursorPaging": { "limit": 50 }
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.contentCollectorIntakeForms.contentCollectorIntakeForms.searchIntakeForms(search, options)
 Description: Searches intake forms using a free-text expression matched against the client name and project name.  Results are scoped to the caller's account. Intake forms belonging to other accounts are never returned.  Use Search Intake Forms for free-text lookup (for example, the client a user asked about) along with filtering, sorting, and aggregations. For precise structured filtering and sorting without free-text matching, call [Query Intake Forms](https://dev.wix.com/docs/api-reference/account-level/partners/content-collector/intake-form-v1/query-intake-forms.md) instead.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  search
 Method parameters: 
   param name: options | type: SearchIntakeFormsOptions  none  
        - name: fields | type: array<RequestedFields> | description: Fields to include in the response.  | validation: maxItems 5
             - enum: CONTEXT, SOURCE_MATERIALS
   param name: search | type: CursorSearch   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: List of sort objects.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 10
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
        - name: aggregations | type: array<Aggregation> | description: Aggregations are a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition.  | validation: maxItems 10
           - ONE-OF: 
              - name: value | type: ValueAggregation | description: Value aggregation.  
                 - ONE-OF: 
                    - name: includeOptions | type: IncludeMissingValuesOptions | description: Options for including missing values.  
                       - name: addToBucket | type: string | description: Specify custom bucket name. Defaults are [string -> "N/A"], [int -> "0"], [bool -> "false"] ...  | validation: maxLength 20
                 - name: sortType | type: SortType | description: Whether to sort by number of matches or value of the field.  
                         - enum:
                         -     COUNT: Sort by number of matches.
                         -     VALUE: Sort by value of the field alphabetically.
                 - name: sortDirection | type: SortDirection | description: Whether to sort in ascending or descending order.  
                         - enum:
                         -     DESC: Sort in descending order.
                         -     ASC: Sort in ascending order.
                 - name: limit | type: integer | description: How many aggregations to return. Can be between 1 and 250. 10 is the default.  | validation: format int32
                 - name: missingValues | type: MissingValues | description: Whether to include or exclude missing values from the aggregation results. Default: `EXCLUDE`.  
                         - enum:
                         -     EXCLUDE: Exclude missing values from the aggregation results.
                         -     INCLUDE: Include missing values in the aggregation results.
              - name: range | type: RangeAggregation | description: Range aggregation.  
                 - name: buckets | type: array<RangeBucket> | description: List of range buckets, where during aggregation each entity will be placed in the first bucket its value falls into, based on the provided range bounds.  | validation: maxItems 50
                    - name: from | type: number | description: Inclusive lower bound of the range. Required if `to` is not provided.  
                    - name: to | type: number | description: Exclusive upper bound of the range. Required if `from` is not provided.  
              - name: scalar | type: ScalarAggregation | description: Scalar aggregation.  
                 - name: type | type: ScalarType | description: Define the operator for the scalar aggregation.  
                         - enum:
                         -     COUNT_DISTINCT: Count of distinct values.
                         -     MIN: Minimum value.
                         -     MAX: Maximum value.
              - name: dateHistogram | type: DateHistogramAggregation | description: Date histogram aggregation.  
                 - name: interval | type: Interval | description: Interval for date histogram aggregation.  
                         - enum:
                         -     YEAR: Yearly interval
                         -     MONTH: Monthly interval
                         -     WEEK: Weekly interval
                         -     DAY: Daily interval
                         -     HOUR: Hourly interval
                         -     MINUTE: Minute interval
                         -     SECOND: Second interval
              - name: nested | type: NestedAggregation | description: Nested aggregation.  
                 - name: nestedAggregations | type: array<NestedAggregationItem> | description: Flattened list of aggregations, where each next aggregation is nested within previous one.  | validation: minItems 2, maxItems 3
                    - ONE-OF: 
                       - name: value | type: ValueAggregation | description: Value aggregation.  
                       - name: range | type: RangeAggregation | description: Range aggregation.  
                       - name: scalar | type: ScalarAggregation | description: Scalar aggregation.  
                       - name: dateHistogram | type: DateHistogramAggregation | description: Date histogram aggregation.  
                    - name: name | type: string | description: User-defined name of aggregation, should be unique, will appear in aggregation results.  | validation: maxLength 100
                    - name: type | type: NestedAggregationType | description: Type of aggregation, client must provide matching aggregation field below.  
                             - enum:
                             -     VALUE: An aggregation where result buckets are dynamically built - one per unique value.
                             -     RANGE: An aggregation, where user can define set of ranges - each representing a bucket.
                             -     SCALAR: A single-value metric aggregation. For example, min, max, sum, avg.
                             -     DATE_HISTOGRAM: An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.).
                    - name: fieldPath | type: string | description: Field to aggregate by, use dot notation to specify json path.  | validation: maxLength 200
           - name: name | type: string | description: User-defined name of aggregation, should be unique, will appear in aggregation results.  | validation: maxLength 100
           - name: type | type: AggregationType | description: Type of aggregation, client must provide matching aggregation field below.  
                 - enum:
                 -     VALUE: An aggregation where result buckets are dynamically built - one per unique value.
                 -     RANGE: An aggregation, where user can define set of ranges - each representing a bucket.
                 -     SCALAR: A single-value metric aggregation. For example, min, max, sum, avg.
                 -     DATE_HISTOGRAM: An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.)
                 -     NESTED: Multi-level aggregation, where each next aggregation is nested within previous one.
           - name: fieldPath | type: string | description: Field to aggregate by, use dot notation to specify json path.  | validation: maxLength 200
        - name: search | type: SearchDetails | description: Free text to match in searchable fields.  
           - name: mode | type: Mode | description: Defines how separate search terms in `expression` are combined.  
                 - enum:
                 -     OR: Any of the search terms must be present.
                 -     AND: All search terms must be present.
           - name: expression | type: string | description: Search term or expression.  | validation: maxLength 100
           - name: fields | type: array<string> | description: Fields to search in. If empty - will search in all searchable fields. Use dot notation to specify json path.  | validation: maxItems 20, maxLength 200
           - name: fuzzy | type: boolean | description: Whether to use auto fuzzy search (allowing typos by a managed proximity algorithm).  
        - name: timeZone | type: string | description: UTC offset or IANA time zone. Valid values are ISO 8601 UTC offsets, such as +02:00 or -06:00, and IANA time zone GUIDs, such as Europe/Rome.  Affects all filters and aggregations returned values. You may override this behavior in a specific filter by providing timestamps including time zone. For example, `"2023-12-20T10:52:34.795Z"`.  | validation: maxLength 50
 Searchable fields:
   - field: teamMemberIds | operators: $hasAll, $hasSome | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: _createdDate | operators: $eq, $ne, $exists, $in, $any, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: _id | operators: $eq, $ne, $exists, $in, $any, $begins, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: accountId | operators: $eq, $ne, $exists, $in, $any, $begins, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: project.industry | operators: $eq, $ne, $exists, $in, $any | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: project.name | operators: $eq, $ne, $exists, $in, $any, $begins, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: true | searchable: true
   - field: publishDate | operators: $eq, $ne, $exists, $in, $any, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: submission.submittedDate | operators: $eq, $ne, $exists, $in, $any, $lt, $lte, $gt, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: userId | operators: $eq, $ne, $exists, $in, $any, $begins, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: clientName | operators: none | sort: none | aggregatable: false | searchable: true
 Return type: PROMISE<SearchIntakeFormsResponse>
  - name: intakeForms | type: array<IntakeForm> | description: List of matching IntakeForms.  
     - 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: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  
  - name: aggregationData | type: AggregationData | description: Aggregation data.  
     - name: results | type: array<AggregationResults> | description: key = aggregation name (as derived from search request).  | validation: maxItems 10000
        - ONE-OF: 
           - name: values | type: ValueResults | description: Value aggregation results.  
              - name: results | type: array<ValueAggregationResult> | description: List of value aggregations.  | validation: maxItems 250
                 - name: value | type: string | description: Value of the field.  | validation: maxLength 100
                 - name: count | type: integer | description: Count of entities with this value.  
           - name: ranges | type: RangeResults | description: Range aggregation results.  
              - name: results | type: array<RangeAggregationResult> | description: List of ranges returned in same order as requested.  | validation: maxItems 50
                 - name: from | type: number | description: Inclusive lower bound of the range.  
                 - name: to | type: number | description: Exclusive upper bound of the range.  
                 - name: count | type: integer | description: Count of entities in this range.  
           - name: scalar | type: ScalarResult | description: Scalar aggregation results.  
              - name: type | type: ScalarType | description: Type of scalar aggregation.  
                     - enum:
                     -     COUNT_DISTINCT: Count of distinct values.
                     -     MIN: Minimum value.
                     -     MAX: Maximum value.
              - name: value | type: number | description: Value of the scalar aggregation.  
           - name: groupedByValue | type: GroupByValueResults | description: Group by value aggregation results.  
              - name: results | type: array<NestedValueAggregationResult> | description: List of value aggregations.  | validation: maxItems 1000
                 - name: value | type: string | description: Value of the field.  | validation: maxLength 1000
                 - name: nestedResults | type: NestedAggregationResults | description: Nested aggregations.  
                    - ONE-OF: 
                       - name: values | type: ValueResults | description: Value aggregation results.  
                       - name: ranges | type: RangeResults | description: Range aggregation results.  
                       - name: scalar | type: ScalarResult | description: Scalar aggregation results.  
                    - name: name | type: string | description: User-defined name of aggregation, matches the one provided in request.  | validation: maxLength 100
                    - name: type | type: AggregationType | description: Type of aggregation that matches result.  
                             - enum:
                             -     VALUE: An aggregation where result buckets are dynamically built - one per unique value.
                             -     RANGE: An aggregation, where user can define set of ranges - each representing a bucket.
                             -     SCALAR: A single-value metric aggregation. For example, min, max, sum, avg.
                             -     DATE_HISTOGRAM: An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.)
                             -     NESTED: Multi-level aggregation, where each next aggregation is nested within previous one.
                    - name: fieldPath | type: string | description: Field to aggregate by, matches the one provided in request.  | validation: maxLength 200
           - name: dateHistogram | type: DateHistogramResults | description: Date histogram aggregation results.  
              - name: results | type: array<DateHistogramResult> | description: List of date histogram aggregations.  | validation: maxItems 200
                 - name: value | type: string | description: Date in ISO 8601 format.  | validation: maxLength 100
                 - name: count | type: integer | description: Count of documents in the bucket.  
           - name: nested | type: NestedResults | description: Nested aggregation results.  
              - name: results | type: array<Results> | description: List of nested aggregations.  | validation: maxItems 1000
                 - name: results | type: Map<string,NestedResultValue> | description: List of nested aggregations.  | validation: format map
                    - ONE-OF: 
                       - name: value | type: ValueResult | description: Value aggregation result.  
                          - name: value | type: string | description: Value of the field.  | validation: maxLength 1000
                          - name: count | type: integer | description: Count of entities with this value.  | validation: format int32
                       - name: range | type: RangeResult | description: Range aggregation result.  
                          - name: from | type: number | description: Inclusive lower bound of the range.  
                          - name: to | type: number | description: Exclusive upper bound of the range.  
                          - name: count | type: integer | description: Count of entities in this range.  | validation: format int32
                       - name: scalar | type: ScalarResult | description: Scalar aggregation result.  
                          - name: value | type: number | description: Value of the scalar aggregation.  
                       - name: dateHistogram | type: ValueResult | description: Date histogram aggregation result.  
        - name: name | type: string | description: User-defined name of aggregation as derived from search request.  | validation: maxLength 100
        - name: type | type: AggregationType | description: Type of aggregation that must match provided kind as derived from search request.  
        - name: fieldPath | type: string | description: Field to aggregate by as derived from search request.  | validation: maxLength 200


```

### Examples

### Search intake forms
Searches intake forms by a free-text expression across client and project name

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

const search = {
  search: {
    expression: "bloom bakery",
  },
  cursorPaging: {
    limit: 50,
  },
};

async function searchIntakeForms() {
  const response = await contentCollectorIntakeForms.searchIntakeForms(search);
}

/* Promise resolves to:
 * {
 *   "intakeForms": [
 *     {
 *       "_id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
 *       "revision": "3",
 *       "_createdDate": "2024-03-18T17:22:10.299Z",
 *       "_updatedDate": "2024-03-20T11:05:44.000Z",
 *       "clientName": "Jane Cohen",
 *       "project": {
 *         "name": "Bloom Bakery Website",
 *         "industry": "FOOD_AND_BEVERAGE"
 *       },
 *       "userId": "f1a2b3c4-d5e6-4789-9abc-1234567890ab",
 *       "accountId": "a9b8c7d6-e5f4-4321-8765-0fedcba98765",
 *       "publishDate": "2024-03-19T09:14:02.118Z"
 *     }
 *   ],
 *   "pagingMetadata": {
 *     "count": 1,
 *     "cursors": {},
 *     "hasNext": false
 *   }
 * }
 */

```

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

---