> 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

# SearchParticipants

# Package: onlinePrograms

# Namespace: ParticipantsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/participants/search-participants.md

## Permission Scopes:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Retrieves a list of participants matching the search criteria.

Results and aggregations include only the participant records that the caller is authorized to access.

---

## REST API

### Schema

```
 Method: searchParticipants
 Description: Retrieves a list of participants matching the search criteria.  Results and aggregations include only the participant records that the caller is authorized to access.
 URL: https://www.wixapis.com/online-programs/v3/participants/search
 Method: POST
 Method parameters:
   param name: fields | type: array<fields> | description: Array of conditional fields to include in the response. Use `RequestedFields.PROGRESS` to include the `progress` field, which isn't returned by default.  | validation: maxItems 1
                 - enum:
                 -     PROGRESS: Request the progress field to be calculated and included in the response.
   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 [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters).  
        - name: sort | type: array<Sorting> | description: List of sort objects.  Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting).  | 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: Logical groupings of data into facets, with summaries for each facet. For example, use aggregations to allow site visitors to narrow down their search results by selecting specific categories.  | validation: maxItems 10
           - ONE-OF: 
              - name: value | type: ValueAggregation | description: A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number (count) of products for each price listed in the store.  
                 - ONE-OF: 
                    - name: includeOptions | type: IncludeMissingValuesOptions | description: Options for including missing values in results.  
                       - name: addToBucket | type: string | description: Specify a custom name for the bucket containing the missing values. Defaults are `"N/A"` for strings, `0` for integers, and `false` for booleans.  | validation: maxLength 20
                 - name: sortType | type: SortType | description: Sort type.  
                         - enum:
                         -     COUNT: Number of matches in the results.
                         -     VALUE: Alphabetically by the field value.
                 - name: sortDirection | type: SortDirection | description: Sort direction.  
                         - enum:
                         -     DESC: Descending order.
                         -     ASC: Ascending order.
                 - name: limit | type: integer | description: Number of aggregation results to return. Min: `1` Max: `250` Default: `10`  | validation: format int32
                 - name: missingValues | type: MissingValues | description: Whether to include or exclude missing values in 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: A range aggregation calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. For example, use a range aggregation to compare the number of reservations made for parties of 4 or less to the number of reservations made for parties with 5 or more.  
                 - name: buckets | type: array<RangeBucket> | description: List of range buckets. During aggregation each entity is 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: A scalar aggregation calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.  
                 - name: type | type: ScalarType | description: Operator type for the scalar aggregation.  
                         - enum:
                         -     COUNT_DISTINCT: Total number of distinct values.
                         -     MIN: Minimum value.
                         -     MAX: Maximum value.
              - name: dateHistogram | type: DateHistogramAggregation | description: A date histogram calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.) For example, use a date histogram to find how many reservations have been made at a restaurant each week.  
                 - name: interval | type: Interval | description: Interval for date histogram aggregation.  
                         - enum: YEAR, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND
              - name: nested | type: NestedAggregation | description: A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy. For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.  
                 - name: nestedAggregations | type: array<NestedAggregationItem> | description: Flattened list of aggregations, where each aggregation is nested within previous one.  | validation: minItems 2, maxItems 3
                    - ONE-OF: 
                       - name: value | type: ValueAggregation | description: A value aggregation calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number (count) of orders for each order status.  
                       - name: range | type: RangeAggregation | description: A range aggregation calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. For example, use a range aggregation to compare the number of reservations made for parties of 4 or less to the number of reservations made for parties with 5 or more. If ranges overlap, a record that fits more than one range will only be counted in the first range that matches the criteria.  
                       - name: scalar | type: ScalarAggregation | description: A scalar aggregation calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.  
                       - name: dateHistogram | type: DateHistogramAggregation | description: A date histogram calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). For example, use a date histogram to determine how many reservations have been made at a restaurant each week. If ranges overlap, a record that fits more than one range will only be counted in the first range that matches the criteria.  
                    - name: name | type: string | description: Unique, caller-defined aggregation name, returned in `aggregations.results`.  | validation: maxLength 100
                    - name: type | type: NestedAggregationType | description: Type of aggregation to perform. The matching aggregation field must be passed.  
                             - enum:
                             -     VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values.
                             -     RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define.
                             -     SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
                             -     DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.).
                    - name: fieldPath | type: string | description: Field to aggregate by. Use dot notation to specify a JSON path. For example, `order.address.streetName`.  | validation: maxLength 200
           - name: name | type: string | description: Aggregation name, returned in `aggregations.results.name`.  | validation: maxLength 100
           - name: type | type: AggregationType | description: Type of aggregation to perform. Must align with the corresponding aggregation field.  
                 - enum:
                 -     VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values.
                 -     RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define.
                 -     SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
                 -     DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.).
                 -     NESTED: Flattened list of aggregations, where each aggregation is nested within previous one.
           - name: fieldPath | type: string | description: Field to aggregate by. Use dot notation to specify a JSON path. For example, `order.address.streetName`.  | validation: maxLength 200
        - name: search | type: SearchDetails | description: Free text to match in searchable fields.  
           - name: mode | type: Mode | description: Search mode. Defines the search logic for combining multiple terms in the `expression`.  
                 - enum:
                 -     OR: At least one 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 the array is empty, all searchable fields are searched. Use dot notation to specify a JSON path. For example, `order.address.streetName`.  | validation: maxItems 20, maxLength 200
           - name: fuzzy | type: boolean | description: Whether to enable the search function to use an algorithm to automatically find results that are close to the search expression, such as typos and declensions.  
        - name: timeZone | type: string | description: Time zone to adjust date-time-based filters and aggregations, in ISO 8601 (including offsets) or IANA time zone database (including time zone GUIDs) format. Applies to all relevant filters and aggregations, unless overridden by providing timestamps including time zone. For example, "2023-12-20T10:52:34.795Z".  | validation: maxLength 50
 Searchable fields:
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: enrollmentInfo.startDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: member.contactId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: member.email | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: false | searchable: true
   - field: member.firstName | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: false | searchable: true
   - field: member.lastName | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: false | searchable: true
   - field: member.nickname | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: false | searchable: true
   - field: memberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: programId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: progress.completionPercentage | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: progress.totalStepsCompleted | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: enrollmentStatus | operators: $eq, $in, $nin | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: progressStatus | operators: $eq, $in, $nin | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: lastActivityDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
 Return type: SearchParticipantsResponse
  - name: participants | type: array<Participant> | description: Participants matching the search criteria.  
     - name: id | type: string | description: Participant GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the participant is updated. To prevent conflicting changes, the current revision must be specified when updating the participant.  Ignored when creating a participant.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the participant was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the participant was updated.  | read-only: true | validation: format date-time
     - name: memberId | type: string | description: Member GUID of the participant on the site.  | read-only: true | validation: format GUID
     - name: programId | type: string | description: GUID of the program the participant is enrolled in.  | read-only: true | validation: format GUID
     - name: progress | type: Progress | description: Program completion progress. This field is conditional and must be explicitly requested using the `fields` parameter.  | read-only: true 
        - name: totalStepsCompleted | type: integer | description: Number of program steps completed by member.  | validation: minimum 0
        - name: totalStepsAvailable | type: integer | description: Total number of program steps available to resolve.  | validation: minimum 0
        - name: completionPercentage | type: number | description: Participant's completion percentage. For participants who completed the program, this is `100.0`. Otherwise, it's calculated as (`totalStepsCompleted` / `totalStepsAvailable`) * 100, capped at `100`, and rounded to 1 decimal place.  | validation: minimum 0, maximum 100
     - name: certificateInfo | type: CertificateInfo | description: Information about the participant's certificate.  Returned only when a certificate has been issued to the participant.  | read-only: true 
        - name: issueDate | type: string | description: Date when the certificate was issued (UTC).  | read-only: true | validation: format date-time
     - name: member | type: Member | description: Snapshot of the site member identified by `memberId`, copied from the Members API. It isn't the authoritative member record.  | read-only: true 
        - name: firstName | type: string | description: First name of the site member.  Returned only when the member has provided it in their profile.  | read-only: true | validation: maxLength 1000
        - name: lastName | type: string | description: Last name of the site member.  Returned only when the member has provided it in their profile.  | read-only: true | validation: maxLength 1000
        - name: email | type: string | description: Email of the site member.  Returned only when the member has provided it in their profile.  | read-only: true | validation: format EMAIL
        - name: contactId | type: string | description: Contact GUID for accessing additional member information with the Contacts API, such as phone numbers, addresses, and custom fields.  Returned only when the member has provided this information in their profile.  | read-only: true | validation: format GUID
        - name: nickname | type: string | description: Member nickname.  Returned only when the member has provided it in their profile.  | read-only: true | validation: maxLength 1000
        - name: profileImageUrl | type: string | description: Profile image URL of the site member.  | read-only: true | validation: format WEB_URL
     - name: lastActivityDate | type: string | description: Last activity date of the participant in the program (can either be status change or step resolution).  | read-only: true | validation: format date-time
     - name: enrollmentStatus | type: EnrollmentStatus | description: Participant's enrollment status in the program.  | read-only: true 
         - enum:
         -     JOINED: Participant is actively enrolled in the program.
         -     SUSPENDED: Enrollment temporarily suspended due to payment issues.
         -     AUTO_REMOVED: Automatically removed via a Wix Automations workflow.
         -     REMOVED: Removed from the program by the site owner.
         -     LEFT: Participant voluntarily left the program.
     - name: progressStatus | type: ProgressStatus | description: Participant's progress status in the program.  | read-only: true 
         - enum:
         -     NOT_STARTED: Enrolled but no steps completed yet.
         -     IN_PROGRESS: At least one step completed but program not yet finished.
         -     COMPLETED: Participant successfully completed the program.
         -     FAILED: Participant failed to complete the program within the deadline.
         -     NOT_APPLICABLE: Progress tracking isn't applicable because the participant left, was removed, or was auto-removed.
     - name: enrollmentInfo | type: EnrollmentInfo | description: Additional information about the participant's enrollment and completion timeframe in the program.  
        - ONE-OF: 
           - name: singlePaymentDetails | type: SinglePaymentDetails | description: Details about a Single Payment enrollment.  
              - name: paymentOrderId | type: string | description: GUID of the cashier order which was used to pay for joining the program.  | validation: format GUID, immutable
              - name: offlineTransactionId | type: string | description: GUID of the offline transaction.  Available only when the participant paid with an offline payment method, such as cash or check.  | validation: format GUID, immutable
           - name: paidPlanDetails | type: PaidPlanDetails | description: Details about a Paid Plan enrollment.  
              - name: paidPlanId | type: string | description: GUID of the Paid Plan for which member has paid to join the program.  | validation: format GUID, immutable
           - name: freeCouponDetails | type: FreeCouponDetails | description: Details about a Free Coupon enrollment.  
              - name: freeCouponId | type: string | description: GUID of the coupon which was applied and gave 100% discount to join the program for free.  | validation: format GUID, immutable
        - name: timeZone | type: string | description: Time zone of the site when the participant was enrolled in the program, in IANA timezone format (e.g., "America/New_York").  | read-only: true | validation: maxLength 50
        - name: startDate | type: string | description: Date when the participant's program timeline begins, in `YYYY-MM-DD` format. If the program's `timeline.startDate` is set, this is that date. Otherwise, it's the local calendar date when the participant is created, based on the site's time zone.  | read-only: true | validation: format LOCAL_DATE
        - name: pricingType | type: PricingType | description: Pricing type used for the participant's enrollment in the program.  
             - enum:
             -     FREE: Member joined a program that is configured as free to join, with no payment required.
             -     ADDED_MANUALLY: Member was added to the program by site owner.
             -     SINGLE_PAYMENT: Member paid once to join the program.
             -     PAID_PLAN: Member joined using a Pricing Plan.
             -     FREE_COUPON: Member joined a paid program using a coupon that provided 100% discount.
        - name: deadline | type: string | description: Date by which the participant must complete the program, in `YYYY-MM-DD` format.  Returned only when the program has a fixed end date, or a duration-based deadline calculated from the participant's start date.  | read-only: true | validation: format LOCAL_DATE
     - name: extendedFields | type: ExtendedFields | description: Custom field data for the participant object.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: tags | type: Tags | description: Tags for categorizing and organizing participants.  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, typically restricted from site members and visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  
  - 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 in case aggregations were requested.  
     - 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: Total number 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: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values.
                             -     RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define.
                             -     SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
                             -     DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.).
                             -     NESTED: Flattened list of aggregations, where each 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 participants by member name
Searches for participants by member first name or email

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/participants/v3/participants/search' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "search": {
    "search": {
      "expression": "john"
    },
    "filter": {
      "programId": {"$eq": "5f2d6b0e-8f8f-4e6e-a1b1-6f6a8427c3d7"}
    },
    "sort": [{"fieldName": "lastActivityDate", "order": "DESC"}],
    "cursorPaging": {"limit": 25}
  },
  "fields": ["PROGRESS"]
}'
```

### Search participants with status aggregation
Returns enrollment and progress status counts from the participant records that the caller is authorized to access. Participant fields use enum values such as `JOINED`; aggregation buckets use normalized lowercase search values such as `joined`.

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/participants/v3/participants/search' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "search": {
    "filter": {
      "programId": {"$eq": "1a87c246-5c3a-4eea-a7c8-e5e2cf5d61c0"}
    },
    "aggregations": [
      {
        "name": "byEnrollmentAndProgressStatus",
        "type": "NESTED",
        "fieldPath": "",
        "nested": {
          "nestedAggregations": [
            {
              "name": "enrollmentStatus",
              "type": "VALUE",
              "fieldPath": "enrollmentStatus",
              "value": {}
            },
            {
              "name": "progressStatus",
              "type": "VALUE",
              "fieldPath": "progressStatus",
              "value": {}
            }
          ]
        }
      }
    ],
    "cursorPaging": {"limit": 1}
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.participants.searchParticipants(search, options)
 Description: Retrieves a list of participants matching the search criteria.  Results and aggregations include only the participant records that the caller is authorized to access.
 # 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: SearchParticipantsOptions  none  
        - name: fields | type: array<RequestedFields> | description: Array of conditional fields to include in the response. Use `RequestedFields.PROGRESS` to include the `progress` field, which isn't returned by default.  | validation: maxItems 1
             - enum:
             -     PROGRESS: Request the progress field to be calculated and included in the response.
   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 [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters).  
        - name: sort | type: array<Sorting> | description: List of sort objects.  Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting).  | 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: Logical groupings of data into facets, with summaries for each facet. For example, use aggregations to allow site visitors to narrow down their search results by selecting specific categories.  | validation: maxItems 10
           - ONE-OF: 
              - name: value | type: ValueAggregation | description: A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number (count) of products for each price listed in the store.  
                 - ONE-OF: 
                    - name: includeOptions | type: IncludeMissingValuesOptions | description: Options for including missing values in results.  
                       - name: addToBucket | type: string | description: Specify a custom name for the bucket containing the missing values. Defaults are `"N/A"` for strings, `0` for integers, and `false` for booleans.  | validation: maxLength 20
                 - name: sortType | type: SortType | description: Sort type.  
                         - enum:
                         -     COUNT: Number of matches in the results.
                         -     VALUE: Alphabetically by the field value.
                 - name: sortDirection | type: SortDirection | description: Sort direction.  
                         - enum:
                         -     DESC: Descending order.
                         -     ASC: Ascending order.
                 - name: limit | type: integer | description: Number of aggregation results to return. Min: `1` Max: `250` Default: `10`  | validation: format int32
                 - name: missingValues | type: MissingValues | description: Whether to include or exclude missing values in 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: A range aggregation calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. For example, use a range aggregation to compare the number of reservations made for parties of 4 or less to the number of reservations made for parties with 5 or more.  
                 - name: buckets | type: array<RangeBucket> | description: List of range buckets. During aggregation each entity is 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: A scalar aggregation calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.  
                 - name: type | type: ScalarType | description: Operator type for the scalar aggregation.  
                         - enum:
                         -     COUNT_DISTINCT: Total number of distinct values.
                         -     MIN: Minimum value.
                         -     MAX: Maximum value.
              - name: dateHistogram | type: DateHistogramAggregation | description: A date histogram calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.) For example, use a date histogram to find how many reservations have been made at a restaurant each week.  
                 - name: interval | type: Interval | description: Interval for date histogram aggregation.  
                         - enum: YEAR, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND
              - name: nested | type: NestedAggregation | description: A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy. For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.  
                 - name: nestedAggregations | type: array<NestedAggregationItem> | description: Flattened list of aggregations, where each aggregation is nested within previous one.  | validation: minItems 2, maxItems 3
                    - ONE-OF: 
                       - name: value | type: ValueAggregation | description: A value aggregation calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number (count) of orders for each order status.  
                       - name: range | type: RangeAggregation | description: A range aggregation calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. For example, use a range aggregation to compare the number of reservations made for parties of 4 or less to the number of reservations made for parties with 5 or more. If ranges overlap, a record that fits more than one range will only be counted in the first range that matches the criteria.  
                       - name: scalar | type: ScalarAggregation | description: A scalar aggregation calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.  
                       - name: dateHistogram | type: DateHistogramAggregation | description: A date histogram calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). For example, use a date histogram to determine how many reservations have been made at a restaurant each week. If ranges overlap, a record that fits more than one range will only be counted in the first range that matches the criteria.  
                    - name: name | type: string | description: Unique, caller-defined aggregation name, returned in `aggregations.results`.  | validation: maxLength 100
                    - name: type | type: NestedAggregationType | description: Type of aggregation to perform. The matching aggregation field must be passed.  
                             - enum:
                             -     VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values.
                             -     RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define.
                             -     SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
                             -     DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.).
                    - name: fieldPath | type: string | description: Field to aggregate by. Use dot notation to specify a JSON path. For example, `order.address.streetName`.  | validation: maxLength 200
           - name: name | type: string | description: Aggregation name, returned in `aggregations.results.name`.  | validation: maxLength 100
           - name: type | type: AggregationType | description: Type of aggregation to perform. Must align with the corresponding aggregation field.  
                 - enum:
                 -     VALUE: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values.
                 -     RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define.
                 -     SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
                 -     DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.).
                 -     NESTED: Flattened list of aggregations, where each aggregation is nested within previous one.
           - name: fieldPath | type: string | description: Field to aggregate by. Use dot notation to specify a JSON path. For example, `order.address.streetName`.  | validation: maxLength 200
        - name: search | type: SearchDetails | description: Free text to match in searchable fields.  
           - name: mode | type: Mode | description: Search mode. Defines the search logic for combining multiple terms in the `expression`.  
                 - enum:
                 -     OR: At least one 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 the array is empty, all searchable fields are searched. Use dot notation to specify a JSON path. For example, `order.address.streetName`.  | validation: maxItems 20, maxLength 200
           - name: fuzzy | type: boolean | description: Whether to enable the search function to use an algorithm to automatically find results that are close to the search expression, such as typos and declensions.  
        - name: timeZone | type: string | description: Time zone to adjust date-time-based filters and aggregations, in ISO 8601 (including offsets) or IANA time zone database (including time zone GUIDs) format. Applies to all relevant filters and aggregations, unless overridden by providing timestamps including time zone. For example, "2023-12-20T10:52:34.795Z".  | validation: maxLength 50
 Searchable fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: enrollmentInfo.startDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: member.contactId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: member.email | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: false | searchable: true
   - field: member.firstName | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: false | searchable: true
   - field: member.lastName | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: false | searchable: true
   - field: member.nickname | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: false | searchable: true
   - field: memberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: programId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: progress.completionPercentage | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: progress.totalStepsCompleted | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: enrollmentStatus | operators: $eq, $in, $nin | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: progressStatus | operators: $eq, $in, $nin | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: _createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: _updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
   - field: lastActivityDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: true | searchable: false
 Return type: PROMISE<SearchParticipantsResponse>
  - name: participants | type: array<Participant> | description: Participants matching the search criteria.  
     - name: _id | type: string | description: Participant GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the participant is updated. To prevent conflicting changes, the current revision must be specified when updating the participant.  Ignored when creating a participant.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the participant was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the participant was updated.  | read-only: true 
     - name: memberId | type: string | description: Member GUID of the participant on the site.  | read-only: true | validation: format GUID
     - name: programId | type: string | description: GUID of the program the participant is enrolled in.  | read-only: true | validation: format GUID
     - name: progress | type: Progress | description: Program completion progress. This field is conditional and must be explicitly requested using the `fields` parameter.  | read-only: true 
        - name: totalStepsCompleted | type: integer | description: Number of program steps completed by member.  | validation: minimum 0
        - name: totalStepsAvailable | type: integer | description: Total number of program steps available to resolve.  | validation: minimum 0
        - name: completionPercentage | type: number | description: Participant's completion percentage. For participants who completed the program, this is `100.0`. Otherwise, it's calculated as (`totalStepsCompleted` / `totalStepsAvailable`) * 100, capped at `100`, and rounded to 1 decimal place.  | validation: minimum 0, maximum 100
     - name: certificateInfo | type: CertificateInfo | description: Information about the participant's certificate.  Returned only when a certificate has been issued to the participant.  | read-only: true 
        - name: issueDate | type: Date | description: Date when the certificate was issued (UTC).  | read-only: true 
     - name: member | type: Member | description: Snapshot of the site member identified by `memberId`, copied from the Members API. It isn't the authoritative member record.  | read-only: true 
        - name: firstName | type: string | description: First name of the site member.  Returned only when the member has provided it in their profile.  | read-only: true | validation: maxLength 1000
        - name: lastName | type: string | description: Last name of the site member.  Returned only when the member has provided it in their profile.  | read-only: true | validation: maxLength 1000
        - name: email | type: string | description: Email of the site member.  Returned only when the member has provided it in their profile.  | read-only: true | validation: format EMAIL
        - name: contactId | type: string | description: Contact GUID for accessing additional member information with the Contacts API, such as phone numbers, addresses, and custom fields.  Returned only when the member has provided this information in their profile.  | read-only: true | validation: format GUID
        - name: nickname | type: string | description: Member nickname.  Returned only when the member has provided it in their profile.  | read-only: true | validation: maxLength 1000
        - name: profileImageUrl | type: string | description: Profile image URL of the site member.  | read-only: true | validation: format WEB_URL
     - name: lastActivityDate | type: Date | description: Last activity date of the participant in the program (can either be status change or step resolution).  | read-only: true 
     - name: enrollmentStatus | type: EnrollmentStatus | description: Participant's enrollment status in the program.  | read-only: true 
         - enum:
         -     JOINED: Participant is actively enrolled in the program.
         -     SUSPENDED: Enrollment temporarily suspended due to payment issues.
         -     AUTO_REMOVED: Automatically removed via a Wix Automations workflow.
         -     REMOVED: Removed from the program by the site owner.
         -     LEFT: Participant voluntarily left the program.
     - name: progressStatus | type: ProgressStatus | description: Participant's progress status in the program.  | read-only: true 
         - enum:
         -     NOT_STARTED: Enrolled but no steps completed yet.
         -     IN_PROGRESS: At least one step completed but program not yet finished.
         -     COMPLETED: Participant successfully completed the program.
         -     FAILED: Participant failed to complete the program within the deadline.
         -     NOT_APPLICABLE: Progress tracking isn't applicable because the participant left, was removed, or was auto-removed.
     - name: enrollmentInfo | type: EnrollmentInfo | description: Additional information about the participant's enrollment and completion timeframe in the program.  
        - ONE-OF: 
           - name: singlePaymentDetails | type: SinglePaymentDetails | description: Details about a Single Payment enrollment.  
              - name: paymentOrderId | type: string | description: GUID of the cashier order which was used to pay for joining the program.  | validation: format GUID, immutable
              - name: offlineTransactionId | type: string | description: GUID of the offline transaction.  Available only when the participant paid with an offline payment method, such as cash or check.  | validation: format GUID, immutable
           - name: paidPlanDetails | type: PaidPlanDetails | description: Details about a Paid Plan enrollment.  
              - name: paidPlanId | type: string | description: GUID of the Paid Plan for which member has paid to join the program.  | validation: format GUID, immutable
           - name: freeCouponDetails | type: FreeCouponDetails | description: Details about a Free Coupon enrollment.  
              - name: freeCouponId | type: string | description: GUID of the coupon which was applied and gave 100% discount to join the program for free.  | validation: format GUID, immutable
        - name: timeZone | type: string | description: Time zone of the site when the participant was enrolled in the program, in IANA timezone format (e.g., "America/New_York").  | read-only: true | validation: maxLength 50
        - name: startDate | type: string | description: Date when the participant's program timeline begins, in `YYYY-MM-DD` format. If the program's `timeline.startDate` is set, this is that date. Otherwise, it's the local calendar date when the participant is created, based on the site's time zone.  | read-only: true | validation: format LOCAL_DATE
        - name: pricingType | type: PricingType | description: Pricing type used for the participant's enrollment in the program.  
             - enum:
             -     FREE: Member joined a program that is configured as free to join, with no payment required.
             -     ADDED_MANUALLY: Member was added to the program by site owner.
             -     SINGLE_PAYMENT: Member paid once to join the program.
             -     PAID_PLAN: Member joined using a Pricing Plan.
             -     FREE_COUPON: Member joined a paid program using a coupon that provided 100% discount.
        - name: deadline | type: string | description: Date by which the participant must complete the program, in `YYYY-MM-DD` format.  Returned only when the program has a fixed end date, or a duration-based deadline calculated from the participant's start date.  | read-only: true | validation: format LOCAL_DATE
     - name: extendedFields | type: ExtendedFields | description: Custom field data for the participant object.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: tags | type: Tags | description: Tags for categorizing and organizing participants.  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, typically restricted from site members and visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  
  - 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 in case aggregations were requested.  
     - 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: Total number 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: Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values.
                             -     RANGE: Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define.
                             -     SCALAR: Calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
                             -     DATE_HISTOGRAM: Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.).
                             -     NESTED: Flattened list of aggregations, where each 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 participants with status aggregation
Returns enrollment and progress status counts from the participant records that the caller is authorized to access. Participant fields use enum values such as `JOINED`; aggregation buckets use normalized lowercase search values such as `joined`.

```javascript
import { participants } from "@wix/online-programs";

async function searchParticipantsWithStatusAggregation() {
  const response = await participants.searchParticipants({
    filter: {
      programId: {
        $eq: "1a87c246-5c3a-4eea-a7c8-e5e2cf5d61c0",
      },
    },
    aggregations: [
      {
        name: "byEnrollmentAndProgressStatus",
        type: "NESTED",
        nested: {
          nestedAggregations: [
            { name: "enrollmentStatus", type: "VALUE", fieldPath: "enrollmentStatus", value: {} },
            { name: "progressStatus", type: "VALUE", fieldPath: "progressStatus", value: {} },
          ],
        },
      },
    ],
    cursorPaging: {
      limit: 1,
    },
  });

  return response;
}

/* Promise resolves to:
 * {
 *   "participants": [
 *     {
 *       "_id": "43db0e8d-4392-42d8-b3a6-56d412eb71e0",
 *       "programId": "1a87c246-5c3a-4eea-a7c8-e5e2cf5d61c0",
 *       "enrollmentStatus": "JOINED",
 *       "progressStatus": "IN_PROGRESS"
 *     }
 *   ],
 *   "pagingMetadata": { "count": 1, "cursors": {} },
 *   "aggregationData": {
 *     "results": [
 *       {
 *         "name": "byEnrollmentAndProgressStatus",
 *         "type": "NESTED",
 *         "fieldPath": "",
 *         "nested": {
 *           "results": [
 *             {
 *               "results": {
 *                 "enrollmentStatus": { "value": { "value": "joined", "count": 3 } },
 *                 "progressStatus": { "value": { "value": "in_progress", "count": 3 } }
 *               }
 *             }
 *           ]
 *         }
 *       }
 *     ]
 *   }
 * }
 */

```

### Search participants
Searches the participant records that the caller is authorized to access by member name within a program.

```javascript
import { participants } from "@wix/online-programs";

async function searchParticipants() {
  const response = await participants.searchParticipants(
    {
      filter: {
        programId: {
          $eq: "1a87c246-5c3a-4eea-a7c8-e5e2cf5d61c0",
        },
      },
      search: {
        expression: "Alex",
        fields: ["member.firstName", "member.lastName"],
        mode: "OR",
      },
      cursorPaging: {
        limit: 50,
      },
    },
    {
      fields: ["PROGRESS"],
    },
  );

  return response;
}

/* Promise resolves to:
 * {
 *   "participants": [
 *     {
 *       "_id": "43db0e8d-4392-42d8-b3a6-56d412eb71e0",
 *       "programId": "1a87c246-5c3a-4eea-a7c8-e5e2cf5d61c0",
 *       "progressStatus": "IN_PROGRESS",
 *       "progress": {
 *         "totalStepsCompleted": 4,
 *         "totalStepsAvailable": 23,
 *         "completionPercentage": 17.4
 *       }
 *     }
 *   ],
 *   "pagingMetadata": {
 *     "count": 1,
 *     "cursors": {}
 *   }
 * }
 */

```

### searchParticipants (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 { participants } from '@wix/online-programs';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function searchParticipants(search,options) {
  const response = await myWixClient.participants.searchParticipants(search,options);
};
```

---